@@ -32,6 +32,7 @@ module Text.Pandoc.Writers.Man ( writeMan) where
32import Text.Pandoc.Definition
32import Text.Pandoc.Definition
33import Text.Pandoc.Templates
33import Text.Pandoc.Templates
34import Text.Pandoc.Shared
34import Text.Pandoc.Shared
35+import Text.Pandoc.Readers.TeXMath
35import Text.Printf ( printf )
36import Text.Printf ( printf )
36import Data.List ( isPrefixOf, intersperse, intercalate )
37import Data.List ( isPrefixOf, intersperse, intercalate )
37import Text.PrettyPrint.HughesPJ hiding ( Str )
38import Text.PrettyPrint.HughesPJ hiding ( Str )
@@ -301,9 +302,9 @@ inlineToMan _ Ellipses = return $ text "\\&..."
301inlineToMan _ (Code str) =
302inlineToMan _ (Code str) =
302 return $ text $ "\\f[B]" ++ escapeCode str ++ "\\f[]"
303 return $ text $ "\\f[B]" ++ escapeCode str ++ "\\f[]"
303inlineToMan _ (Str str) = return $ text $ escapeString str
304inlineToMan _ (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
305inlineToMan opts (Math DisplayMath str) = do
306inlineToMan opts (Math DisplayMath str) = do
306− contents <- inlineToMan opts (Code str)
307+ contents <- inlineListToMan opts $ readTeXMath str
307 return $ text ".RS" $$ contents $$ text ".RE"
308 return $ text ".RS" $$ contents $$ text ".RE"
308inlineToMan _ (TeX _) = return empty
309inlineToMan _ (TeX _) = return empty
309inlineToMan _ (HtmlInline _) = return empty
310inlineToMan _ (HtmlInline _) = return empty