From 7ba0ae8b4d9a6d3e7d4484a5f257e1e53f35667d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 12 Nov 2017 14:19:58 -0800 Subject: LaTeX reader: allow optional args for parbox. See #4056. --- src/Text/Pandoc/Readers/LaTeX.hs | 2 +- test/command/4056.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/command/4056.md diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 9bac3d3a7..708980f1d 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -2003,7 +2003,7 @@ closing = do blockCommands :: PandocMonad m => M.Map Text (LP m Blocks) blockCommands = M.fromList $ [ ("par", mempty <$ skipopts) - , ("parbox", braced >> grouped blocks) + , ("parbox", skipopts >> braced >> grouped blocks) , ("title", mempty <$ (skipopts *> (grouped inline >>= addMeta "title") <|> (grouped block >>= addMeta "title"))) diff --git a/test/command/4056.md b/test/command/4056.md new file mode 100644 index 000000000..be245a30d --- /dev/null +++ b/test/command/4056.md @@ -0,0 +1,11 @@ +``` +% pandoc -f markdown -t native +\parbox[t]{0.4\textwidth}{ +\begin{shaded} +\end{shaded} +} +^D +[RawBlock (Format "latex") "\\parbox[t]{0.4\\textwidth}{\n\\begin{shaded}\n\\end{shaded}\n}"] +``` + + -- cgit v1.2.3