Skip to content

Commit

Permalink
zh pdf test
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuore committed Oct 4, 2018
1 parent 3322129 commit e22f4b8
Showing 1 changed file with 44 additions and 6 deletions.
50 changes: 44 additions & 6 deletions docs/conf.py
Expand Up @@ -58,7 +58,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = u'zh_CN'
language = u'zh'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -105,9 +105,9 @@


# -- Options for LaTeX output ------------------------------------------------
latex_engine = 'lualatex'
latex_engine = 'xelatex'

latex_elements = {
#latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
Expand All @@ -118,14 +118,52 @@

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
#'preamble': r'''\usepackage{ctex}
#''',


# Latex figure (float) alignment
#
# 'figure_align': 'htbp',

'extraclassoptions': 'UTF8'
}
#'extraclassoptions': 'UTF8'
#}

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
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': 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}}
''',
}
else:
latex_elements = {
'papersize' : 'a4paper',
'utf8extra' : '',
'inputenc' : '',
'babel' : r'''\usepackage[english]{babel}''',
'preamble' : r'''
\usepackage{ctex}
''',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
Expand Down

0 comments on commit e22f4b8

Please sign in to comment.