mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: fix `addtocaptions
` for sphinxmessages.sty_t if 'babel' empty
For example if config setting `language` is 'ja'. Refs: #5516
This commit is contained in:
parent
af2bb9f80d
commit
259d5053fa
@ -421,7 +421,7 @@ class LaTeXBuilder(Builder):
|
|||||||
# type: () -> None
|
# type: () -> None
|
||||||
formats = self.config.numfig_format
|
formats = self.config.numfig_format
|
||||||
context = {
|
context = {
|
||||||
'addtocaptions': '',
|
'addtocaptions': r'\@iden',
|
||||||
'figurename': formats.get('figure', '').split('%s', 1),
|
'figurename': formats.get('figure', '').split('%s', 1),
|
||||||
'tablename': formats.get('table', '').split('%s', 1),
|
'tablename': formats.get('table', '').split('%s', 1),
|
||||||
'literalblockname': formats.get('code-block', '').split('%s', 1)
|
'literalblockname': formats.get('code-block', '').split('%s', 1)
|
||||||
|
@ -357,9 +357,9 @@ def test_numref_with_language_ja(app, status, warning):
|
|||||||
# sphinxmessages.sty
|
# sphinxmessages.sty
|
||||||
result = (app.outdir / 'sphinxmessages.sty').text(encoding='utf8')
|
result = (app.outdir / 'sphinxmessages.sty').text(encoding='utf8')
|
||||||
print(result)
|
print(result)
|
||||||
assert '\n{\\renewcommand{\\figurename}{図 }}' in result
|
assert '\\@iden{\\renewcommand{\\figurename}{図 }}' in result
|
||||||
assert '\n{\\renewcommand{\\tablename}{表 }}' in result
|
assert '\\@iden{\\renewcommand{\\tablename}{表 }}' in result
|
||||||
assert '\n{\\renewcommand{\\literalblockname}{リスト}}' in result
|
assert '\\@iden{\\renewcommand{\\literalblockname}{リスト}}' in result
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx('latex', testroot='latex-numfig')
|
@pytest.mark.sphinx('latex', testroot='latex-numfig')
|
||||||
@ -540,8 +540,8 @@ def test_babel_with_language_ja(app, status, warning):
|
|||||||
result = (app.outdir / 'sphinxmessages.sty').text(encoding='utf8')
|
result = (app.outdir / 'sphinxmessages.sty').text(encoding='utf8')
|
||||||
print(result)
|
print(result)
|
||||||
assert r'\def\pageautorefname{ページ}' in result
|
assert r'\def\pageautorefname{ページ}' in result
|
||||||
assert '\n{\\renewcommand{\\figurename}{Fig.\\@{} }}' in result
|
assert '\\@iden{\\renewcommand{\\figurename}{Fig.\\@{} }}' in result
|
||||||
assert '\n{\\renewcommand{\\tablename}{Table.\\@{} }}' in result
|
assert '\\@iden{\\renewcommand{\\tablename}{Table.\\@{} }}' in result
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx(
|
@pytest.mark.sphinx(
|
||||||
|
Loading…
Reference in New Issue
Block a user