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:
jfbu committed 2019-01-06 10:05:02 +01:00
1 parent af2bb9f80d
commit 259d5053fa
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -421,7 +421,7 @@ class LaTeXBuilder(Builder):
# type: () -> None
formats = self.config.numfig_format
context = {
'addtocaptions': '',
'addtocaptions': r'\@iden',
'figurename': formats.get('figure', '').split('%s', 1),
'tablename': formats.get('table', '').split('%s', 1),
'literalblockname': formats.get('code-block', '').split('%s', 1)
+5 -5
View File
@@ -357,9 +357,9 @@ def test_numref_with_language_ja(app, status, warning):
# sphinxmessages.sty
result = (app.outdir / 'sphinxmessages.sty').text(encoding='utf8')
print(result)
assert '\n{\\renewcommand{\\figurename}{図 }}' in result
assert '\n{\\renewcommand{\\tablename}{表 }}' in result
assert '\n{\\renewcommand{\\literalblockname}{リスト}}' in result
assert '\\@iden{\\renewcommand{\\figurename}{図 }}' in result
assert '\\@iden{\\renewcommand{\\tablename}{表 }}' in result
assert '\\@iden{\\renewcommand{\\literalblockname}{リスト}}' in result
@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')
print(result)
assert r'\def\pageautorefname{ページ}' in result
assert '\n{\\renewcommand{\\figurename}{Fig.\\@{} }}' in result
assert '\n{\\renewcommand{\\tablename}{Table.\\@{} }}' in result
assert '\\@iden{\\renewcommand{\\figurename}{Fig.\\@{} }}' in result
assert '\\@iden{\\renewcommand{\\tablename}{Table.\\@{} }}' in result
@pytest.mark.sphinx(