mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #8508: LaTeX: uplatex becomes a default setting of latex_engine for Japanese
Since v2.3, Sphinx supports uplatex as an alternative of latex_engine for Japanese docs (refs: #4186, #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.
This commit is contained in:
parent
143e7fe1e7
commit
1d9eeedde3
2
CHANGES
2
CHANGES
@ -20,6 +20,8 @@ Incompatible changes
|
|||||||
:confval:`man_make_section_directory`)
|
:confval:`man_make_section_directory`)
|
||||||
* #8380: html search: search results are wrapped with ``<p>`` instead of
|
* #8380: html search: search results are wrapped with ``<p>`` instead of
|
||||||
``<div>``
|
``<div>``
|
||||||
|
* #8508: LaTeX: uplatex becomes a default setting of latex_engine for Japanese
|
||||||
|
documents
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
----------
|
----------
|
||||||
|
@ -1903,8 +1903,8 @@ These options influence LaTeX output.
|
|||||||
* ``'pdflatex'`` -- PDFLaTeX (default)
|
* ``'pdflatex'`` -- PDFLaTeX (default)
|
||||||
* ``'xelatex'`` -- XeLaTeX
|
* ``'xelatex'`` -- XeLaTeX
|
||||||
* ``'lualatex'`` -- LuaLaTeX
|
* ``'lualatex'`` -- LuaLaTeX
|
||||||
* ``'platex'`` -- pLaTeX (default if :confval:`language` is ``'ja'``)
|
* ``'platex'`` -- pLaTeX
|
||||||
* ``'uplatex'`` -- upLaTeX (experimental)
|
* ``'uplatex'`` -- upLaTeX (default if :confval:`language` is ``'ja'``)
|
||||||
|
|
||||||
``'pdflatex'``\ 's support for Unicode characters is limited.
|
``'pdflatex'``\ 's support for Unicode characters is limited.
|
||||||
|
|
||||||
@ -1934,6 +1934,10 @@ These options influence LaTeX output.
|
|||||||
|
|
||||||
Add ``uplatex`` support.
|
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>`,
|
Contrarily to :ref:`MathJaX math rendering in HTML output <math-support>`,
|
||||||
LaTeX requires some extra configuration to support Unicode literals in
|
LaTeX requires some extra configuration to support Unicode literals in
|
||||||
:rst:dir:`math`: the only comprehensive solution (as far as we know) is to
|
:rst:dir:`math`: the only comprehensive solution (as far as we know) is to
|
||||||
|
@ -482,7 +482,7 @@ def install_packages_for_ja(app: Sphinx) -> None:
|
|||||||
def default_latex_engine(config: Config) -> str:
|
def default_latex_engine(config: Config) -> str:
|
||||||
""" Better default latex_engine settings for specific languages. """
|
""" Better default latex_engine settings for specific languages. """
|
||||||
if config.language == 'ja':
|
if config.language == 'ja':
|
||||||
return 'platex'
|
return 'uplatex'
|
||||||
elif (config.language or '').startswith('zh'):
|
elif (config.language or '').startswith('zh'):
|
||||||
return 'xelatex'
|
return 'xelatex'
|
||||||
elif config.language == 'el':
|
elif config.language == 'el':
|
||||||
|
@ -197,7 +197,7 @@ def test_latex_basic_manual_ja(app, status, warning):
|
|||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
result = (app.outdir / 'test.tex').read_text(encoding='utf8')
|
result = (app.outdir / 'test.tex').read_text(encoding='utf8')
|
||||||
print(result)
|
print(result)
|
||||||
assert r'\def\sphinxdocclass{jsbook}' in result
|
assert r'\def\sphinxdocclass{ujbook}' in result
|
||||||
assert r'\documentclass[letterpaper,10pt,dvipdfmx]{sphinxmanual}' in result
|
assert r'\documentclass[letterpaper,10pt,dvipdfmx]{sphinxmanual}' in result
|
||||||
|
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ def test_latex_basic_howto_ja(app, status, warning):
|
|||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
result = (app.outdir / 'test.tex').read_text(encoding='utf8')
|
result = (app.outdir / 'test.tex').read_text(encoding='utf8')
|
||||||
print(result)
|
print(result)
|
||||||
assert r'\def\sphinxdocclass{jreport}' in result
|
assert r'\def\sphinxdocclass{ujreport}' in result
|
||||||
assert r'\documentclass[letterpaper,10pt,dvipdfmx]{sphinxhowto}' in result
|
assert r'\documentclass[letterpaper,10pt,dvipdfmx]{sphinxhowto}' in result
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user