@@ -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)