From 21e053284b95e58557e885aab847de76f2544355 Mon Sep 17 00:00:00 2001 From: LI Yunxiang <39279048+Banmahhhh@users.noreply.github.com> Date: Thu, 14 May 2020 15:23:19 +0800 Subject: [PATCH] chinese in doc (#266) * Update getting_started.rst * compile doc with chinese * yapf --- .copyright.hook | 1 - docs/conf.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.copyright.hook b/.copyright.hook index 3be6d0a..1b0acac 100644 --- a/.copyright.hook +++ b/.copyright.hook @@ -1,6 +1,5 @@ from __future__ import absolute_import from __future__ import print_function -from __future__ import unicode_literals import argparse import io, re diff --git a/docs/conf.py b/docs/conf.py index 2cb758d..29f697d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -107,3 +107,31 @@ latex_use_xindy = False latex_elements = { 'preamble': '\\usepackage[UTF8]{ctex}\n', } + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + #'preamble': '', + '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}} + ''', +} -- GitLab