Skip to content

Commit 0be1206

Browse files
committed
Guide to build PDF for non-ASCII language
1 parent 54397a0 commit 0be1206

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Build PDF format for non-ASCII languages
2+
========================================
3+
4+
Sphinx comes with support for different `LaTeX engines`_ that support non-ASCII languages,
5+
like Japanese or Chinese, for example.
6+
By default Sphinx uses ``pdflatex``,
7+
which does not have good support for Unicode characters and may make the PDF builder to fail on these languages.
8+
9+
.. _LaTeX engines: http://www.sphinx-doc.org/en/master/usage/configuration.html#confval-latex_engine
10+
11+
In case you want to build your documentation in PDF format you need to configure Sphinx properly,
12+
so Read the Docs can execute the proper commands depending on these settings.
13+
There are `several settings that can be defined`_ (all the ones starting with ``latex_``),
14+
to modify Sphinx and Read the Docs behavior to make your documentation to build properly.
15+
16+
.. _several settings that can be defined: http://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-latex-output
17+
18+
Here is an useful example of the settings defined in ``conf.py`` for many Chinese projects:
19+
20+
.. code-block:: python
21+
22+
latex_engine = 'xelatex'
23+
latex_use_xindy = False
24+
latex_elements = {
25+
'preamble': '\\usepackage[UTF8]{ctex}\n',
26+
}
27+
28+
29+
.. note::
30+
31+
``xindy`` is currently not supported by Read the Docs,
32+
but we plan to support it in the near future.

0 commit comments

Comments
 (0)