git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: don't apply theorem default styling to a figure inside.

If we put an image in italics, then when rendering to Markdown we no longer get an implicit figure. Closes #6925.

commitddb76cb356a82f6a9e51a6f3626dd154816e9205 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 5 Dec 2020, 09:53 (6 years ago) parent6f35600
2 files changed+35
src/Text/Pandoc/Readers/LaTeX.hs+1 test/command/6925.md+34
src/Text/Pandoc/Readers/LaTeX.hs+1
@@ -1812,6 +1812,7 @@ theoremEnvironment name = do
18121812 _ -> bs
18131813
18141814italicize :: Block -> Block
1815+italicize x@(Para [Image{}]) = x -- see #6925
18151816italicize (Para ils) = Para [Emph ils]
18161817italicize (Plain ils) = Plain [Emph ils]
18171818italicize x = x
test/command/6925.mdnew file+34
@@ -0,0 +1,34 @@
1+```
2+% pandoc -f latex -t markdown
3+\documentclass{amsart}
4+\newtheorem{thm}{Theorem}[section]
5+\theoremstyle{definition}
6+\newtheorem{thm2}[section]{Theorem}
7+\begin{document}
8+\begin{thm}
9+a
10+\begin{figure}
11+\includegraphics[]{1.png}
12+\end{figure}
13+\end{thm}
14+
15+\begin{thm2}
16+a
17+\begin{figure}
18+\includegraphics[]{1.png}
19+\end{figure}
20+\end{thm2}
21+\end{document}
22+^D
23+::: {.thm}
24+**Theorem 1**. *a*
25+
26+![image](1.png)
27+:::
28+
29+::: {.thm2}
30+**Theorem 1**. a
31+
32+![image](1.png)
33+:::
34+```