Skip to content

Commit a90dad8

Browse files
akiyksJonathan Corbet
authored andcommitted
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]: notofonts/noto-cjk#17 Signed-off-by: Akira Yokosawa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Corbet <[email protected]>
1 parent 3538296 commit a90dad8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Documentation/translations/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- coding: utf-8 -*-
2+
# SPDX-License-Identifier: GPL-2.0
3+
4+
# -- Additinal options for LaTeX output ----------------------------------
5+
# font config for ascii-art alignment
6+
7+
latex_elements['preamble'] += '''
8+
\\IfFontExistsTF{Noto Sans CJK SC}{
9+
% For CJK ascii-art alignment
10+
\\setmonofont{Noto Sans Mono CJK SC}
11+
}{}
12+
'''

0 commit comments

Comments
 (0)