以下是我的编码
\documentclass{article}
\usepackage[colorlinks]{hyperref}
\begin{document}
To test whether Figure \ref{fig1} a suspicious URL is vulnerable, we utilize the URL to download a representative Figure \ref{fig2}
\begin{figure}
\caption{Sample Figure 1\label{fig1}}
\end{figure}
\begin{figure}
\caption{Sample Figure 2\label{fig2}}
\end{figure}
\end{document}
我需要实现的目标如下所述,
\documentclass{article}
\usepackage[colorlinks]{hyperref}
\begin{document}
To test whether \ref{fig1}{Figure 1} a suspicious URL is vulnerable, we utilize the URL to download a representative \ref{fig2}{Figure 2}
\begin{figure}
\caption{Sample Figure 1\label{fig1}}
\end{figure}
\begin{figure}
\caption{Sample Figure 2\label{fig2}}
\end{figure}
\end{document}
在图中引用时,我希望我的自定义文本显示为 \ref{fig1}{图 1},并且我只想使用 \ref{fig1} 进行链接,
提前致谢,请指导,
答案1
正如@moewe 建议的那样,我找到了解决方案,也感谢他
\documentclass{article}
\usepackage[colorlinks]{hyperref}
\begin{document}
To test whether \hyperref[fig1]{Figure 1} a suspicious URL is vulnerable, we utilize the URL to download a representative \hyperref[fig2]{Figure 2}
\begin{figure}
\caption{Sample Figure 1\label{fig1}}
\end{figure}
\begin{figure}
\caption{Sample Figure 2\label{fig2}}
\end{figure}
\end{document}