在子方程内对对齐进行编号

在子方程内对对齐进行编号

我有一个主方程和几个要显示的初始/边界条件。第一个方程应该只标有 3.3,理想情况下,条件的标有 3.3a、3.3b 等。

第一个 eq 也有些独特,因为我希望它以表格格式显示,因为它跨越 3 行并且有模式。环境align弄乱了间距,所以我选择了alignat

\usepackage[tbtags]{amsmath}
\newcommand{\s}{\hspace{0.12cm}}

The 2D form of Equation \eqref{eq:pathenum1} is thus

\vspace{-0.4cm}
\begin{subequations}\label{eq:pathenum2}
\begin{alignat}{3}
    \xi_2(x,y,t+1) \s &=\s \xi_2(x-1,y+1,t) \s &+& \s \xi_2(x,y+1,t) \s &+& \s \xi_2(x+1,y+1,t) \nonumber\\
                      &+\s \xi_2(x-1,y,t) \s &+& \s \xi_2(x,y,t) \s &+& \s \xi_2(x+1,y,t) \tag{\label{eq:pathenum2}}\\
                      &+\s \xi_2(x-1,y-1,t) \s &+& \s \xi_2(x,y-1,t) \s &+& \s \xi_2(x+1,y-1,t), \nonumber
\end{alignat}

and the 3D form is displayed in Appendix Equation \eqref{appeq:pathenum3}. Initial and boundary
conditions for the 2D (and for any $D$) case are also the same as in 1D as the theory behind them
still applies and is carried forward:

\vspace{-0.45cm}
\begin{align}
    &\xi_2(0,0,1) = 1, \label{eq:pathenum2a}\\
    &\xi_2(x,y,t) = 0 \quad \mathrm{for} \quad \forall t<0, \; \forall x,y, \label{eq:pathenum2b}\\
    &\xi_2(x,y,t) = 0 \quad \mathrm{for} \quad \forall|x|,|y| > t. \label{eq:pathenum2c}
\end{align}
\end{subequations}

正如您所看到的,编号对于我的主要方程式来说并不十分适用——我已经在工作中的其他地方对单行方程式进行了管理,但对于这种情况,我该如何修复它呢?

答案1

由于您使用的是tbtags,数字应该与底行对齐。

你需要的\tag{\ref{<label>}},不在\label里面\tag

&&+此外,您还可以通过使用适当的标记(即 )来删除添加的间距&+&

避免在显示前留空行(这就是您需要添加负间距的原因)。只有当新段落开始时,显示后才能留空行。

我还删除了该词\mathrm{for},因为“forall”符号中已经暗示了该词。

\documentclass{article}
\usepackage[tbtags]{amsmath}

\begin{document}
The 2D form of Equation \eqref{eq:pathenum1} is thus
\begin{subequations}\label{eq:pathenum2}
\begin{alignat*}{3}
\xi_2(x,y,t+1) &= \xi_2(x-1,y+1,t) &&+ \xi_2(x,y+1,t) &&+ \xi_2(x+1,y+1,t) \\
               &+ \xi_2(x-1,y,t)   &&+ \xi_2(x,y,t)   &&+ \xi_2(x+1,y,t) \\
               &+ \xi_2(x-1,y-1,t) &&+ \xi_2(x,y-1,t) &&+ \xi_2(x+1,y-1,t),
  \tag{\ref{eq:pathenum2}}
\end{alignat*}
and the 3D form is displayed in Appendix Equation \eqref{appeq:pathenum3}. Initial and boundary
conditions for the 2D (and for any $D$) case are also the same as in 1D as the theory behind them
still applies and is carried forward:
\begin{align}
    &\xi_2(0,0,1) = 1, \label{eq:pathenum2a}\\
    &\xi_2(x,y,t) = 0 \qquad \forall t<0, \; \forall x,y, \label{eq:pathenum2b}\\
    &\xi_2(x,y,t) = 0 \qquad \forall|x|,|y| > t. \label{eq:pathenum2c}
\end{align}
\end{subequations}

\end{document}

在此处输入图片描述

答案2

您可以简单地在第一个方程后减少方程计数器:

\documentclass{article}

\usepackage[tbtags]{amsmath}
\newcommand{\s}{\hspace{0.12cm}}
\usepackage[noabbrev]{cleveref}

\begin{document}

The 2D form of Equation \eqref{eq:pathenum1} is thus

\vspace{-0.4cm}
\begin{equation}\label{eq:pathenum2}
\begin{alignedat}{3}
    \xi_2(x,y,t+1) \s &=\s \xi_2(x-1,y+1,t) \s &+& \s \xi_2(x,y+1,t) \s &+& \s \xi_2(x+1,y+1,t) \\
                      &+\s \xi_2(x-1,y,t) \s &+& \s \xi_2(x,y,t) \s &+& \s \xi_2(x+1,y,t) \\
                      &+\s \xi_2(x-1,y-1,t) \s &+& \s \xi_2(x,y-1,t) \s &+& \s \xi_2(x+1,y-1,t),
\end{alignedat}
\end{equation}
%
and the 3D form is displayed in Appendix Equation \eqref{appeq:pathenum3}. Initial and boundary
conditions for the 2D (and for any $D$) case are also the same as in 1D as the theory behind them
still applies and is carried forward in \cref{eq:pathenum2a,eq:pathenum2b,eq:pathenum2c}:

\vspace{-0.45cm}\addtocounter{equation}{-1}
\begin{subequations}
\begin{align}
    &\xi_2(0,0,1) = 1, \label{eq:pathenum2a}\\
    &\xi_2(x,y,t) = 0 \quad \mathrm{for} \quad \forall t<0, \; \forall x,y, \label{eq:pathenum2b}\\
    &\xi_2(x,y,t) = 0 \quad \mathrm{for} \quad \forall|x|,|y| > t. \label{eq:pathenum2c}
\end{align}
\end{subequations}

\end{document}

在此处输入图片描述

相关内容