Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a hyperlink navigate to the top of the figure in LaTeX when using hyperref?

I have a LaTeX document with a figure and references to it:

\begin{figure} ... \caption{...} \label{fig:1} \end{figure}  \ref{fig:1} 

I use the hyperref package to get hyperlinks in the resulting PDF. However the link to the figure navigates to the caption leaving the figure itself out of the view. How can I make it navigate to the start of the figure instead without moving the caption to the top?

like image 798
vitaut Avatar asked Oct 26 '10 13:10

vitaut


People also ask

How do I make an image a link in LaTeX?

Steps to make clickable links are as follows: Include hyperref package into your document preamble using the command \usepackage{hyperref}. hyperref package will enable you to add links with the description of your choice as well as to set URLs into your LaTeX document.

How do I move a figure to the bottom of the page in LaTeX?

Use \begin{figure}[b] ... \end{figure} .

How do I create a hyper link in LaTeX?

You can add a hyperlink into your LaTeX article using the command \usepackage{hyperref} and then including the command \href{YOUR URL}{TEXT FOR YOUR HYPERLINK}.

How do you put a figure at the top of the page in LaTeX?

You can insert a pagebreak via \clearpage or \newpage , then use the t option on the figure environment: ... \clearpage \begin{figure}[t!]


2 Answers

Add this in your preamble

\usepackage{hyperref} \usepackage[all]{hypcap}    %for going to the top of an image when a figure reference is clicked 

Make sure that the \usepackage[all]{hypcap} is written after the hyperref package is imported.

like image 173
nbz Avatar answered Sep 21 '22 10:09

nbz


To previous comment:

\usepackage{hyperref} \usepackage{caption} 

is slightly better than \usepackage[all]{hypcap} because when you use e.g. figure without captions there won't be a compilation problem. The caption package by default sets option

hypcap=true 

anchoring hyperlinks to the beginning of an environment.

like image 28
michalko Avatar answered Sep 20 '22 10:09

michalko