Merge tag 'linux-kselftest-kunit-5.15-rc1' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-microblaze.git] / Documentation / conf.py
index b440cb6..75650f6 100644 (file)
@@ -341,6 +341,9 @@ latex_elements = {
         verbatimhintsturnover=false,
     ''',
 
+    # For CJK One-half spacing, need to be in front of hyperref
+    'extrapackages': r'\usepackage{setspace}',
+
     # Additional stuff for the LaTeX preamble.
     'preamble': '''
        % Prevent column squeezing of tabulary.
@@ -360,11 +363,93 @@ latex_elements['preamble']  += '''
     \\IfFontExistsTF{Noto Sans CJK SC}{
        % This is needed for translations
        \\usepackage{xeCJK}
-       \\setCJKmainfont{Noto Sans CJK SC}
+       \\IfFontExistsTF{Noto Serif CJK SC}{
+           \\setCJKmainfont{Noto Serif CJK SC}[AutoFakeSlant]
+       }{
+           \\setCJKmainfont{Noto Sans CJK SC}[AutoFakeSlant]
+       }
+       \\setCJKsansfont{Noto Sans CJK SC}[AutoFakeSlant]
+       \\setCJKmonofont{Noto Sans Mono CJK SC}[AutoFakeSlant]
+       % CJK Language-specific font choices
+       \\IfFontExistsTF{Noto Serif CJK SC}{
+           \\newCJKfontfamily[SCmain]\\scmain{Noto Serif CJK SC}[AutoFakeSlant]
+           \\newCJKfontfamily[SCserif]\\scserif{Noto Serif CJK SC}[AutoFakeSlant]
+       }{
+           \\newCJKfontfamily[SCmain]\\scmain{Noto Sans CJK SC}[AutoFakeSlant]
+           \\newCJKfontfamily[SCserif]\\scserif{Noto Sans CJK SC}[AutoFakeSlant]
+       }
+       \\newCJKfontfamily[SCsans]\\scsans{Noto Sans CJK SC}[AutoFakeSlant]
+       \\newCJKfontfamily[SCmono]\\scmono{Noto Sans Mono CJK SC}[AutoFakeSlant]
+       \\IfFontExistsTF{Noto Serif CJK TC}{
+           \\newCJKfontfamily[TCmain]\\tcmain{Noto Serif CJK TC}[AutoFakeSlant]
+           \\newCJKfontfamily[TCserif]\\tcserif{Noto Serif CJK TC}[AutoFakeSlant]
+       }{
+           \\newCJKfontfamily[TCmain]\\tcmain{Noto Sans CJK TC}[AutoFakeSlant]
+           \\newCJKfontfamily[TCserif]\\tcserif{Noto Sans CJK TC}[AutoFakeSlant]
+       }
+       \\newCJKfontfamily[TCsans]\\tcsans{Noto Sans CJK TC}[AutoFakeSlant]
+       \\newCJKfontfamily[TCmono]\\tcmono{Noto Sans Mono CJK TC}[AutoFakeSlant]
+       \\IfFontExistsTF{Noto Serif CJK KR}{
+           \\newCJKfontfamily[KRmain]\\krmain{Noto Serif CJK KR}[AutoFakeSlant]
+           \\newCJKfontfamily[KRserif]\\krserif{Noto Serif CJK KR}[AutoFakeSlant]
+       }{
+           \\newCJKfontfamily[KRmain]\\krmain{Noto Sans CJK KR}[AutoFakeSlant]
+           \\newCJKfontfamily[KRserif]\\krserif{Noto Sans CJK KR}[AutoFakeSlant]
+       }
+       \\newCJKfontfamily[KRsans]\\krsans{Noto Sans CJK KR}[AutoFakeSlant]
+       \\newCJKfontfamily[KRmono]\\krmono{Noto Sans Mono CJK KR}[AutoFakeSlant]
+       \\IfFontExistsTF{Noto Serif CJK JP}{
+           \\newCJKfontfamily[JPmain]\\jpmain{Noto Serif CJK JP}[AutoFakeSlant]
+           \\newCJKfontfamily[JPserif]\\jpserif{Noto Serif CJK JP}[AutoFakeSlant]
+       }{
+           \\newCJKfontfamily[JPmain]\\jpmain{Noto Sans CJK JP}[AutoFakeSlant]
+           \\newCJKfontfamily[JPserif]\\jpserif{Noto Sans CJK JP}[AutoFakeSlant]
+       }
+       \\newCJKfontfamily[JPsans]\\jpsans{Noto Sans CJK JP}[AutoFakeSlant]
+       \\newCJKfontfamily[JPmono]\\jpmono{Noto Sans Mono CJK JP}[AutoFakeSlant]
+       % Dummy commands for Sphinx < 2.3 (no 'extrapackages' support)
+       \\providecommand{\\onehalfspacing}{}
+       \\providecommand{\\singlespacing}{}
        % Define custom macros to on/off CJK
-       \\newcommand{\\kerneldocCJKon}{\\makexeCJKactive}
-       \\newcommand{\\kerneldocCJKoff}{\\makexeCJKinactive}
-       % To customize \sphinxtableofcontents
+       \\newcommand{\\kerneldocCJKon}{\\makexeCJKactive\\onehalfspacing}
+       \\newcommand{\\kerneldocCJKoff}{\\makexeCJKinactive\\singlespacing}
+       \\newcommand{\\kerneldocBeginSC}{%
+           \\begingroup%
+           \\scmain%
+       }
+       \\newcommand{\\kerneldocEndSC}{\\endgroup}
+       \\newcommand{\\kerneldocBeginTC}{%
+           \\begingroup%
+           \\tcmain%
+           \\renewcommand{\\CJKrmdefault}{TCserif}%
+           \\renewcommand{\\CJKsfdefault}{TCsans}%
+           \\renewcommand{\\CJKttdefault}{TCmono}%
+       }
+       \\newcommand{\\kerneldocEndTC}{\\endgroup}
+       \\newcommand{\\kerneldocBeginKR}{%
+           \\begingroup%
+           \\xeCJKDeclareCharClass{HalfLeft}{`“,`‘}%
+           \\xeCJKDeclareCharClass{HalfRight}{`”,`’}%
+           \\krmain%
+           \\renewcommand{\\CJKrmdefault}{KRserif}%
+           \\renewcommand{\\CJKsfdefault}{KRsans}%
+           \\renewcommand{\\CJKttdefault}{KRmono}%
+           \\xeCJKsetup{CJKspace = true} % For inter-phrase space
+       }
+       \\newcommand{\\kerneldocEndKR}{\\endgroup}
+       \\newcommand{\\kerneldocBeginJP}{%
+           \\begingroup%
+           \\xeCJKDeclareCharClass{HalfLeft}{`“,`‘}%
+           \\xeCJKDeclareCharClass{HalfRight}{`”,`’}%
+           \\jpmain%
+           \\renewcommand{\\CJKrmdefault}{JPserif}%
+           \\renewcommand{\\CJKsfdefault}{JPsans}%
+           \\renewcommand{\\CJKttdefault}{JPmono}%
+       }
+       \\newcommand{\\kerneldocEndJP}{\\endgroup}
+       % Single spacing in literal blocks
+       \\fvset{baselinestretch=1}
+       % To customize \\sphinxtableofcontents
        \\usepackage{etoolbox}
        % Inactivate CJK after tableofcontents
        \\apptocmd{\\sphinxtableofcontents}{\\kerneldocCJKoff}{}{}
@@ -372,6 +457,14 @@ latex_elements['preamble']  += '''
        % Custom macros to on/off CJK (Dummy)
        \\newcommand{\\kerneldocCJKon}{}
        \\newcommand{\\kerneldocCJKoff}{}
+       \\newcommand{\\kerneldocBeginSC}{}
+       \\newcommand{\\kerneldocEndSC}{}
+       \\newcommand{\\kerneldocBeginTC}{}
+       \\newcommand{\\kerneldocEndTC}{}
+       \\newcommand{\\kerneldocBeginKR}{}
+       \\newcommand{\\kerneldocEndKR}{}
+       \\newcommand{\\kerneldocBeginSC}{}
+       \\newcommand{\\kerneldocEndKR}{}
     }
 '''