Skip to content

Commit

Permalink
Fix sphinx-doc#8508: LaTeX: uplatex becomes a default setting of late…
Browse files Browse the repository at this point in the history
…x_engine for Japanese

Since v2.3, Sphinx supports uplatex as an alternative of latex_engine for Japanese
docs (refs: sphinx-doc#4186, sphinx-doc#6841). uplatex is able to build a document without conversion
character encoding internally. It allows using unicode characters in documents.
Additionally, uplatex is compatible with platex (current default latex_engine for
Japanese docs).

This changes the default latex_engine for Japanese document to uplatex.
  • Loading branch information
tk0miya committed Nov 29, 2020
1 parent 143e7fe commit 73525f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -20,6 +20,8 @@ Incompatible changes
:confval:`man_make_section_directory`)
* #8380: html search: search results are wrapped with ``<p>`` instead of
``<div>``
* #8508: LaTeX: uplatex becomes a default setting of latex_engine for Japanese
documents

Deprecated
----------
Expand Down
8 changes: 6 additions & 2 deletions doc/usage/configuration.rst
Expand Up @@ -1903,8 +1903,8 @@ These options influence LaTeX output.
* ``'pdflatex'`` -- PDFLaTeX (default)
* ``'xelatex'`` -- XeLaTeX
* ``'lualatex'`` -- LuaLaTeX
* ``'platex'`` -- pLaTeX (default if :confval:`language` is ``'ja'``)
* ``'uplatex'`` -- upLaTeX (experimental)
* ``'platex'`` -- pLaTeX
* ``'uplatex'`` -- upLaTeX (default if :confval:`language` is ``'ja'``)

``'pdflatex'``\ 's support for Unicode characters is limited.

Expand Down Expand Up @@ -1934,6 +1934,10 @@ These options influence LaTeX output.

Add ``uplatex`` support.

.. versionchanged:: 4.0

``uplatex`` becomes the default setting of Japanese documents.

Contrarily to :ref:`MathJaX math rendering in HTML output <math-support>`,
LaTeX requires some extra configuration to support Unicode literals in
:rst:dir:`math`: the only comprehensive solution (as far as we know) is to
Expand Down
2 changes: 1 addition & 1 deletion sphinx/builders/latex/__init__.py
Expand Up @@ -482,7 +482,7 @@ def install_packages_for_ja(app: Sphinx) -> None:
def default_latex_engine(config: Config) -> str:
""" Better default latex_engine settings for specific languages. """
if config.language == 'ja':
return 'platex'
return 'uplatex'
elif (config.language or '').startswith('zh'):
return 'xelatex'
elif config.language == 'el':
Expand Down

0 comments on commit 73525f8

Please sign in to comment.