1

I found that in many journals not only the number but also the text such as Fig or Eq can be a hyperlinked so one can be directed to the equation or figure by clicking the hyperlink. This is what is looks like:

enter image description here

Now I want to my document's hyperlink to look similar, but I only know when the hyperref package is loaded, using the \label and \ref command can create the hyperlink via the number.

How can I create the hyperlink like in the journal?

1

You can either set the hyperlink manually using a combination of \hyperref[<label>]{... \ref*{<label>} ...} or \autoref{<label>}.

The following example highlights this:

enter image description here

\documentclass{article}
\usepackage{hyperref}
\hypersetup{
  colorlinks
}
\begin{document}

\begin{figure}
  \caption{A figure}\label{fig:first}
  \caption{Another figure}\label{fig:second}
\end{figure}

See \hyperref[fig:first]{Figure~\ref*{fig:first}} and~\ref{fig:second}.
Alternatively, see \autoref{fig:first} and~\ref{fig:second}.

\end{document}

The starred version of \ref* removes any hyperlinking, which you want to avoid inside \hyperref.

  • It works, Thanks for your answer and grammar corrections :) @Werner – Ice0cean Mar 2 '16 at 2:53

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.