Added subscript and superscript support to LaTeX reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@775 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
8672a8e648
commit
3ca9932ca6
1 changed files with 14 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue