From 669c2b8f64340608d3df00ac7c04cd896298a0f1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 18 Dec 2024 12:11:04 -0800 Subject: [PATCH] LaTeX reader: handle `figure*` environment as a figure. Closes #10472. --- src/Text/Pandoc/Readers/LaTeX.hs | 1 + test/command/6034.md | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 43f4228f8be7..d8881ef98951 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1016,6 +1016,7 @@ environments = M.union (tableEnvironments block inline) $ , ("minipage", divWith ("",["minipage"],[]) <$> env "minipage" (skipopts *> spaces *> optional braced *> spaces *> blocks)) , ("figure", env "figure" $ skipopts *> figure') + , ("figure*", env "figure*" $ skipopts *> figure') , ("subfigure", env "subfigure" $ skipopts *> tok *> figure') , ("center", divWith ("", ["center"], []) <$> env "center" blocks) , ("quote", blockQuote <$> env "quote" blocks) diff --git a/test/command/6034.md b/test/command/6034.md index eb8999d11020..3739fbdd044e 100644 --- a/test/command/6034.md +++ b/test/command/6034.md @@ -7,8 +7,13 @@ \end{overpic} \end{figure*} ^D -[ RawBlock - (Format "latex") - "\\begin{figure*}\n \\centering\n \\begin{overpic}{test_pic}\n \\put (70,80) {Caption}\n \\end{overpic}\n\\end{figure*}" +[ Figure + ( "" , [] , [] ) + (Caption Nothing []) + [ RawBlock (Format "latex") "\\centering" + , RawBlock + (Format "latex") + "\\begin{overpic}{test_pic}\n \\put (70,80) {Caption}\n \\end{overpic}" + ] ] ```