diff --git a/docs/conf.py b/docs/conf.py index bbd145890a0d56f24ac4a46a8534cbff6c3b2547..6c03dd1423a0f16105cb71273b79633d85a11488 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,3 +32,24 @@ extensions = [ 'sphinx.ext.todo', 'sphinx.ext.mathjax', ] + +latex_elements = { + # Additional stuff for the LaTeX preamble, to generate Chinese correctly. + 'preamble': + r''' + \hypersetup{unicode=true} + \usepackage{CJKutf8} + \DeclareUnicodeCharacter{00A0}{\nobreakspace} + \DeclareUnicodeCharacter{2203}{\ensuremath{\exists}} + \DeclareUnicodeCharacter{2200}{\ensuremath{\forall}} + \DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}} + \DeclareUnicodeCharacter{2713}{x} + \DeclareUnicodeCharacter{27FA}{\ensuremath{\Longleftrightarrow}} + \DeclareUnicodeCharacter{221A}{\ensuremath{\sqrt{}}} + \DeclareUnicodeCharacter{221B}{\ensuremath{\sqrt[3]{}}} + \DeclareUnicodeCharacter{2295}{\ensuremath{\oplus}} + \DeclareUnicodeCharacter{2297}{\ensuremath{\otimes}} + \begin{CJK}{UTF8}{gbsn} + \AtEndDocument{\end{CJK}} + ''', +}