Skip to content

Commit

Permalink
conf: add support for chinese pdf generation
Browse files Browse the repository at this point in the history
Signed-off-by: Huaqi Fang <[email protected]>
  • Loading branch information
fanghuaqi committed Aug 19, 2024
1 parent eb84000 commit 6cc05f2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,32 @@
breathe_show_define_initializer = True

# -- Options for Latex output -------------------------------------------------
latex_engine = "xelatex"
latex_logo = 'asserts/logo/logo.png'
latex_show_pagerefs = True
latex_toplevel_sectioning = 'chapter'
latex_show_urls = 'footnote'
latex_documents = [("index", "%s.tex"%(pdfname), project, author, "manual", False) ]

# refer https://github.com/StephenPCG/docker-sphinx-cjk-pdf
# https://www.sphinx-doc.org/en/master/latex.html#module-latex
# See available font: fc-list :lang=zh
latex_elements = {
'papersize': 'a4paper',
'utf8extra': '',
'inputenc': '',
'babel': '',
'preamble': r'''
\usepackage{xeCJK}
\usepackage{indentfirst}
\setlength{\parindent}{2em}
\setCJKmainfont{AR PL KaitiM GB}
\setCJKmonofont{AR PL KaitiM GB}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
''',
}

rst_prolog = """
.. |nuclei_contact| replace:: [email protected]
.. |nuclei_usercenter| replace:: http://user.nucleisys.com
Expand Down

0 comments on commit 6cc05f2

Please sign in to comment.