mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3343 from tk0miya/adjust_space_after_captions
Fix #3158: too much space after captions in PDF output
This commit is contained in:
commit
c844404741
1
CHANGES
1
CHANGES
@ -41,6 +41,7 @@ Bugs fixed
|
||||
* LaTeX writer: leave ``"`` character inside :dudir:`parsed-literal` as is
|
||||
(ref #3341)
|
||||
* #3234: intersphinx failed for encoded inventories
|
||||
* #3158: too much space after captions in PDF output
|
||||
|
||||
|
||||
Release 1.5.1 (released Dec 13, 2016)
|
||||
|
@ -612,34 +612,34 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
figure = self.builder.config.numfig_format['figure'].split('%s', 1)
|
||||
if len(figure) == 1:
|
||||
ret.append('\\def\\fnum@figure{%s}\n' %
|
||||
escape_abbr(text_type(figure[0]).translate(tex_escape_map)))
|
||||
text_type(figure[0]).strip().translate(tex_escape_map))
|
||||
else:
|
||||
definition = escape_abbr(text_type(figure[0]).translate(tex_escape_map))
|
||||
definition = text_type(figure[0]).strip().translate(tex_escape_map)
|
||||
ret.append(self.babel_renewcommand('\\figurename', definition))
|
||||
if figure[1]:
|
||||
ret.append('\\makeatletter\n')
|
||||
ret.append('\\def\\fnum@figure{\\figurename\\thefigure%s}\n' %
|
||||
escape_abbr(text_type(figure[1]).translate(tex_escape_map)))
|
||||
text_type(figure[1]).strip().translate(tex_escape_map))
|
||||
ret.append('\\makeatother\n')
|
||||
|
||||
table = self.builder.config.numfig_format['table'].split('%s', 1)
|
||||
if len(table) == 1:
|
||||
ret.append('\\def\\fnum@table{%s}\n' %
|
||||
escape_abbr(text_type(table[0]).translate(tex_escape_map)))
|
||||
text_type(table[0]).strip().translate(tex_escape_map))
|
||||
else:
|
||||
definition = escape_abbr(text_type(table[0]).translate(tex_escape_map))
|
||||
definition = text_type(table[0]).strip().translate(tex_escape_map)
|
||||
ret.append(self.babel_renewcommand('\\tablename', definition))
|
||||
if table[1]:
|
||||
ret.append('\\makeatletter\n')
|
||||
ret.append('\\def\\fnum@table{\\tablename\\thetable%s}\n' %
|
||||
escape_abbr(text_type(table[1]).translate(tex_escape_map)))
|
||||
text_type(table[1]).strip().translate(tex_escape_map))
|
||||
ret.append('\\makeatother\n')
|
||||
|
||||
codeblock = self.builder.config.numfig_format['code-block'].split('%s', 1)
|
||||
if len(codeblock) == 1:
|
||||
pass # FIXME
|
||||
else:
|
||||
definition = escape_abbr(text_type(codeblock[0]).translate(tex_escape_map))
|
||||
definition = text_type(codeblock[0]).strip().translate(tex_escape_map)
|
||||
ret.append(self.babel_renewcommand('\\literalblockname', definition))
|
||||
if codeblock[1]:
|
||||
pass # FIXME
|
||||
|
@ -178,7 +178,7 @@ def test_numref(app, status, warning):
|
||||
print(result)
|
||||
print(status.getvalue())
|
||||
print(warning.getvalue())
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Fig.\\@ }}' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Fig.}}' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Table}}' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\literalblockname}{Listing}}' in result
|
||||
assert ('\\hyperref[\\detokenize{index:fig1}]'
|
||||
@ -261,7 +261,7 @@ 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 '\\addto\\captionsenglish{\\renewcommand{\\literalblockname}{Code-}}' in result
|
||||
@ -344,8 +344,8 @@ def test_babel_with_no_language_settings(app, status, warning):
|
||||
assert '\\usepackage[Bjarne]{fncychap}' in result
|
||||
assert ('\\addto\\captionsenglish{\\renewcommand{\\contentsname}{Table of content}}\n'
|
||||
in result)
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Fig.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Table.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Fig.}}\n' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Table.}}\n' in result
|
||||
assert '\\addto\\extrasenglish{\\def\\pageautorefname{page}}\n' in result
|
||||
assert '\\shorthandoff' not in result
|
||||
|
||||
@ -365,8 +365,8 @@ def test_babel_with_language_de(app, status, warning):
|
||||
assert '\\usepackage[Sonny]{fncychap}' in result
|
||||
assert ('\\addto\\captionsngerman{\\renewcommand{\\contentsname}{Table of content}}\n'
|
||||
in result)
|
||||
assert '\\addto\\captionsngerman{\\renewcommand{\\figurename}{Fig.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsngerman{\\renewcommand{\\tablename}{Table.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsngerman{\\renewcommand{\\figurename}{Fig.}}\n' in result
|
||||
assert '\\addto\\captionsngerman{\\renewcommand{\\tablename}{Table.}}\n' in result
|
||||
assert '\\addto\\extrasngerman{\\def\\pageautorefname{Seite}}\n' in result
|
||||
assert '\\shorthandoff{"}' in result
|
||||
|
||||
@ -386,8 +386,8 @@ def test_babel_with_language_ru(app, status, warning):
|
||||
assert '\\usepackage[Sonny]{fncychap}' in result
|
||||
assert ('\\addto\\captionsrussian{\\renewcommand{\\contentsname}{Table of content}}\n'
|
||||
in result)
|
||||
assert '\\addto\\captionsrussian{\\renewcommand{\\figurename}{Fig.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsrussian{\\renewcommand{\\tablename}{Table.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsrussian{\\renewcommand{\\figurename}{Fig.}}\n' in result
|
||||
assert '\\addto\\captionsrussian{\\renewcommand{\\tablename}{Table.}}\n' in result
|
||||
assert (u'\\addto\\extrasrussian{\\def\\pageautorefname'
|
||||
u'{\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430}}\n' in result)
|
||||
assert '\\shorthandoff' not in result
|
||||
@ -408,8 +408,8 @@ def test_babel_with_language_tr(app, status, warning):
|
||||
assert '\\usepackage[Sonny]{fncychap}' in result
|
||||
assert ('\\addto\\captionsturkish{\\renewcommand{\\contentsname}{Table of content}}\n'
|
||||
in result)
|
||||
assert '\\addto\\captionsturkish{\\renewcommand{\\figurename}{Fig.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsturkish{\\renewcommand{\\tablename}{Table.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsturkish{\\renewcommand{\\figurename}{Fig.}}\n' in result
|
||||
assert '\\addto\\captionsturkish{\\renewcommand{\\tablename}{Table.}}\n' in result
|
||||
assert '\\addto\\extrasturkish{\\def\\pageautorefname{sayfa}}\n' in result
|
||||
assert '\\shorthandoff{=}' in result
|
||||
|
||||
@ -428,8 +428,8 @@ def test_babel_with_language_ja(app, status, warning):
|
||||
assert '\\usepackage{times}' in result
|
||||
assert '\\usepackage[Sonny]{fncychap}' not in result
|
||||
assert '\\renewcommand{\\contentsname}{Table of content}\n' in result
|
||||
assert '\\renewcommand{\\figurename}{Fig.\\@ }\n' in result
|
||||
assert '\\renewcommand{\\tablename}{Table.\\@ }\n' in result
|
||||
assert '\\renewcommand{\\figurename}{Fig.}\n' in result
|
||||
assert '\\renewcommand{\\tablename}{Table.}\n' in result
|
||||
assert u'\\def\\pageautorefname{ページ}\n' in result
|
||||
assert '\\shorthandoff' not in result
|
||||
|
||||
@ -449,8 +449,8 @@ def test_babel_with_unknown_language(app, status, warning):
|
||||
assert '\\usepackage[Sonny]{fncychap}' in result
|
||||
assert ('\\addto\\captionsenglish{\\renewcommand{\\contentsname}{Table of content}}\n'
|
||||
in result)
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Fig.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Table.\\@ }}\n' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Fig.}}\n' in result
|
||||
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Table.}}\n' in result
|
||||
assert '\\addto\\extrasenglish{\\def\\pageautorefname{page}}\n' in result
|
||||
assert '\\shorthandoff' not in result
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user