From 52ee09608a3ada9ce465f2a0b0feef62bd7a9bde Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 26 Feb 2013 22:16:03 -0800 Subject: LaTeX reader: Handle \caption for images in figures. Closes #766. --- src/Text/Pandoc/Readers/LaTeX.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index af912c28e..f35d1ebf5 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -498,12 +498,15 @@ inlineCommands = M.fromList $ [ "noindent", "index", "nocite" ] mkImage :: String -> LP Inlines -mkImage src = +mkImage src = do + -- try for a caption + alt <- option (str "image") $ try $ spaces >> + controlSeq "caption" >> optional (char '*') >> grouped inline case takeExtension src of "" -> do defaultExt <- getOption readerDefaultImageExtension - return $ image (addExtension src defaultExt) "" (str "image") - _ -> return $ image src "" (str "image") + return $ image (addExtension src defaultExt) "" alt + _ -> return $ image src "" alt inNote :: Inlines -> Inlines inNote ils = -- cgit v1.2.3