diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-03-24 09:41:45 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-03-24 09:41:45 -0700 |
commit | bb6897a13ed8ec9fd2d15930bd013bc7b315120e (patch) | |
tree | 00d462877ef84a7604b6989d1918930dc48b9f92 | |
parent | be2693bc45c92992e44f2c209b35f0de1d11fa53 (diff) | |
download | pandoc-bb6897a13ed8ec9fd2d15930bd013bc7b315120e.tar.gz |
LaTeX writer: Fixed position of label in figures.
Partially addresses #2813.
This isn't perfect, because now the hypertarget is in the
wrong place -- when you link to the figure, the screen
is positioned with the caption at the top, and most of
the figure off screen.
So this needs a bit more tweaking.
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 0f47132b3..a63aca1c5 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -415,10 +415,10 @@ blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,'f':'i':'g':':':tit)]) = d else brackets <$> inlineListToLaTeX (walk deNote txt) img <- inlineToLaTeX (Image attr txt (src,tit)) let footnotes = notesToLaTeX notes - figure <- refLabel ident $ cr <> + caption <- refLabel ident ("\\caption" <> captForLof <> braces capt) + let figure = cr <> "\\begin{figure}[htbp]" $$ "\\centering" $$ img $$ - ("\\caption" <> captForLof <> braces capt) $$ - "\\end{figure}" <> cr + caption $$ "\\end{figure}" <> cr return $ if inNote -- can't have figures in notes then "\\begin{center}" $$ img $+$ capt $$ "\\end{center}" |