docs: pdfdocs: Enable CJKspace in TOC for Korean titles
authorAkira Yokosawa <akiyks@gmail.com>
Tue, 1 Feb 2022 00:03:16 +0000 (09:03 +0900)
committerJonathan Corbet <corbet@lwn.net>
Tue, 15 Feb 2022 23:35:53 +0000 (16:35 -0700)
Korean (Hangul) titles in Table of Contents of translations.pdf
don't have inter-phrase spaces.

This is because the CJKspace option of xeCJK is disabled by
default.

Restore the spaces by enabling the option at the beginning of every
document and disable it in the \kerneldocBegin{SC|TC|JP} commands.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/19141b3e-01d9-1f6d-5020-42fbda784831@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/conf.py

index e70aa5fd969f37bbbd2a51d3fa6bd0ffed1d2250..ded49b8e9bf63adae4bd678ae27c54e69a0386ac 100644 (file)
@@ -520,6 +520,7 @@ latex_elements['preamble']  += '''
            \\renewcommand{\\CJKrmdefault}{SCserif}%
            \\renewcommand{\\CJKsfdefault}{SCsans}%
            \\renewcommand{\\CJKttdefault}{SCmono}%
+           \\xeCJKsetup{CJKspace = false}%
        }
        \\newcommand{\\kerneldocEndSC}{\\endgroup}
        \\newcommand{\\kerneldocBeginTC}{%
@@ -530,6 +531,7 @@ latex_elements['preamble']  += '''
            \\renewcommand{\\CJKrmdefault}{TCserif}%
            \\renewcommand{\\CJKsfdefault}{TCsans}%
            \\renewcommand{\\CJKttdefault}{TCmono}%
+           \\xeCJKsetup{CJKspace = false}%
        }
        \\newcommand{\\kerneldocEndTC}{\\endgroup}
        \\newcommand{\\kerneldocBeginKR}{%
@@ -538,7 +540,7 @@ latex_elements['preamble']  += '''
            \\renewcommand{\\CJKrmdefault}{KRserif}%
            \\renewcommand{\\CJKsfdefault}{KRsans}%
            \\renewcommand{\\CJKttdefault}{KRmono}%
-           \\xeCJKsetup{CJKspace = true} % For inter-phrase space
+           % \\xeCJKsetup{CJKspace = true} % true by default
        }
        \\newcommand{\\kerneldocEndKR}{\\endgroup}
        \\newcommand{\\kerneldocBeginJP}{%
@@ -547,6 +549,7 @@ latex_elements['preamble']  += '''
            \\renewcommand{\\CJKrmdefault}{JPserif}%
            \\renewcommand{\\CJKsfdefault}{JPsans}%
            \\renewcommand{\\CJKttdefault}{JPmono}%
+           \\xeCJKsetup{CJKspace = false}%
        }
        \\newcommand{\\kerneldocEndJP}{\\endgroup}
        % Single spacing in literal blocks
@@ -555,6 +558,7 @@ latex_elements['preamble']  += '''
        \\usepackage{etoolbox}
        % Inactivate CJK after tableofcontents
        \\apptocmd{\\sphinxtableofcontents}{\\kerneldocCJKoff}{}{}
+       \\xeCJKsetup{CJKspace = true} % For inter-phrase space of Korean TOC
     }{ % No CJK font found
        % Custom macros to on/off CJK (Dummy)
        \\newcommand{\\kerneldocCJKon}{}