Skip to contentSkip to conversation

docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks

PATCH Applied Akira Yokosawa 2 participants 5 messages Sep 5, 2024 – Sep 6, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks

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.

---
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(+)
Documentation/sphinx/kerneldoc-preamble.sty +2 -0
index d479cfa73658..5d68395539fe 100644
@@ -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

Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 7 lines · 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).

Quoted 7 lines

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.

I've applied this, thanks.

jon

#2 lore raw
In reply to Akira Yokosawa
Quoted 2 lines · Akira Yokosawa

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

maintainer
#3 lore raw
Quoted 10 lines · Akira Yokosawa
Quoted 2 lines · Akira Yokosawa

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

#4 lore raw

On Fri, 06 Sep 2024 12:58:13 -0600, Jonathan Corbet wrote:
[...]

Quoted 2 lines

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