From dac2e9156fffe4cef12271e0284e5f43f5b7e10f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 4 Jan 2011 19:18:20 -0800 Subject: LaTeX reader: parse macros and apply to math. --- src/Text/Pandoc/Readers/LaTeX.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 659382772..abec41349 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -150,6 +150,7 @@ block = choice [ hrule , list , blockQuote , commentBlock + , macro , bibliographic , para , itemBlock @@ -726,13 +727,13 @@ endline :: GenParser Char st Inline endline = try $ newline >> notFollowedBy blankline >> return Space -- math -math :: GenParser Char st Inline -math = (math3 >>= return . Math DisplayMath) - <|> (math1 >>= return . Math InlineMath) - <|> (math2 >>= return . Math InlineMath) - <|> (math4 >>= return . Math DisplayMath) - <|> (math5 >>= return . Math DisplayMath) - <|> (math6 >>= return . Math DisplayMath) +math :: GenParser Char ParserState Inline +math = (math3 >>= applyMacros' >>= return . Math DisplayMath) + <|> (math1 >>= applyMacros' >>= return . Math InlineMath) + <|> (math2 >>= applyMacros' >>= return . Math InlineMath) + <|> (math4 >>= applyMacros' >>= return . Math DisplayMath) + <|> (math5 >>= applyMacros' >>= return . Math DisplayMath) + <|> (math6 >>= applyMacros' >>= return . Math DisplayMath) "math" math1 :: GenParser Char st String -- cgit v1.2.3