@@ -112,7 +112,9 @@ setInDefinitionList :: Bool -> State WriterState ()
112112setInDefinitionList b = modify $ \s -> s { stInDefinition = b }
113113
114114inParagraphTags :: Doc -> Doc
115−inParagraphTags = inTags False "text:p" [("text:style-name", "Text_20_body")]
115+inParagraphTags d | isEmpty d = empty
116+inParagraphTags d =
117+ inTags False "text:p" [("text:style-name", "Text_20_body")] d
116118
117119inParagraphTagsWithStyle :: String -> Doc -> Doc
118120inParagraphTagsWithStyle sty = inTags False "text:p" [("text:style-name", sty)]
@@ -359,7 +361,7 @@ inlineToOpenDocument o ils
359361 | Code s <- ils = preformatted s
360362 | Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
361363 | Cite _ l <- ils = inlinesToOpenDocument o l
362− | TeX s <- ils = preformatted s
364+ | TeX _ <- ils = return empty
363365 | HtmlInline s <- ils = preformatted s
364366 | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
365367 | Image _ (s,_) <- ils = return $ mkImg s