From 3ca9932ca6a4d7ac7ca08bf06f4051674a2981f1 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 22 Jul 2007 20:30:07 +0000 Subject: Added subscript and superscript support to LaTeX reader. git-svn-id: https://pandoc.googlecode.com/svn/trunk@775 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/LaTeX.hs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 0ba6cd560..feef85c2a 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -378,7 +378,8 @@ comment = try (do -- inline -- -inline = choice [ strong, emph, strikeout, ref, lab, code, linebreak, spacer, +inline = choice [ strong, emph, strikeout, superscript, subscript, + ref, lab, code, linebreak, spacer, math, ellipses, emDash, enDash, hyphen, quoted, apostrophe, accentedChar, specialChar, specialInline, escapedChar, unescapedChar, str, endline, whitespace ] "inline" @@ -522,6 +523,18 @@ strikeout = try $ do result <- manyTill inline (char '}') return (Strikeout result) +superscript = try $ do + string "\\textsuperscript{" + result <- manyTill inline (char '}') + return (Superscript result) + +-- note: \textsubscript isn't a standard latex command, but we use +-- a defined version in pandoc. +subscript = try $ do + string "\\textsubscript{" + result <- manyTill inline (char '}') + return (Subscript result) + apostrophe = do char '\'' return Apostrophe -- cgit v1.2.3