git.iko.soy/typeable/pandoc
on master help sign in
Cleaned up character escaping in LaTeX writer.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@763 788f1e2b-df1e-0410-8736-df70ead52e1b

commitb8e1e53053b440695c078c4c49428985b5f9ee65 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 22 Jul 2007, 18:24 (19 years ago) parentb19c369
1 file changed+8−15
src/Text/Pandoc/Writers/LaTeX.hs+8−15
src/Text/Pandoc/Writers/LaTeX.hs+8−15
@@ -95,21 +95,14 @@ latexHeader options (Meta title authors date) = do
9595
9696stringToLaTeX :: String -> String
9797stringToLaTeX = escapeStringUsing latexEscapes
98− where latexEscapes = [
99− ('\\', "\\textbackslash{}"),
100− ('{', "\\{"),
101− ('}', "\\}"),
102− ('$', "\\$"),
103− ('%', "\\%"),
104− ('&', "\\&"),
105− ('~', "\\~"),
106− ('_', "\\_"),
107− ('#', "\\#"),
108− ('^', "\\^{}"),
109− ('|', "\\textbar{}"),
110− ('<', "\\textless{}"),
111− ('>', "\\textgreater{}")
112− ]
98+ where latexEscapes = backslashEscapes "{}$%&_#" ++
99+ [ ('^', "\\^{}")
100+ , ('\\', "\\textbackslash{}")
101+ , ('~', "\\ensuremath{\\sim}")
102+ , ('|', "\\textbar{}")
103+ , ('<', "\\textless{}")
104+ , ('>', "\\textgreater{}")
105+ ]
113106
114107-- | Remove all code elements from list of inline elements
115108-- (because it's illegal to have a \\verb inside a command argument)