aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 11419b15f..32195d859 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -144,12 +144,17 @@ rawLaTeXBlock = do
toks <- getInputTokens
snd <$> (
rawLaTeXParser toks
- (macroDef (const mempty) <|>
+ (skipMany1 (try
+ (skipMany (whitespace <|> newlineTok)
+ *> (macroDef (const ())
+ <|> void (controlSeq "makeatletter" <|>
+ controlSeq "mateatother")))
+ <|>
do choice (map controlSeq
["include", "input", "subfile", "usepackage"])
skipMany opt
braced
- return mempty) blocks
+ return mempty)) blocks
<|> rawLaTeXParser toks
(void (environment <|> blockCommand))
(mconcat <$> many (block <|> beginOrEndCommand)))