From 4905ebadb3fbf6417b89dc9522c4a909dbdacee5 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 22 Jul 2007 18:26:10 +0000 Subject: LaTeX reader: Added clauses for tilde and caret. Tilde is \ensuremath{\sim}, and caret is \^{}, not \^ as before. git-svn-id: https://pandoc.googlecode.com/svn/trunk@764 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/LaTeX.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 9e03ebc85..0ba6cd560 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -472,19 +472,27 @@ sect = try (do return (Str [chr 167])) escapedChar = do - result <- escaped (oneOf " $%^&_#{}\n") + result <- escaped (oneOf " $%&_#{}\n") return (if result == Str "\n" then Str " " else result) unescapedChar = do -- ignore standalone, nonescaped special characters oneOf "$^&_#{}|<>" return (Str "") -specialChar = choice [ backslash, bar, lt, gt ] +specialChar = choice [ backslash, tilde, caret, bar, lt, gt ] backslash = try (do string "\\textbackslash" return (Str "\\")) +tilde = try (do + string "\\ensuremath{\\sim}" + return (Str "~")) + +caret = try (do + string "\\^{}" + return (Str "^")) + bar = try (do string "\\textbar" return (Str "\\")) -- cgit v1.2.3