@@ -32,6 +32,7 @@ module Text.Pandoc.Writers.Man ( writeMan) where
3232import Text.Pandoc.Definition
3333import Text.Pandoc.Templates
3434import Text.Pandoc.Shared
35+import Text.Pandoc.Readers.TeXMath
3536import Text.Printf ( printf )
3637import Data.List ( isPrefixOf, intersperse, intercalate )
3738import Text.PrettyPrint.HughesPJ hiding ( Str )
@@ -301,9 +302,9 @@ inlineToMan _ Ellipses = return $ text "\\&..."
301302inlineToMan _ (Code str) =
302303 return $ text $ "\\f[B]" ++ escapeCode str ++ "\\f[]"
303304inlineToMan _ (Str str) = return $ text $ escapeString str
304−inlineToMan opts (Math InlineMath str) = inlineToMan opts (Code str)
305+inlineToMan opts (Math InlineMath str) = inlineListToMan opts $ readTeXMath str
305306inlineToMan opts (Math DisplayMath str) = do
306− contents <- inlineToMan opts (Code str)
307+ contents <- inlineListToMan opts $ readTeXMath str
307308 return $ text ".RS" $$ contents $$ text ".RE"
308309inlineToMan _ (TeX _) = return empty
309310inlineToMan _ (HtmlInline _) = return empty