aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-04 19:18:20 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-04 19:18:20 -0800
commitdac2e9156fffe4cef12271e0284e5f43f5b7e10f (patch)
tree6077af2f71e6f0ee8d83a775d13a5e69902cbe64 /src/Text/Pandoc/Readers
parentfcbe1e95ebe170aadc6eadd6797ddf7fbb286ef2 (diff)
downloadpandoc-dac2e9156fffe4cef12271e0284e5f43f5b7e10f.tar.gz
LaTeX reader: parse macros and apply to math.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs15
1 files changed, 8 insertions, 7 deletions
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