From dd799df0aed2df843c6881cec296869b622c0780 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Wed, 19 Oct 2016 11:40:44 +0200 Subject: Image with a caption needs special formatting Latex Writer only handles captions if the image's title is prefixed with 'fig:'. --- src/Text/Pandoc/Readers/Odt/ContentReader.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs index 0b152268f..42f018157 100644 --- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs +++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs @@ -779,8 +779,12 @@ read_frame_text_box = matchingElement NsDraw "text-box" arr read_img_with_caption -< toList paragraphs read_img_with_caption :: [Block] -> Inlines -read_img_with_caption ((Para ((Image attr _ target) : txt)) : _) = - singleton (Image attr txt target) -- override caption with the text that follows +read_img_with_caption ((Para ((Image attr alt (src,title)) : [])) : _) = + singleton (Image attr alt (src, 'f':'i':'g':':':title)) -- no text, default caption +read_img_with_caption ((Para ((Image attr _ (src,title)) : txt)) : _) = + singleton (Image attr txt (src, 'f':'i':'g':':':title) ) -- override caption with the text that follows +read_img_with_caption ( (Para (_ : xs)) : ys) = + read_img_with_caption ((Para xs) : ys) read_img_with_caption _ = mempty -- cgit v1.2.3