summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-22 20:30:07 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-22 20:30:07 +0000
commit3ca9932ca6a4d7ac7ca08bf06f4051674a2981f1 (patch)
tree0f4b4b74a88de47359057d8a5c67784852618ba7 /src/Text/Pandoc/Readers
parent8672a8e6488694f82762fa3524d352cac96eddd1 (diff)
Added subscript and superscript support to LaTeX reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@775 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs15
1 files changed, 14 insertions, 1 deletions
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