diff options
author | Akira Yokosawa <akiyks@gmail.com> | 2021-08-09 04:21:29 +0300 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2021-08-12 18:13:32 +0300 |
commit | a90dad8f610a5d14ce1292ac6c7c84b43252afe9 (patch) | |
tree | 47f4418b83510fb6e6fa12befd47acfe1f933400 /Documentation/translations | |
parent | 35382965bdd2feeedd0f2fe326c89db2007149bb (diff) | |
download | linux-a90dad8f610a5d14ce1292ac6c7c84b43252afe9.tar.xz |
docs: pdfdocs: Add conf.py local to translations for ascii-art alignment
Globally choosing "Noto Sans Mono CJK SC" would result in sub-optimal look
of literal blocks in Latin documents.
Therefore, localize the font choice to translations by adding conf.py under
Documentation/translations/.
The local conf.py is enabled when the command:
make SPHINXDIRS=translations pdfdocs
is used to build the PDF.
Resulting translations.pdf (under Documentation/output/translations/pdf)
will have properly aligned ascii-art figures.
NOTE: There remain mis-aligned ascii-art figures in Korean translations.
This is due to the font designer's decision to assign slightly narrower
widths (920) to Hangul characters in "Noto Sans Mono CJK KR" than those
of Hanja (Hanzi/Kanji) characters (1000) [1].
[1]: https://github.com/googlefonts/noto-cjk/issues/17
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Link: https://lore.kernel.org/r/79a876fc-a552-f972-4a1b-c6df4cbb36dd@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/translations')
-rw-r--r-- | Documentation/translations/conf.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/translations/conf.py b/Documentation/translations/conf.py new file mode 100644 index 000000000000..e859c2e19e8b --- /dev/null +++ b/Documentation/translations/conf.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# SPDX-License-Identifier: GPL-2.0 + +# -- Additinal options for LaTeX output ---------------------------------- +# font config for ascii-art alignment + +latex_elements['preamble'] += ''' + \\IfFontExistsTF{Noto Sans CJK SC}{ + % For CJK ascii-art alignment + \\setmonofont{Noto Sans Mono CJK SC} + }{} +''' |