linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks
Date: Thu,  5 Sep 2024 14:09:41 +0900	[thread overview]
Message-ID: <20240905050941.31439-1-akiyks@gmail.com> (raw)

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


             reply	other threads:[~2024-09-05  5:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05  5:09 Akira Yokosawa [this message]
2024-09-05 20:17 ` [PATCH] docs: kerneldoc-preamble.sty: Suppress extra spaces in CJK literal blocks Jonathan Corbet
2024-09-05 23:35 ` Akira Yokosawa
2024-09-06 18:58   ` Jonathan Corbet
2024-09-06 23:46     ` Akira Yokosawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240905050941.31439-1-akiyks@gmail.com \
    --to=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).