我希望当我单击以下 MWE 中的“宇宙”一词时,它会带我到鸭子的图。
怎样才能做到这一点?
\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}
答案1
使用
\hyperref[fig:duck1]{Universe}
将单词链接到标签。
\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}