Commit b774cc46 authored by Akira Yokosawa's avatar Akira Yokosawa Committed by Jonathan Corbet

docs: pdfdocs: Move CJK monospace font setting to main conf.py

As LaTeX macros for CJK font settings can have Latin-script font
settings as well, settings under Documentation/translations/ can
be moved to the main conf.py.

By this change, translations.pdf built by top-level "make pdfdocs"
can have properly aligned ascii-art diagrams except for Korean
ones.

For the reason of remaining misalignment in Korean diagrams, see
changelog of commit a90dad8f ("docs: pdfdocs: Add conf.py
local to translations for ascii-art alignment").
Signed-off-by: default avatarAkira Yokosawa <akiyks@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/eb87790a-03f4-9f29-c8a3-ef2c3e78ca18@gmail.comSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 5d9158e3
...@@ -521,6 +521,8 @@ latex_elements['preamble'] += ''' ...@@ -521,6 +521,8 @@ latex_elements['preamble'] += '''
\\renewcommand{\\CJKsfdefault}{SCsans}% \\renewcommand{\\CJKsfdefault}{SCsans}%
\\renewcommand{\\CJKttdefault}{SCmono}% \\renewcommand{\\CJKttdefault}{SCmono}%
\\xeCJKsetup{CJKspace = false}% \\xeCJKsetup{CJKspace = false}%
% For CJK ascii-art alignment
\\setmonofont{Noto Sans Mono CJK SC}[AutoFakeSlant]%
} }
\\newcommand{\\kerneldocEndSC}{\\endgroup} \\newcommand{\\kerneldocEndSC}{\\endgroup}
\\newcommand{\\kerneldocBeginTC}{% \\newcommand{\\kerneldocBeginTC}{%
...@@ -532,6 +534,8 @@ latex_elements['preamble'] += ''' ...@@ -532,6 +534,8 @@ latex_elements['preamble'] += '''
\\renewcommand{\\CJKsfdefault}{TCsans}% \\renewcommand{\\CJKsfdefault}{TCsans}%
\\renewcommand{\\CJKttdefault}{TCmono}% \\renewcommand{\\CJKttdefault}{TCmono}%
\\xeCJKsetup{CJKspace = false}% \\xeCJKsetup{CJKspace = false}%
% For CJK ascii-art alignment
\\setmonofont{Noto Sans Mono CJK TC}[AutoFakeSlant]%
} }
\\newcommand{\\kerneldocEndTC}{\\endgroup} \\newcommand{\\kerneldocEndTC}{\\endgroup}
\\newcommand{\\kerneldocBeginKR}{% \\newcommand{\\kerneldocBeginKR}{%
...@@ -541,6 +545,8 @@ latex_elements['preamble'] += ''' ...@@ -541,6 +545,8 @@ latex_elements['preamble'] += '''
\\renewcommand{\\CJKsfdefault}{KRsans}% \\renewcommand{\\CJKsfdefault}{KRsans}%
\\renewcommand{\\CJKttdefault}{KRmono}% \\renewcommand{\\CJKttdefault}{KRmono}%
% \\xeCJKsetup{CJKspace = true} % true by default % \\xeCJKsetup{CJKspace = true} % true by default
% For CJK ascii-art alignment (still misaligned for Hangul)
\\setmonofont{Noto Sans Mono CJK KR}[AutoFakeSlant]%
} }
\\newcommand{\\kerneldocEndKR}{\\endgroup} \\newcommand{\\kerneldocEndKR}{\\endgroup}
\\newcommand{\\kerneldocBeginJP}{% \\newcommand{\\kerneldocBeginJP}{%
...@@ -550,6 +556,8 @@ latex_elements['preamble'] += ''' ...@@ -550,6 +556,8 @@ latex_elements['preamble'] += '''
\\renewcommand{\\CJKsfdefault}{JPsans}% \\renewcommand{\\CJKsfdefault}{JPsans}%
\\renewcommand{\\CJKttdefault}{JPmono}% \\renewcommand{\\CJKttdefault}{JPmono}%
\\xeCJKsetup{CJKspace = false}% \\xeCJKsetup{CJKspace = false}%
% For CJK ascii-art alignment
\\setmonofont{Noto Sans Mono CJK JP}[AutoFakeSlant]%
} }
\\newcommand{\\kerneldocEndJP}{\\endgroup} \\newcommand{\\kerneldocEndJP}{\\endgroup}
% Single spacing in literal blocks % Single spacing in literal blocks
......
# -*- 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}[AutoFakeSlant]
}{}
'''
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment