How to make the text in front of the eqution or figure number become a hyperlink？

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:

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?

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

The following example highlights this:

\documentclass{article}
\usepackage{hyperref}
\hypersetup{
}
\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