当 mathtools showonlyrefs 为真时,强制对特定方程进行编号

当 mathtools showonlyrefs 为真时,强制对特定方程进行编号

为了避免在添加/删除*s 以对方程式进行编号或不编号方面浪费时间,我\mathtools{showonlyrefs=true}在序言中使用 。尽管如此,有时我想对未引用的方程式进行编号。例如,如果两个子方程中只有一个被引用,我希望两者都被编号。所以问题是:如果在序言中使用 ,
我如何强制对未引用的方程式(或子方程)进行编号?\mathtools{showonlyrefs=true}

答案1

mathtools提供\noeqref此目的。要显示带有标签的方程式的编号eq:abc,请添加\noeqref{eq:abc}。该命令类似于\nocite引用的命令。

在此处输入图片描述

\documentclass{article}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\begin{document}
Reference to \eqref{1}.
\noeqref{3}
\begin{gather}
a=b \label{1} \\
a=c \label{2} \\
a=d \label{3} \\
\end{gather}
\end{document}

相关内容