例如,我想用自定义文本替换找不到参考文献??
时显示的内容(这样,当不存在定理时,它只会指向全文)或使其更加明显。autoref
full paper
\color{red} undefined Label
有人给出了答案这里,cleveref
但我有一个仅涉及的解决方案autoref
。
谢谢!
梅威瑟:
\documentclass{article}
\usepackage{amsthm,hyperref}
\bibliographystyle{amsalpha}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}\label{catfish}
\end{theorem}
\autoref{catfish} implies the truth of \autoref{god}.
\bibliography{bibshort}{}
\end{document}.
答案1
\documentclass{article}
\usepackage{amsthm}
\usepackage{hyperref}
\newtheorem{theorem}{Theorem}
\usepackage{etoolbox,xcolor}
\makeatletter
\patchcmd\HyRef@autosetref{\bfseries ??}{\missingreftext}{}{\fail}
\newcommand\missingreftext{\textcolor{red}{missing ref}}
\makeatother
\begin{document}
\begin{theorem}\label{catfish}
\end{theorem}
\autoref{catfish} implies the truth of \autoref{god}.
\end{document}