mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #2492: Figure directive with :figwidth: generates incorrect Latex-code
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user