General ⇒ References to figures with hyperref
References to figures with hyperref
What is not so convenient is this: The hyperlink references the exact place of the \label{fig:XXX}. This works great for makeindex and such, but as long as I have my captions printed below my figures, the result of activating the reference link in the pdf-file is that my Adobe Reader (version 7.0.9 on MS Windows) shows me the caption, and not the figure. Depending on the viewing setup of Adobe Reader (single page, continuous, FitW, FitH) the figure is partially or completely off-screen.
I would like to make the hyperlink show the whole figure. How do I go about this?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- countbela666
- Posts: 64
- Joined: Thu Apr 26, 2007 2:44 pm
References to figures with hyperref
just put the following code into your preamble (after including hyperref!):
Code: Select all
\usepackage[all]{hypcap}
Marcel
a thousand worlds for you to see here, take my hand and follow me...
Re: References to figures with hyperref
I noticed that it did not work as expected, though. I use MikTeX 2.5, and I found that I needed to start all my figure environments with \capstart instead og passing the [all] opption to hypercap. This is OK for me, though. It seems to be more flexible, too, as it allows for finer control, i.e. it works better with subfigures.
Cheers.
Now, while I am at it it would be lovely with backreferences too. I am considering wether to put all my figures on a separate page of floats, and then it would be nice to be able to navigate easily back to the place in the text where the figure was referenced.
Any ideas for this?
- countbela666
- Posts: 64
- Joined: Thu Apr 26, 2007 2:44 pm
References to figures with hyperref
The following minimum example implements a solution with the View->Back menu item:
Code: Select all
\documentclass[demo,english]{article}
\usepackage{babel,blindtext,graphicx,hyperref}
\usepackage[all]{hypcap}
\def\demofig{%
\begin{figure}
\centering
\includegraphics{foo}
\caption{I'm figure \thefigure}
\Acrobatmenu{GoBack}{(back)}
\label{fig:\thefigure}
\end{figure}
}
\begin{document}
see~\autoref{fig:2}\par
\Blindtext[5]
\demofig\demofig\demofig
\Blindtext[5]
see~\autoref{fig:1}
\end{document}
Marcel
a thousand worlds for you to see here, take my hand and follow me...