summaryrefslogtreecommitdiff
path: root/tests/test_build_latex.py
diff options
context:
space:
mode:
authorStefan Wallentowitz <stefan@wallentowitz.de>2019-05-14 12:40:37 +0200
committerStefan Wallentowitz <stefan@wallentowitz.de>2019-05-24 16:07:13 +0200
commitac0bb5132b4c7ea19f518687e02243dc56dd1870 (patch)
tree286afc842c422dfb50c9be46ad227e33243f61f9 /tests/test_build_latex.py
parent1c45b0a1860bb0223984fac9499bb77e65c64c85 (diff)
downloadsphinx-git-ac0bb5132b4c7ea19f518687e02243dc56dd1870.tar.gz
Fix latex figure in admonition
Using figures in an admonition produces a LaTeX error ("Not in outer par mode."). This is because it generates a float in a float. This can be trivially fixed by overwriting the alignment to H, which is also what is most probably intended.
Diffstat (limited to 'tests/test_build_latex.py')
-rw-r--r--tests/test_build_latex.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py
index f02394cf1..fbc033b76 100644
--- a/tests/test_build_latex.py
+++ b/tests/test_build_latex.py
@@ -1389,6 +1389,12 @@ def test_latex_labels(app, status, warning):
assert result.count(r'\label{\detokenize{index:section1}}') == 1
+@pytest.mark.sphinx('latex', testroot='latex-figure-in-admonition')
+def test_latex_figure_in_admonition(app, status, warning):
+ app.builder.build_all()
+ result = (app.outdir / 'python.tex').text(encoding='utf8')
+ assert(r'\begin{figure}[H]' in result)
+
def test_default_latex_documents():
from sphinx.util import texescape
texescape.init()