When referecnging a figure, you write something like:

\caption{A figure}

and to reference this figure you can just write "an example is figure \ref{figureExample}", and then you will get a text like

an example is figure 2.1

where 2.1 will be clickable. Now to my question; if I want both the text "figure" and the "2.1" to be clickable, how can I achieve this?


I can think of two possibilities:

  • Load the hyperref package and use the \autoref macro of that package;

  • in addition to loading hyperref, load the cleveref package with the option nameinlink, and use the \cref macro to generate the cross-references.

One of the nifty aspects of \cref is that you can call several objects all in one go; the package will take care of any sorting and compressing needs.

enter image description here

\section{In the beginning} \label{sec:begin}
\caption{A figure} \label{fig:example}

\begin{equation} \label{eq:pyth}


As was discussed in \autoref{sec:begin} and shown in \autoref{fig:example}, \dots

As argued in \cref{sec:begin,fig:example,eq:pyth}, \dots
  • Thanks! As said in the comment above:The only problem with auto ref is that it automatically use the labels in english. Any way to get it to use another language? – – miniHessel Mar 1 '15 at 20:21
  • @miniHeessel - Is there any language in particular you're interested in? – Mico Mar 1 '15 at 20:22
  • Norwegian, so for example instead of figure : figur. Instead of Table :tabell – miniHessel Mar 1 '15 at 20:23
  • @miniHeessel - You're in luck if you use \cref: just load cleveref with the option norsk, and the sentence in the example above will come out as "... avsnitt 1, figur 1 og likning (1) ...". (I'm afraid cleveref doesn't recognize the option nynorsk...) – Mico Mar 1 '15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.