@@ -411,10 +411,22 @@ blockToOpenDocument o bs
411411 figure attr caption source title | null caption =
412412 withParagraphStyle o "Figure" [Para [Image attr caption (source,title)]]
413413 | otherwise = do
414+ id' <- gets stImageId
414415 imageDoc <- withParagraphStyle o "FigureWithCaption" [Para [Image attr caption (source,title)]]
415− captionDoc <- withParagraphStyle o "FigureCaption" [Para caption]
416+ captionDoc <- numberedFigureCaption id' <$> inlinesToOpenDocument o caption
416417 return $ imageDoc $$ captionDoc
417418
419+numberedFigureCaption :: Int -> Doc -> Doc
420+numberedFigureCaption num caption =
421+ let t = text "Figure "
422+ r = num - 1
423+ s = inTags False "text:sequence" [ ("text:ref-name", "refIllustration" ++ show r),
424+ ("text:name", "Illustration"),
425+ ("text:formula", "ooow:Illustration+1"),
426+ ("style:num-format", "1") ] $ text $ show num
427+ c = text ": "
428+ in inParagraphTagsWithStyle "FigureCaption" $ hcat [ t, s, c, caption ]
429+
418430colHeadsToOpenDocument :: PandocMonad m
419431 => WriterOptions -> [String] -> [[Block]]
420432 -> OD m Doc