From 8c55b7b5640e41feaae658e95e659bdd2101a340 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 7 Mar 2017 14:57:11 +0100 Subject: Markdown reader: Treat certain environments as inline when they occur without space surrounding them. E.g. equation, math. This avoids incorrect vertical space around equations. Closes #3309. Closes #2171. See also rstudio/bookdown#358. --- src/Text/Pandoc/Readers/LaTeX.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index c5f5df6dc..60113173d 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1063,7 +1063,9 @@ rawLaTeXBlock = snd <$> try (withRaw (environment <|> blockCommand)) rawLaTeXInline :: PandocMonad m => LP m Inline rawLaTeXInline = do - raw <- (snd <$> withRaw inlineCommand) <|> (snd <$> withRaw blockCommand) + raw <- (snd <$> withRaw inlineCommand) + <|> (snd <$> withRaw inlineEnvironment) + <|> (snd <$> withRaw blockCommand) RawInline "latex" <$> applyMacros' raw addImageCaption :: PandocMonad m => Blocks -> LP m Blocks -- cgit v1.2.3