mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix LaTeX writer handling of user custom numfig_format
This commit is contained in:
parent
7ff7dfc427
commit
18bf90822c
@ -796,7 +796,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
ret.append(self.babel_renewcommand('\\figurename', definition))
|
||||
if figure[1]:
|
||||
ret.append('\\makeatletter\n')
|
||||
ret.append('\\def\\fnum@figure{\\figurename\\thefigure%s}\n' %
|
||||
ret.append('\\def\\fnum@figure{\\figurename\\thefigure{}%s}\n' %
|
||||
text_type(figure[1]).strip().translate(tex_escape_map))
|
||||
ret.append('\\makeatother\n')
|
||||
|
||||
@ -809,7 +809,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
ret.append(self.babel_renewcommand('\\tablename', definition))
|
||||
if table[1]:
|
||||
ret.append('\\makeatletter\n')
|
||||
ret.append('\\def\\fnum@table{\\tablename\\thetable%s}\n' %
|
||||
ret.append('\\def\\fnum@table{\\tablename\\thetable{}%s}\n' %
|
||||
text_type(table[1]).strip().translate(tex_escape_map))
|
||||
ret.append('\\makeatother\n')
|
||||
|
||||
|
@ -289,9 +289,9 @@ def test_numref_with_prefix2(app, status, warning):
|
||||
print(status.getvalue())
|
||||
print(warning.getvalue())
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Figure:}}' in result
|
||||
assert '\\def\\fnum@figure{\\figurename\\thefigure.}' in result
|
||||
assert '\\def\\fnum@figure{\\figurename\\thefigure{}.}' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Tab\\_}}' in result
|
||||
assert '\\def\\fnum@table{\\tablename\\thetable:}' in result
|
||||
assert '\\def\\fnum@table{\\tablename\\thetable{}:}' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\literalblockname}{Code-}}' in result
|
||||
assert ('\\hyperref[\\detokenize{index:fig1}]'
|
||||
'{Figure:\\ref{\\detokenize{index:fig1}}.\\@}') in result
|
||||
|
Loading…
Reference in New Issue
Block a user