diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-22 18:24:34 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-22 18:24:34 +0000 |
commit | b8e1e53053b440695c078c4c49428985b5f9ee65 (patch) | |
tree | d1e78f8873ab0a65023ee53c213a487730562bbc | |
parent | b19c36970e70cc6c5bd2f571b35d0a3474543037 (diff) | |
download | pandoc-b8e1e53053b440695c078c4c49428985b5f9ee65.tar.gz |
Cleaned up character escaping in LaTeX writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@763 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index f0bb92002..fed021323 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -95,21 +95,14 @@ latexHeader options (Meta title authors date) = do stringToLaTeX :: String -> String stringToLaTeX = escapeStringUsing latexEscapes - where latexEscapes = [ - ('\\', "\\textbackslash{}"), - ('{', "\\{"), - ('}', "\\}"), - ('$', "\\$"), - ('%', "\\%"), - ('&', "\\&"), - ('~', "\\~"), - ('_', "\\_"), - ('#', "\\#"), - ('^', "\\^{}"), - ('|', "\\textbar{}"), - ('<', "\\textless{}"), - ('>', "\\textgreater{}") - ] + where latexEscapes = backslashEscapes "{}$%&_#" ++ + [ ('^', "\\^{}") + , ('\\', "\\textbackslash{}") + , ('~', "\\ensuremath{\\sim}") + , ('|', "\\textbar{}") + , ('<', "\\textless{}") + , ('>', "\\textgreater{}") + ] -- | Remove all code elements from list of inline elements -- (because it's illegal to have a \\verb inside a command argument) |