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.
This commit is contained in:
John MacFarlane
2016-03-24 09:41:45 -07:00
parent be2693bc45
commit bb6897a13e
+3 -3
View File
@@ -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}"