aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-06 22:31:15 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-06 22:31:15 -0700
commit3504915e63c68c3a4e91b8dcccb90c93435cf212 (patch)
treef5825ca987ec38380fd06ca65af4dbe086351719 /src
parent1b5bfced558d28d45caadc6171f9e7448f3deae1 (diff)
downloadpandoc-3504915e63c68c3a4e91b8dcccb90c93435cf212.tar.gz
LaTeX writer: Don't use figure inside table cell.
Closes #3836.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 55ecda819..4b7bf0e9b 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -474,6 +474,7 @@ blockToLaTeX (Plain lst) =
-- title beginning with fig: indicates that the image is a figure
blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,'f':'i':'g':':':tit)]) = do
inNote <- gets stInNote
+ inMinipage <- gets stInMinipage
modify $ \st -> st{ stInMinipage = True, stNotes = [] }
capt <- inlineListToLaTeX txt
notes <- gets stNotes
@@ -490,8 +491,9 @@ blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,'f':'i':'g':':':tit)]) = d
let figure = cr <> "\\begin{figure}" $$ "\\centering" $$ img $$
caption $$ "\\end{figure}" <> cr
figure' <- hypertarget True ident figure
- return $ if inNote
- -- can't have figures in notes
+ return $ if inNote || inMinipage
+ -- can't have figures in notes or minipage (here, table cell)
+ -- http://www.tex.ac.uk/FAQ-ouparmd.html
then "\\begin{center}" $$ img $+$ capt $$ "\\end{center}"
else figure' $$ footnotes
-- . . . indicates pause in beamer slides