[Docs] Fix some bugs in readthedocs pdf build. (#383)

* Add escape symbols for underscores in formulas.

* Support Chinese characters in pdf output.
pull/384/head
Ma Zerun 2021-07-31 14:49:36 +08:00 committed by GitHub
parent 469d88c21b
commit e8822ebaec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 4 deletions

View File

@ -74,6 +74,26 @@ html_theme = 'sphinx_rtd_theme'
master_doc = 'index'
latex_elements = {
# 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}}
''',
}
def builder_inited_handler(app):
subprocess.run(['./stat.py'])

View File

@ -93,8 +93,8 @@ class RandAugment(object):
When magnitude_std=0, we calculate the magnitude as follows:
.. math::
\text{magnitude} = \frac{\text{magnitude_level}}
{\text{total_level}} \times (\text{val2} - \text{val1})
\text{magnitude} = \frac{\text{magnitude\_level}}
{\text{total\_level}} \times (\text{val2} - \text{val1})
+ \text{val1}
"""

View File

@ -721,8 +721,8 @@ class CenterCrop(object):
to perform the center crop with the ``crop_size_`` as:
.. math::
\text{crop_size_} = \frac{\text{crop_size}}{\text{crop_size} +
\text{crop_padding}} \times \text{short_edge}
\text{crop\_size\_} = \frac{\text{crop\_size}}{\text{crop\_size} +
\text{crop\_padding}} \times \text{short\_edge}
And then the pipeline resizes the img to the input crop size.
"""