aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs9
1 files changed, 6 insertions, 3 deletions
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 =