@@ -288,6 +288,8 @@ blockToOpenDocument o bs
288288 | Plain b <- bs = if null b
289289 then return empty
290290 else inParagraphTags =<< inlinesToOpenDocument o b
291+ | Para [Image c (s,'f':'i':'g':':':t)] <- bs
292+ = figure c s t
291293 | Para b <- bs = if null b
292294 then return empty
293295 else inParagraphTags =<< inlinesToOpenDocument o b
@@ -334,7 +336,7 @@ blockToOpenDocument o bs
334336 mapM_ addParaStyle . newPara $ paraHStyles ++ paraStyles
335337 captionDoc <- if null c
336338 then return empty
337− else withParagraphStyle o "Caption" [Para c]
339+ else withParagraphStyle o "TableCaption" [Para c]
338340 th <- if all null h
339341 then return empty
340342 else colHeadsToOpenDocument o name (map fst paraHStyles) h
@@ -342,6 +344,12 @@ blockToOpenDocument o bs
342344 return $ inTags True "table:table" [ ("table:name" , name)
343345 , ("table:style-name", name)
344346 ] (vcat columns $$ th $$ vcat tr) $$ captionDoc
347+ figure caption source title | null caption =
348+ withParagraphStyle o "Figure" [Para [Image caption (source,title)]]
349+ | otherwise = do
350+ imageDoc <- withParagraphStyle o "FigureWithCaption" [Para [Image caption (source,title)]]
351+ captionDoc <- withParagraphStyle o "FigureCaption" [Para caption]
352+ return $ imageDoc $$ captionDoc
345353
346354colHeadsToOpenDocument :: WriterOptions -> String -> [String] -> [[Block]] -> State WriterState Doc
347355colHeadsToOpenDocument o tn ns hs =
@@ -553,4 +561,3 @@ textStyleAttr s
553561 ,("style:font-name-asian" ,"Courier New")
554562 ,("style:font-name-complex" ,"Courier New")]
555563 | otherwise = []
556−