![使用 breqn 命名方程式](https://linux22.com/image/264689/%E4%BD%BF%E7%94%A8%20breqn%20%E5%91%BD%E5%90%8D%E6%96%B9%E7%A8%8B%E5%BC%8F.png)
我知道应该使用tag
from 命令amsmath
来命名方程式(参见下面的 mwe)。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
c^2 &= a^2 + b^2
\tag{Pythagoras' theorem}
\label{eq:pit}
\end{align}
\end{document}
但如果我喜欢使用该breqn
包,该tag
命令将不起作用。
\documentclass{article}
\usepackage{amsmath}
\usepackage{breqn}
\begin{document}
\begin{dmath}
c^2 = a^2 + b^2
\tag{Pythagoras' theorem}
\label{eq:pit}
\end{dmath}
\end{document}
))
当我尝试编译上述 mwe 时出现以下错误。
! Package amsmath Error: \tag not allowed here.
See the amsmath package documentation for explanation.
Type H <return> for immediate help.
...
l.7 \tag
{Pythagoras' theorem}
?
! Emergency stop.
...
l.7 \tag
{Pythagoras' theorem}
\tag cannot be used at this point. If you don't understand why
you should consult the documentation.
But don't worry: just continue, and I'll forget what happened.
答案1
没有\tag
可用的命令breqn
;您必须使用number=
键;我添加了其他等式来表明编号与它无关。
\documentclass{article}
\usepackage{amsmath}
\usepackage{breqn}
%%% This code is provisional, in case you update
%%% to the last version of the expl3 bundle, waiting
%%% for an update to breqn (more precisely, flexisym)
\ExplSyntaxOn
\cs_set_eq:NN \int_eval:w \__int_eval:w
\cs_set_eq:NN \int_eval_end: \__int_eval_end:
\ExplSyntaxOff
%%% End of provisional code
\begin{document}
\begin{dmath}
1=1
\end{dmath}
\begin{dmath}[number={Pythagoras' theorem}]
c^2 = a^2 + b^2
\label{eq:pit}
\end{dmath}
\eqref{eq:pit}
\begin{dmath}
1=1
\end{dmath}
\end{document}