git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: Made rawLaTeXInline more flexible.

Now it will also try to parse block commands. This is usually what we want, given how rawLaTeXInline is used in the markdown and textile readers. If a block-level LaTeX command is used in the middle of a paragraph (e.g. `\subtitle` inside a title), we can treat it as raw inline LaTeX.

commit40128754ab20105bce68cd072607f8877f10dca1 authorJohn MacFarlane <fiddlosopher@gmail.com> dateThu 11 Oct 2012, 21:21 (14 years ago) parentcfc2e00
1 file changed+2−4
src/Text/Pandoc/Readers/LaTeX.hs+2−4
src/Text/Pandoc/Readers/LaTeX.hs+2−4
@@ -717,10 +717,8 @@ rawLaTeXBlock = snd <$> try (withRaw (environment <|> blockCommand))
717717
718718rawLaTeXInline :: Parser [Char] ParserState Inline
719719rawLaTeXInline = do
720− (res, raw) <- withRaw inlineCommand
721− if res == mempty
722− then return (Str "")
723− else RawInline "latex" <$> (applyMacros' raw)
720+ raw <- (snd <$> withRaw inlineCommand) <|> (snd <$> withRaw blockCommand)
721+ RawInline "latex" <$> applyMacros' raw
724722
725723environments :: M.Map String (LP Blocks)
726724environments = M.fromList