git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: parse macros and apply to math.
commitdac2e9156fffe4cef12271e0284e5f43f5b7e10f authorJohn MacFarlane <jgm@berkeley.edu> dateTue 4 Jan 2011, 19:18 (16 years ago) parentfcbe1e9
1 file changed+8−7
src/Text/Pandoc/Readers/LaTeX.hs+8−7
src/Text/Pandoc/Readers/LaTeX.hs+8−7
@@ -150,6 +150,7 @@ block = choice [ hrule
150150 , list
151151 , blockQuote
152152 , commentBlock
153+ , macro
153154 , bibliographic
154155 , para
155156 , itemBlock
@@ -726,13 +727,13 @@ endline :: GenParser Char st Inline
726727endline = try $ newline >> notFollowedBy blankline >> return Space
727728
728729-- math
729−math :: GenParser Char st Inline
730−math = (math3 >>= return . Math DisplayMath)
731− <|> (math1 >>= return . Math InlineMath)
732− <|> (math2 >>= return . Math InlineMath)
733− <|> (math4 >>= return . Math DisplayMath)
734− <|> (math5 >>= return . Math DisplayMath)
735− <|> (math6 >>= return . Math DisplayMath)
730+math :: GenParser Char ParserState Inline
731+math = (math3 >>= applyMacros' >>= return . Math DisplayMath)
732+ <|> (math1 >>= applyMacros' >>= return . Math InlineMath)
733+ <|> (math2 >>= applyMacros' >>= return . Math InlineMath)
734+ <|> (math4 >>= applyMacros' >>= return . Math DisplayMath)
735+ <|> (math5 >>= applyMacros' >>= return . Math DisplayMath)
736+ <|> (math6 >>= applyMacros' >>= return . Math DisplayMath)
736737 <?> "math"
737738
738739math1 :: GenParser Char st String