aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index f35d1ebf5..da21b67ea 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -500,13 +500,17 @@ inlineCommands = M.fromList $
mkImage :: String -> LP Inlines
mkImage src = do
-- try for a caption
- alt <- option (str "image") $ try $ spaces >>
- controlSeq "caption" >> optional (char '*') >> grouped inline
+ (alt, tit) <- option (str "image", "") $ try $ do
+ spaces
+ controlSeq "caption"
+ optional (char '*')
+ ils <- grouped inline
+ return (ils, "fig:")
case takeExtension src of
"" -> do
defaultExt <- getOption readerDefaultImageExtension
- return $ image (addExtension src defaultExt) "" alt
- _ -> return $ image src "" alt
+ return $ image (addExtension src defaultExt) tit alt
+ _ -> return $ image src tit alt
inNote :: Inlines -> Inlines
inNote ils =