@@ -151,9 +151,10 @@ blockToRST :: WriterOptions -- ^ Options
151151 -> State WriterState Doc
152152blockToRST opts Null = return empty
153153blockToRST opts (Plain inlines) = wrappedRST opts inlines
154−blockToRST opts (Para [TeX str]) =
154+blockToRST opts (Para [Math str]) =
155155 let str' = if "\n" `isSuffixOf` str then str ++ "\n" else str ++ "\n\n" in
156− return $ hang (text "\n.. raw:: latex\n") 3 $ vcat $ map text (lines str')
156+ return $ hang (text "\n.. raw:: latex\n") 3 $ text "\\[" <>
157+ (vcat $ map text (lines str')) <> text "\\]"
157158blockToRST opts (Para inlines) = do
158159 contents <- wrappedRST opts inlines
159160 return $ contents <> text "\n"
@@ -285,7 +286,8 @@ inlineToRST opts Apostrophe = return $ char '\''
285286inlineToRST opts Ellipses = return $ text "..."
286287inlineToRST opts (Code str) = return $ text $ "``" ++ str ++ "``"
287288inlineToRST opts (Str str) = return $ text $ escapeString str
288−inlineToRST opts (TeX str) = return $ text str
289+inlineToRST opts (Math str) = return $ char '$' <> text str <> char '$'
290+inlineToRST opts (TeX str) = return empty
289291inlineToRST opts (HtmlInline str) = return empty
290292inlineToRST opts (LineBreak) = return $ char ' ' -- RST doesn't have linebreaks
291293inlineToRST opts Space = return $ char ' '