git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: Don't omit macro definitions defined in the preamble.

These were formerly omitted (though they still affected macro resolution if `latex_macros` was set). Now they are included in the document.

commit7fac39528497b35915a5573c1ac3faf875476272 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 2 Nov 2019, 11:04 (7 years ago) parent15e1ca6
1 file changed+7−6
src/Text/Pandoc/Readers/LaTeX.hs+7−6
src/Text/Pandoc/Readers/LaTeX.hs+7−6
@@ -1462,13 +1462,14 @@ end_ t = try (do
14621462 guard $ t == txt) <?> ("\\end{" ++ T.unpack t ++ "}")
14631463
14641464preamble :: PandocMonad m => LP m Blocks
1465−preamble = mempty <$ many preambleBlock
1466− where preambleBlock = spaces1
1467− <|> macroDef (const ())
1468− <|> void blockCommand
1469− <|> void braced
1465+preamble = mconcat <$> many preambleBlock
1466+ where preambleBlock = (mempty <$ spaces1)
1467+ <|> macroDef (rawBlock "latex")
1468+ <|> (mempty <$ blockCommand)
1469+ <|> (mempty <$ braced)
14701470 <|> (do notFollowedBy (begin_ "document")
1471− void anyTok)
1471+ anyTok
1472+ return mempty)
14721473
14731474paragraph :: PandocMonad m => LP m Blocks
14741475paragraph = do