git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: parse macros and apply to math.
dac2e91John MacFarlane
src/Text/Pandoc/Readers/LaTeX.hs+8−7
@@ -150,6 +150,7 @@ block = choice [ hrule
150 , list
150 , list
151 , blockQuote
151 , blockQuote
152 , commentBlock
152 , commentBlock
153+ , macro
153 , bibliographic
154 , bibliographic
154 , para
155 , para
155 , itemBlock
156 , itemBlock
@@ -726,13 +727,13 @@ endline :: GenParser Char st Inline
726endline = try $ newline >> notFollowedBy blankline >> return Space
727endline = try $ newline >> notFollowedBy blankline >> return Space
727
728
728-- math
729-- math
729−math :: GenParser Char st Inline
730+math :: GenParser Char ParserState Inline
730−math = (math3 >>= return . Math DisplayMath)
731+math = (math3 >>= applyMacros' >>= return . Math DisplayMath)
731− <|> (math1 >>= return . Math InlineMath)
732+ <|> (math1 >>= applyMacros' >>= return . Math InlineMath)
732− <|> (math2 >>= return . Math InlineMath)
733+ <|> (math2 >>= applyMacros' >>= return . Math InlineMath)
733− <|> (math4 >>= return . Math DisplayMath)
734+ <|> (math4 >>= applyMacros' >>= return . Math DisplayMath)
734− <|> (math5 >>= return . Math DisplayMath)
735+ <|> (math5 >>= applyMacros' >>= return . Math DisplayMath)
735− <|> (math6 >>= return . Math DisplayMath)
736+ <|> (math6 >>= applyMacros' >>= return . Math DisplayMath)
736 <?> "math"
737 <?> "math"
737
738
738math1 :: GenParser Char st String
739math1 :: GenParser Char st String