mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Fix #2593: latex crashes if any figures in the table
This commit is contained in:
@@ -220,6 +220,13 @@ Tables with multirow and multicol:
|
||||
| |
|
||||
+----+
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 0
|
||||
|
||||
* - .. figure:: img.png
|
||||
|
||||
figure in table
|
||||
|
||||
|
||||
Figures
|
||||
-------
|
||||
|
||||
@@ -111,18 +111,22 @@ def test_writer(app, status, warning):
|
||||
app.builder.build_all()
|
||||
result = (app.outdir / 'SphinxTests.tex').text(encoding='utf8')
|
||||
|
||||
assert ('\\begin{figure-in-table}\n\\centering\n'
|
||||
'\\includegraphics{{img}.png}\n'
|
||||
'\\figcaption{figure in table}\\label{markup:id7}\\end{figure-in-table}' in result)
|
||||
|
||||
assert ('\\begin{wrapfigure}{r}{0pt}\n\\centering\n'
|
||||
'\\includegraphics{{rimg}.png}\n\\caption{figure with align option}'
|
||||
'\\label{markup:id7}\\end{wrapfigure}' in result)
|
||||
'\\label{markup:id8}\\end{wrapfigure}' in result)
|
||||
|
||||
assert ('\\begin{wrapfigure}{r}{0.500\\linewidth}\n\\centering\n'
|
||||
'\\includegraphics{{rimg}.png}\n\\caption{figure with align \\& figwidth option}'
|
||||
'\\label{markup:id8}\\end{wrapfigure}' in result)
|
||||
'\\label{markup:id9}\\end{wrapfigure}' in result)
|
||||
|
||||
assert ('\\begin{wrapfigure}{r}{3cm}\n\\centering\n'
|
||||
'\\includegraphics[width=3cm]{{rimg}.png}\n'
|
||||
'\\caption{figure with align \\& width option}'
|
||||
'\\label{markup:id9}\\end{wrapfigure}' in result)
|
||||
'\\label{markup:id10}\\end{wrapfigure}' in result)
|
||||
|
||||
|
||||
@with_app(buildername='latex', freshenv=True, # use freshenv to check warnings
|
||||
|
||||
Reference in New Issue
Block a user