1

I would like that when I click the word 'universe' in the following MWE, it takes me to Fig of duck.

How can that be done?

 \documentclass[]{report}
 \usepackage[]{graphicx}
 \usepackage{chngcntr}
 \usepackage{hyperref}
 \begin{document}
 And, when you want something, all the \href{fig:duck1}{Universe} conspires in helping you to achieve it.
 \newpage
 \begin{figure}[!h]
 \includegraphics[width=0.3\linewidth]{example-fig-duck}%
 \caption{duck1}
 \label{fig:duck1}%
 \end{figure}% <<<

 \end{document}
2

Use

\hyperref[fig:duck1]{Universe}

to link a word to a label.

\documentclass{report}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
And, when you want something, all the \hyperref[fig:duck1]{Universe} conspires in helping you to achieve it.

\begin{figure}
\centering
\includegraphics[width=0.3\linewidth]{example-image-duck}
\caption{duck1}
\label{fig:duck1}
\end{figure}
\end{document}

The word "Universe" is a hyperlink.

  • downvote for showing the duckish output:-) – David Carlisle Sep 30 '18 at 16:39
  • @DavidCarlisle ohhh ... rubbish, I removed the \newpage on purpose to have the duck on the same page so I can harvest all the reputation off it. – moewe Sep 30 '18 at 16:40
  • Haha @David , the ultimate answer perhaps is not 42, but this duck :-) – Rouge Sep 30 '18 at 16:54

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.