linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks
@ 2024-09-05  5:09 Akira Yokosawa
  2024-09-05 20:17 ` Jonathan Corbet
  2024-09-05 23:35 ` Akira Yokosawa
  0 siblings, 2 replies; 5+ messages in thread
From: Akira Yokosawa @ 2024-09-05  5:09 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, Akira Yokosawa

In zh_CN part of translations.pdf, there are several ASCII-art
diagrams whose vertical lines look sometimes jagged.
This is due to the interference between default settings of xeCJK
and fancyvrb (employed in sphinxVerbatim env), where extra space
is inserted between a latin char and a non-latin char when they
are next to each other (i.e., no explicit white space).

This issue can be suppressed by invoking \CJKsetecglue{} at the
beginning of every sphinxVerbatim enviornment.

\AtBeginEnvironment, provided by the etoolbox package, is useful in
this case.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
The issue can be seen in, e.g., an ASCII-art diagram in section
"ACRN 超级管理器介绍" in the zh_CN translation.

Note for Jon:
  Current docs-next won't complete full "make htmldocs".
  If you'd like to see the effect of this change, please use
  "SPHINXDIRS=translations" option.

  Fix to the build issue was merged as of v6.11-rc2 as:
  commit 914f8961879d ("media: v4l: Fix missing tabular column hint
  for Y14P format").

        Thanks, Akira
---
 Documentation/sphinx/kerneldoc-preamble.sty | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/sphinx/kerneldoc-preamble.sty b/Documentation/sphinx/kerneldoc-preamble.sty
index d479cfa73658..5d68395539fe 100644
--- a/Documentation/sphinx/kerneldoc-preamble.sty
+++ b/Documentation/sphinx/kerneldoc-preamble.sty
@@ -199,6 +199,8 @@
     % Inactivate CJK after tableofcontents
     \apptocmd{\sphinxtableofcontents}{\kerneldocCJKoff}{}{}
     \xeCJKsetup{CJKspace = true}% For inter-phrase space of Korean TOC
+    % Suppress extra white space at latin .. non-latin in literal blocks
+    \AtBeginEnvironment{sphinxVerbatim}{\CJKsetecglue{}}
 }{ % Don't enable CJK
     % Custom macros to on/off CJK and switch CJK fonts (Dummy)
     \newcommand{\kerneldocCJKon}{}

base-commit: f92a24ae7c953263600fc7ea3f0594676ea82138
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks
  2024-09-05  5:09 [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks Akira Yokosawa
@ 2024-09-05 20:17 ` Jonathan Corbet
  2024-09-05 23:35 ` Akira Yokosawa
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Corbet @ 2024-09-05 20:17 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: linux-doc, Akira Yokosawa

Akira Yokosawa <akiyks@gmail.com> writes:

> In zh_CN part of translations.pdf, there are several ASCII-art
> diagrams whose vertical lines look sometimes jagged.
> This is due to the interference between default settings of xeCJK
> and fancyvrb (employed in sphinxVerbatim env), where extra space
> is inserted between a latin char and a non-latin char when they
> are next to each other (i.e., no explicit white space).
>
> This issue can be suppressed by invoking \CJKsetecglue{} at the
> beginning of every sphinxVerbatim enviornment.
>
> \AtBeginEnvironment, provided by the etoolbox package, is useful in
> this case.
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>

I've applied this, thanks.

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks
  2024-09-05  5:09 [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks Akira Yokosawa
  2024-09-05 20:17 ` Jonathan Corbet
@ 2024-09-05 23:35 ` Akira Yokosawa
  2024-09-06 18:58   ` Jonathan Corbet
  1 sibling, 1 reply; 5+ messages in thread
From: Akira Yokosawa @ 2024-09-05 23:35 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, Akira Yokosawa

On Thu,  5 Sep 2024 14:09:41 +0900, Akira Yokosawa wrote:
> Note for Jon:
>   Current docs-next won't complete full "make htmldocs".

Oh well...
I made a typo here, I wanted to say       "make pdfdocs"

Jon, looks like it affected the change log of the back merge.

Is it too late to amend it?

        Thanks, Akira


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks
  2024-09-05 23:35 ` Akira Yokosawa
@ 2024-09-06 18:58   ` Jonathan Corbet
  2024-09-06 23:46     ` Akira Yokosawa
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Corbet @ 2024-09-06 18:58 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: linux-doc, Akira Yokosawa

Akira Yokosawa <akiyks@gmail.com> writes:

> On Thu,  5 Sep 2024 14:09:41 +0900, Akira Yokosawa wrote:
>> Note for Jon:
>>   Current docs-next won't complete full "make htmldocs".
>
> Oh well...
> I made a typo here, I wanted to say       "make pdfdocs"
>
> Jon, looks like it affected the change log of the back merge.
>
> Is it too late to amend it?

I'd have to rebase the tree, which I prefer to avoid when I can.  And it
*did* create troubles for the htmldocs build too...:)

Thanks,

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks
  2024-09-06 18:58   ` Jonathan Corbet
@ 2024-09-06 23:46     ` Akira Yokosawa
  0 siblings, 0 replies; 5+ messages in thread
From: Akira Yokosawa @ 2024-09-06 23:46 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, Akira Yokosawa

On Fri, 06 Sep 2024 12:58:13 -0600, Jonathan Corbet wrote:
[...]
> I'd have to rebase the tree, which I prefer to avoid when I can.  And it
> *did* create troubles for the htmldocs build too...:)

Aha, this one (as of commit eb5ed2fae197)!

<...>/Documentation/ABI/testing/sysfs-bus-i2c-devices-turris-omnia-mcu:26: ERROR: Unexpected indentation.

To be clear, I didn't anticipate a backport just for the sake of fixing
pdfdocs build.  Lucky for me v6.11-rc6 has the fix to it, too.

        Thanks, Akira


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-06 23:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-05  5:09 [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks Akira Yokosawa
2024-09-05 20:17 ` Jonathan Corbet
2024-09-05 23:35 ` Akira Yokosawa
2024-09-06 18:58   ` Jonathan Corbet
2024-09-06 23:46     ` Akira Yokosawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).