我的代码:
\documentclass{article}
\usepackage{amsthm}
\usepackage{hyperref}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
\label{th:01}
Let \( a \) and \( b \) two real numbers. Then \( (a + b)^2 = a^2 +
2ab + b^2. \).
\end{theorem}
\begin{proof}
\( (a + b)^2 = (a + b)(a + b) = a^2 + 2ab + b^2 \).
\end{proof}
Theorem \ref{th:01} is a very important theorem!
\end{document}
在输出 PDF 中最后一行如下所示:
定理1是一个非常重要的定理!
仅“定理 1”中的“1”成为定理 1 的超链接。
我怎样才能编写 LaTeX 代码使得“定理 1”这两个单词成为指向定理 1 的超链接?
答案1
\documentclass{article}
\usepackage{amsthm}
\usepackage{hyperref}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
\label{th:01}
Let \( a \) and \( b \) two real numbers. Then \( (a + b)^2 = a^2 +
2ab + b^2. \).
\end{theorem}
\begin{proof}
\( (a + b)^2 = (a + b)(a + b) = a^2 + 2ab + b^2 \).
\end{proof}
\hyperref[th:01]{Theorem \ref*{th:01}} is a very important theorem!
\end{document}