LaTeX编译警告‘Suppressing link with empty target’解决求助
解决LaTeX中
\thref触发的Suppressing link with empty target警告 问题原因
该警告源于hyperref与ntheorem的加载顺序错误——ntheorem的thref功能需要先于hyperref完成配置,才能为定理环境生成有效的链接锚点,反之会导致引用时找不到目标,触发空链接警告。
解决步骤
- 调整包加载顺序:将
hyperref移至ntheorem之后加载,确保两者的链接功能正常交互; - 保留
ntheorem的thref选项:你的代码中已启用[amsmath,thref]选项,这部分无需修改。
修改后的完整代码
\documentclass[12pt]{report} \usepackage{mathtools} \usepackage{graphicx} \usepackage{natbib} \usepackage{listings} \usepackage{xcolor} \usepackage{subfig} \usepackage{float} \usepackage[english]{babel} \usepackage{bookmark} \usepackage{amsmath} \usepackage{amsfonts} \usepackage[font=small,labelfont=bf]{caption} \usepackage[amsmath,thref]{ntheorem} % 先加载ntheorem \usepackage{hyperref} % 后加载hyperref \hypersetup{ colorlinks, citecolor=black, filecolor=black, linkcolor=black, urlcolor=black } % Useful Shortcuts and other refs \theoremstyle{break} \newtheorem{definition}{Definition}[section] \newtheorem{remark}{Remark}[section] \begin{document} \begin{remark}[Notation: Mode Ordering and Tensor Contraction]\label{rem:MOTC} Consider two tensors $A_{ack},B_{dkb}$ then the expressions \begin{equation*} C_{abcd} = A_{ack}B_{dkb} \end{equation*} and \begin{equation*} C_{abcd} = ((A_{ack}(B_{dkb})^{T_{1,2}})^{T_{2,4}})^{T_{3,4}} \end{equation*} are equivalent. \end{remark} The apparent inconsistence can be solved by implying the application of the Transposition Operation, like in \thref{rem:MOTC}. \end{document}
额外建议
若后续仍出现链接异常,可尝试用cleveref包替代thref——它对定理类环境的引用支持更稳定,只需在hyperref之后加载cleveref,并使用\cref{标签名}完成引用即可。
内容的提问来源于stack exchange,提问作者Indiano
相关产品推荐
相关产品推荐

