git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Put hypertarget inside figure environment.

Previously it surrounded the figure. This works around a problem with the endfloat package and makes pandoc's output compatible with it. Closes #4388.

commitb8f0d15a72bcd7423f8a929855766d86bf7ffd90 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 21 Feb 2018, 17:29 (9 years ago) parent0690df5
1 file changed+4−4
src/Text/Pandoc/Writers/LaTeX.hs+4−4
src/Text/Pandoc/Writers/LaTeX.hs+4−4
@@ -509,14 +509,14 @@ blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,'f':'i':'g':':':tit)]) = d
509509 let footnotes = notesToLaTeX notes
510510 lab <- labelFor ident
511511 let caption = "\\caption" <> captForLof <> braces capt <> lab
512− let figure = cr <> "\\begin{figure}" $$ "\\centering" $$ img $$
513− caption $$ "\\end{figure}" <> cr
514− figure' <- hypertarget True ident figure
512+ innards <- hypertarget True ident $
513+ "\\centering" $$ img $$ caption <> cr
514+ let figure = cr <> "\\begin{figure}" $$ innards $$ "\\end{figure}"
515515 return $ if inNote || inMinipage
516516 -- can't have figures in notes or minipage (here, table cell)
517517 -- http://www.tex.ac.uk/FAQ-ouparmd.html
518518 then "\\begin{center}" $$ img $+$ capt $$ "\\end{center}"
519− else figure' $$ footnotes
519+ else figure $$ footnotes
520520-- . . . indicates pause in beamer slides
521521blockToLaTeX (Para [Str ".",Space,Str ".",Space,Str "."]) = do
522522 beamer <- gets stBeamer