如何在“对齐”环境中添加自定义方程编号和文本?

如何在“对齐”环境中添加自定义方程编号和文本?

我想在对齐环境中的公式编号前添加自定义字符串。此外,我想向公式编号本身添加一些信息(例如,公式的具体参考)。我能够从另外两个 StackExchange 线程中生成以下代码片段:

% Add additional information to equation, including a custom name and the specific location in a reference. Instead of:
% "a²+b²=c² (1)"
% this renders:
% "a²+b²=c² Pythagorean Theorem (1, cf. eq. 1.123 in [1])"
% Syntax:
% \eqlabel{custom string}{bibtex reference}{location in reference}
% eg.:
% \eqlabel{Pythagorean Theorem}{2010_pythagoras_equations}{eq. 1.123}
% cf. https://tex.stackexchange.com/a/668944
% cf. https://tex.stackexchange.com/a/691267
\usepackage{mathtools}
\newtagform{eqlabel}{#1 (}{)}
\newcommand*{\eqlabel}[3]{%
    \renewtagform{eqlabel}{#1 (}{, cf.\@ #3 in \cite{#2})}
    \usetagform{eqlabel}
}
\AfterEndEnvironment{equation}{\usetagform{default}}

这对于方程式来说非常有效(尽管方程式不再位于页面的中心,而是位于行中剩余的自由空间):

\begin{equation}
    \vec{s} = \mathbf{A}^{-1}\vec{f} \eqlabel{Solution to the Inventory Problem}{heijungs_computational_2002}{eq. 2.21}
\end{equation}

在此处输入图片描述

我怎么能够:

  1. 使其在环境中工作align(针对每一行)
  2. 确保公式位于页面中央,而不是行内剩余的空白处

相关内容