Fix #2492: Figure directive with :figwidth: generates incorrect Latex-code

This commit is contained in:
Takeshi KOMIYA
2016-05-03 21:31:43 +09:00
parent 5ecbbec79d
commit 4789ef899f
5 changed files with 38 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ LATEX_WARNINGS = ENV_WARNINGS + """\
%(root)s/markup.txt:164: WARNING: unknown option: &option
%(root)s/footnote.txt:60: WARNING: citation not found: missing
%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\\*'
%(root)s/markup.txt:275: WARNING: Could not lex literal_block as "c". Highlighting skipped.
%(root)s/markup.txt:280: WARNING: Could not lex literal_block as "c". Highlighting skipped.
"""
if PY3:
@@ -106,6 +106,16 @@ def test_latex(app, status, warning):
run_latex(app.outdir)
@with_app(buildername='latex')
def test_writer(app, status, warning):
app.builder.build_all()
result = (app.outdir / 'SphinxTests.tex').text(encoding='utf8')
assert ('\\begin{wrapfigure}{r}{0.500\\linewidth}\n\\centering\n'
'\\includegraphics{{rimg}.png}\n\\caption{figure with align \\& figwidth option}'
'\\label{markup:id7}\\end{wrapfigure}' in result)
@with_app(buildername='latex', freshenv=True, # use freshenv to check warnings
confoverrides={'latex_documents': [
('contents', 'SphinxTests.tex', 'Sphinx Tests Documentation',