diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-06-03 20:26:41 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-06-03 20:26:41 +0000 |
commit | cca2acb6dbc4713a5359596807134632c343ba22 (patch) | |
tree | 2ec49e41d03a2963e286bb6387d6582507050667 /src/Text/Pandoc | |
parent | 236896bd10ae8206cb9e187d48dcee15bd797082 (diff) | |
download | pandoc-cca2acb6dbc4713a5359596807134632c343ba22.tar.gz |
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
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 10 |
1 files changed, 7 insertions, 3 deletions
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 |