@@ -212,13 +212,6 @@ stringToLaTeX isUrl (x:xs) = do
212212 '\x2013' | ligatures -> "--" ++ rest
213213 _ -> x : rest
214214
215−-- This is needed because | in math mode interacts badly with
216−-- highlighting-kate, which redefines | as a short verb command.
217−escapeMath :: String -> String
218−escapeMath ('|':xs) = "\\vert " ++ escapeMath xs
219−escapeMath (x:xs) = x : escapeMath xs
220−escapeMath [] = ""
221−
222215-- | Puts contents into LaTeX command.
223216inCmd :: String -> Doc -> Doc
224217inCmd cmd contents = char '\\' <> text cmd <> braces contents
@@ -622,9 +615,9 @@ inlineToLaTeX (Quoted qt lst) = do
622615 else char '\x2018' <> inner <> char '\x2019'
623616inlineToLaTeX (Str str) = liftM text $ stringToLaTeX False str
624617inlineToLaTeX (Math InlineMath str) =
625− return $ char '$' <> text (escapeMath str) <> char '$'
618+ return $ char '$' <> text str <> char '$'
626619inlineToLaTeX (Math DisplayMath str) =
627− return $ "\\[" <> text (escapeMath str) <> "\\]"
620+ return $ "\\[" <> text str <> "\\]"
628621inlineToLaTeX (RawInline "latex" str) = return $ text str
629622inlineToLaTeX (RawInline "tex" str) = return $ text str
630623inlineToLaTeX (RawInline _ _) = return empty