mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Do not replace unicode characters by LaTeX macros on unicode supported LaTeX engines
This commit is contained in:
@@ -1437,3 +1437,27 @@ def test_index_on_title(app, status, warning):
|
||||
'\\label{\\detokenize{contents:test-for-index-in-top-level-title}}'
|
||||
'\\index{index@\\spxentry{index}}\n'
|
||||
in result)
|
||||
|
||||
|
||||
@pytest.mark.sphinx('latex', testroot='latex-unicode',
|
||||
confoverrides={'latex_engine': 'pdflatex'})
|
||||
def test_texescape_for_non_unicode_supported_engine(app, status, warning):
|
||||
app.builder.build_all()
|
||||
result = (app.outdir / 'python.tex').text()
|
||||
print(result)
|
||||
assert 'script small e: e' in result
|
||||
assert 'double struck italic small i: i' in result
|
||||
assert r'superscript: \(\sp{\text{0}}\), \(\sp{\text{1}}\)' in result
|
||||
assert r'subscript: \(\sb{\text{0}}\), \(\sb{\text{1}}\)' in result
|
||||
|
||||
|
||||
@pytest.mark.sphinx('latex', testroot='latex-unicode',
|
||||
confoverrides={'latex_engine': 'xelatex'})
|
||||
def test_texescape_for_unicode_supported_engine(app, status, warning):
|
||||
app.builder.build_all()
|
||||
result = (app.outdir / 'python.tex').text()
|
||||
print(result)
|
||||
assert 'script small e: e' in result
|
||||
assert 'double struck italic small i: i' in result
|
||||
assert 'superscript: ⁰, ¹' in result
|
||||
assert 'subscript: ₀, ₁' in result
|
||||
|
||||
Reference in New Issue
Block a user