git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Don't use figure inside table cell.
3504915John MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+4−2
@@ -474,6 +474,7 @@ blockToLaTeX (Plain lst) =
474-- title beginning with fig: indicates that the image is a figure
474-- title beginning with fig: indicates that the image is a figure
475blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,'f':'i':'g':':':tit)]) = do
475blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,'f':'i':'g':':':tit)]) = do
476 inNote <- gets stInNote
476 inNote <- gets stInNote
477+ inMinipage <- gets stInMinipage
477 modify $ \st -> st{ stInMinipage = True, stNotes = [] }
478 modify $ \st -> st{ stInMinipage = True, stNotes = [] }
478 capt <- inlineListToLaTeX txt
479 capt <- inlineListToLaTeX txt
479 notes <- gets stNotes
480 notes <- gets stNotes
@@ -490,8 +491,9 @@ blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,'f':'i':'g':':':tit)]) = d
490 let figure = cr <> "\\begin{figure}" $$ "\\centering" $$ img $$
491 let figure = cr <> "\\begin{figure}" $$ "\\centering" $$ img $$
491 caption $$ "\\end{figure}" <> cr
492 caption $$ "\\end{figure}" <> cr
492 figure' <- hypertarget True ident figure
493 figure' <- hypertarget True ident figure
493− return $ if inNote
494+ return $ if inNote || inMinipage
494− -- can't have figures in notes
495+ -- can't have figures in notes or minipage (here, table cell)
496+ -- http://www.tex.ac.uk/FAQ-ouparmd.html
495 then "\\begin{center}" $$ img $+$ capt $$ "\\end{center}"
497 then "\\begin{center}" $$ img $+$ capt $$ "\\end{center}"
496 else figure' $$ footnotes
498 else figure' $$ footnotes
497-- . . . indicates pause in beamer slides
499-- . . . indicates pause in beamer slides