git.iko.soy/typeable/pandoc
on master help sign in
Improved LaTeX reader's coverage of math modes.

Remove displaymath* (which is not in LaTeX) and recognize all the amsmath environments that are alternatives to eqnarray, namely equation, equation*, gather, gather*, gathered, multline, multline*, align, align*, alignat, alignat*, aligned, alignedat, split Resolves Issue #103. Thanks to shreevatsa.public for the patch. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1577 788f1e2b-df1e-0410-8736-df70ead52e1b

commitcca2acb6dbc4713a5359596807134632c343ba22 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateWed 3 Jun 2009, 20:26 (17 years ago) parent236896b
1 file changed+7−3
src/Text/Pandoc/Readers/LaTeX.hs+7−3
src/Text/Pandoc/Readers/LaTeX.hs+7−3
@@ -701,7 +701,9 @@ math3 = try $ char '$' >> math1 >>~ char '$'
701701
702702math4 :: GenParser Char st String
703703math4 = try $ do
704− name <- begin "equation" <|> begin "equation*" <|> begin "displaymath" <|> begin "displaymath*"
704+ name <- begin "displaymath" <|> begin "equation" <|> begin "equation*" <|>
705+ begin "gather" <|> begin "gather*" <|> begin "gathered" <|>
706+ begin "multline" <|> begin "multline*"
705707 spaces
706708 manyTill anyChar (end name)
707709
@@ -710,10 +712,12 @@ math5 = try $ (string "\\[") >> spaces >> manyTill anyChar (try $ string "\\]")
710712
711713math6 :: GenParser Char st String
712714math6 = try $ do
713− name <- begin "eqnarray" <|> begin "eqnarray*"
715+ name <- begin "eqnarray" <|> begin "eqnarray*" <|> begin "align" <|>
716+ begin "align*" <|> begin "alignat" <|> begin "alignat*" <|>
717+ begin "split" <|> begin "aligned" <|> begin "alignedat"
714718 spaces
715719 res <- manyTill anyChar (end name)
716− return $ filter (/= '&') res -- remove eqnarray alignment codes
720+ return $ filter (/= '&') res -- remove alignment codes
717721
718722--
719723-- links and images