From cca2acb6dbc4713a5359596807134632c343ba22 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Wed, 3 Jun 2009 20:26:41 +0000 Subject: 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 --- src/Text/Pandoc/Readers/LaTeX.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index f35ab4f29..5d02a2be5 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -701,7 +701,9 @@ math3 = try $ char '$' >> math1 >>~ char '$' math4 :: GenParser Char st String math4 = try $ do - name <- begin "equation" <|> begin "equation*" <|> begin "displaymath" <|> begin "displaymath*" + name <- begin "displaymath" <|> begin "equation" <|> begin "equation*" <|> + begin "gather" <|> begin "gather*" <|> begin "gathered" <|> + begin "multline" <|> begin "multline*" spaces manyTill anyChar (end name) @@ -710,10 +712,12 @@ math5 = try $ (string "\\[") >> spaces >> manyTill anyChar (try $ string "\\]") math6 :: GenParser Char st String math6 = try $ do - name <- begin "eqnarray" <|> begin "eqnarray*" + name <- begin "eqnarray" <|> begin "eqnarray*" <|> begin "align" <|> + begin "align*" <|> begin "alignat" <|> begin "alignat*" <|> + begin "split" <|> begin "aligned" <|> begin "alignedat" spaces res <- manyTill anyChar (end name) - return $ filter (/= '&') res -- remove eqnarray alignment codes + return $ filter (/= '&') res -- remove alignment codes -- -- links and images -- cgit v1.2.3