Refs #33247 -- Used XeLaTeX for PDF docs build.

This commit is contained in:
Mariusz Felisiak 2021-11-12 09:36:18 +01:00 committed by GitHub
parent 661316b066
commit adb4100e58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 26 deletions

View File

@ -272,34 +272,22 @@ rst_epilog = """
# -- Options for LaTeX output --------------------------------------------------
# Use lualatex for Unicode support.
latex_engine = 'lualatex'
# Set fonts and fallbacks for CJK and Emojis.
# Use XeLaTeX for Unicode support.
latex_engine = 'xelatex'
latex_use_xindy = False
# Set font for CJK and fallbacks for unicode characters.
latex_elements = {
'fontpkg': r"""
\setmainfont{Symbola}
""",
'preamble': r"""
\directlua{
luaotfload.add_fallback("seriffallbacks", {
"Noto Serif CJK SC:style=Regular;",
"Symbola:Style=Regular;"
})
}
\setmainfont{FreeSerif}[RawFeature={fallback=seriffallbacks}]
\directlua{
luaotfload.add_fallback("sansfallbacks", {
"Noto Sans CJK SC:style=Regular;",
"Symbola:Style=Regular;"
})
}
\setsansfont{FreeSans}[RawFeature={fallback=sansfallbacks}]
\directlua{
luaotfload.add_fallback("monofallbacks", {
"Noto Sans Mono CJK SC:style=Regular;",
"Symbola:Style=Regular;"
})
}
\setmonofont{FreeMono}[RawFeature={fallback=monofallbacks}]
\usepackage{newunicodechar}
\usepackage[UTF8]{ctex}
\newunicodechar{π}{\ensuremath{\pi}}
\newunicodechar{}{\ensuremath{\le}}
\newunicodechar{}{\ensuremath{\ge}}
\newunicodechar{}{\ensuremath{\heartsuit}}
\newunicodechar{}{\ensuremath{\ldots}}
""",
}