当每个子方程有多行时,如何对齐子方程?

当每个子方程有多行时,如何对齐子方程?

我有三个子方程,我希望它们左对齐,每个子方程的编号为 (1a)、(1b) 和 (1c)。由于还有其他方程,我无法更改现有的包或引入会干扰其他方程的全局设置。以下是我尝试过的。

\documentclass[11pt,a4paper]{report}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
\label{e:strain_core}
\begin{align}
\begin{split}
\epsilon_{xx}^{c}(x,z,t) = \dfrac{\partial u^c(x,z,t)}{\partial x} = {}& \dfrac{f_t z^{2}}{4 c^{2}} \Bigg(1+\dfrac{z}{c}\Bigg) w_{,xx}^{t} + \dfrac{f_b z^{2}}{4 c^{2}} \Bigg(-1+\dfrac{z}{c}\Bigg) w_{,xx}^{b} \\ & + z \Bigg(1-\dfrac{z^{2}}{c^{2}}\Bigg) \phi_{0,x}^{c}(x,t)  +\dfrac{z^{2}}{2c^{2}} \Bigg(1-\dfrac{z}{c}\Bigg) u_{0,x}^{b}  + \Bigg(1-\dfrac{z^{2}}{c^{2}}\Bigg) u_{0,x}^{c}
%\label{e: axial_straincore}\\% the equation can be tagged using the command \tag{1a}
\end{split} \\
\epsilon_{zz}^{c}(x,z,t) = \dfrac{\partial w^c(x,z,t)}{\partial z} = \Bigg(\dfrac{z}{c^{2}} - \dfrac{1}{2c}\Bigg) w^{b}(x,t) - \dfrac{2z}{c^{2}} w_0^{c}(x,t) + \Bigg(\dfrac{z}{c^{2}} + \dfrac{1}{2c}\Bigg) w^{t}(x,t) \\ %\label{e:transverse_straincore} 
\begin{split}
\gamma_{zx}^{c}(x,z,t) = \dfrac{\partial u^c(x,z,t)}{\partial z} + \dfrac{\partial w^c(x,z,t)}{\partial x} = -\Bigg(\dfrac{2 z}{c^{2}}\Bigg) u_{0}^{c} + \Bigg(\dfrac{z}{c^{2}} - \dfrac{3 z^{2}}{2 c^{3}} \Bigg) u_{0}^{b} + \Bigg(1-\dfrac{3 z^{2}}{c^{2}}\Bigg) \phi_{0}^{c} \\ + \Bigg(\dfrac{z}{c^{2}} + \dfrac{3 z^{2}}{2 c^{3}} \Bigg) u_{0}^{t} + \Bigg[-\Bigg(\dfrac{c+f_b}{2c^{2}}\Bigg) z + \Bigg(\dfrac{2c+3f_b}{4 c^{3}}\Bigg) z^{2}\Bigg] w_{,x}^{b}  + \Bigg[\Bigg(\dfrac{c+f_t}{2c^{2}}\Bigg) z \\+ \Bigg(\dfrac{2c+3f_t}{4 c^{3}}\Bigg) z^{2}\Bigg] w_{,x}^{t} + \Bigg(1-\dfrac{z^2}{c^2}\Bigg) w_{0,x}^{c}
%\label{e: shear_straincore}
\end{split}
\end{align}
\end{subequations}
\end{document}

答案1

如果你splitalign环境中使用,那么&内部的不同split环境实际上会排队。我会使用aligned环境(也来自amsmath) 将等式的各部分拆分为=符号之间。

\documentclass{report}
\usepackage{amsmath}
\begin{document}

\begin{subequations}
  \label{e:strain_core}
  \begin{align}
    \begin{split}
      \epsilon_{xx}^{c}(x,z,t)
        &= \dfrac{\partial u^c(x,z,t)}{\partial x}
      \\
        &= \begin{aligned}[t]
           & \dfrac{f_t z^{2}}{4 c^{2}} \Biggl(1+\dfrac{z}{c}\Biggr) w_{,xx}^{t}
             + \dfrac{f_b z^{2}}{4 c^{2}} \Biggl(-1+\dfrac{z}{c}\Biggr) w_{,xx}^{b}
           \\&
             + z \Biggl(1-\dfrac{z^{2}}{c^{2}}\Biggr) \phi_{0,x}^{c}(x,t)
             + \dfrac{z^{2}}{2c^{2}} \Biggl(1-\dfrac{z}{c}\Biggr) u_{0,x}^{b}
           \\& %% <- I added this one because your equation is too wide
              + \Biggl(1-\dfrac{z^{2}}{c^{2}}\Biggr) u_{0,x}^{c}
           \end{aligned}
    \end{split}
    \label{e:axial_straincore}% the equation can be tagged using the command \tag{1a}
    \\
    \begin{split}
      \epsilon_{zz}^{c}(x,z,t)
        &= \dfrac{\partial w^c(x,z,t)}{\partial z}
      \\
        &= \Biggl(\dfrac{z}{c^{2}} - \dfrac{1}{2c}\Biggr) w^{b}(x,t)
           - \dfrac{2z}{c^{2}} w_0^{c}(x,t)
           + \Biggl(\dfrac{z}{c^{2}} + \dfrac{1}{2c}\Biggr) w^{t}(x,t)
    \end{split}
    \label{e:transverse_straincore} 
    \\
    \begin{split}
      \gamma_{zx}^{c}(x,z,t)
        &= \dfrac{\partial u^c(x,z,t)}{\partial z}
           + \dfrac{\partial w^c(x,z,t)}{\partial x}
      \\
        &= \begin{aligned}[t]
           & -\Biggl(\dfrac{2 z}{c^{2}}\Biggr) u_{0}^{c}
             + \Biggl(\dfrac{z}{c^{2}} - \dfrac{3 z^{2}}{2 c^{3}} \Biggr) u_{0}^{b}
             + \Biggl(1-\dfrac{3 z^{2}}{c^{2}}\Biggr) \phi_{0}^{c}
           \\&
             + \Biggl(\dfrac{z}{c^{2}} + \dfrac{3 z^{2}}{2 c^{3}} \Biggr) u_{0}^{t}
             + \Biggr[-\Biggl(\dfrac{c+f_b}{2c^{2}}\Biggr) z + \Biggl(\dfrac{2c+3f_b}{4 c^{3}}\Biggr) z^{2}\Biggr] w_{,x}^{b}
           \\&
             + \Biggr[\Biggl(\dfrac{c+f_t}{2c^{2}}\Biggr) z
             + \Biggl(\dfrac{2c+3f_t}{4 c^{3}}\Biggr) z^{2}\Biggr] w_{,x}^{t}
             + \Biggl(1-\dfrac{z^2}{c^2}\Biggr) w_{0,x}^{c}
      \end{aligned}
    \end{split}
    \label{e:shear_straincore}
  \end{align}
\end{subequations}

Reference test: \ref{e:strain_core}, \ref{e:axial_straincore}, \ref{e:transverse_straincore}, \ref{e:shear_straincore}.

\end{document}

在此处输入图片描述

答案2

人们可以只使用对齐环境和其中的\nonumber宏来抑制不想获得数字的行的标记:

\documentclass[]{article}

\usepackage[]{amsmath}

\begin{document}
\begin{subequations}
\label{e:strain_core}
\begin{align}
  \epsilon_{xx}^{c}(x,z,t)
    &= \dfrac{\partial u^c(x,z,t)}{\partial x} \nonumber\\
    &= \dfrac{f_t z^{2}}{4 c^{2}} \Bigg(1+\dfrac{z}{c}\Bigg) w_{,xx}^{t} +
      \dfrac{f_b z^{2}}{4 c^{2}} \Bigg(-1+\dfrac{z}{c}\Bigg) w_{,xx}^{b} 
      + z \Bigg(1-\dfrac{z^{2}}{c^{2}}\Bigg) \phi_{0,x}^{c}(x,t) \nonumber\\
    &\phantom{={}} +\dfrac{z^{2}}{2c^{2}} \Bigg(1-\dfrac{z}{c}\Bigg) u_{0,x}^{b}
      + \Bigg(1-\dfrac{z^{2}}{c^{2}}\Bigg) u_{0,x}^{c}
    \\[1ex]
  \epsilon_{zz}^{c}(x,z,t) &= \dfrac{\partial w^c(x,z,t)}{\partial z}\nonumber\\
    &= \Bigg(\dfrac{z}{c^{2}} - \dfrac{1}{2c}\Bigg) w^{b}(x,t) -
      \dfrac{2z}{c^{2}} w_0^{c}(x,t) + \Bigg(\dfrac{z}{c^{2}} +
      \dfrac{1}{2c}\Bigg) w^{t}(x,t)
    \\[1ex]
  \gamma_{zx}^{c}(x,z,t)
    &= \dfrac{\partial u^c(x,z,t)}{\partial z} + \dfrac{\partial
       w^c(x,z,t)}{\partial x}\nonumber\\
    &= -\Bigg(\dfrac{2 z}{c^{2}}\Bigg) u_{0}^{c} + \Bigg(\dfrac{z}{c^{2}} -
      \dfrac{3 z^{2}}{2 c^{3}} \Bigg) u_{0}^{b} + \Bigg(1-\dfrac{3
      z^{2}}{c^{2}}\Bigg) \phi_{0}^{c} \nonumber\\
    &\phantom{={}} + \Bigg(\dfrac{z}{c^{2}} + \dfrac{3 z^{2}}{2 c^{3}} \Bigg)
      u_{0}^{t} + \Bigg[-\Bigg(\dfrac{c+f_b}{2c^{2}}\Bigg) z +
      \Bigg(\dfrac{2c+3f_b}{4 c^{3}}\Bigg) z^{2}\Bigg] w_{,x}^{b}\nonumber\\
    &\phantom{={}}+ \Bigg[\Bigg(\dfrac{c+f_t}{2c^{2}}\Bigg) z 
      + \Bigg(\dfrac{2c+3f_t}{4 c^{3}}\Bigg) z^{2}\Bigg] w_{,x}^{t} +
      \Bigg(1-\dfrac{z^2}{c^2}\Bigg) w_{0,x}^{c}
%\label{e: shear_straincore}
\end{align}
\end{subequations}
\end{document}

在此处输入图片描述

对于未来来说:如果在有意义的地方缩进和换行,代码似乎更容易维护……

另一种解决方案可能是将aligned环境嵌套在环境内部align(这样可以摆脱这些\phantom{={}}东西):

\documentclass[]{article}

\usepackage[]{amsmath}

\begin{document}
\begin{subequations}
\label{e:strain_core}
\begin{align}
  \epsilon_{xx}^{c}(x,z,t)
    &= \dfrac{\partial u^c(x,z,t)}{\partial x} \nonumber\\
    &=
      \begin{aligned}[t]
        &\dfrac{f_t z^{2}}{4 c^{2}} \Bigg(1+\dfrac{z}{c}\Bigg) w_{,xx}^{t} +
          \dfrac{f_b z^{2}}{4 c^{2}} \Bigg(-1+\dfrac{z}{c}\Bigg) w_{,xx}^{b} 
          + z \Bigg(1-\dfrac{z^{2}}{c^{2}}\Bigg) \phi_{0,x}^{c}(x,t) \\
        & +\dfrac{z^{2}}{2c^{2}} \Bigg(1-\dfrac{z}{c}\Bigg) u_{0,x}^{b}
          + \Bigg(1-\dfrac{z^{2}}{c^{2}}\Bigg) u_{0,x}^{c}
      \end{aligned}
    \\
  \epsilon_{zz}^{c}(x,z,t) &= \dfrac{\partial w^c(x,z,t)}{\partial z}\nonumber\\
    &= \Bigg(\dfrac{z}{c^{2}} - \dfrac{1}{2c}\Bigg) w^{b}(x,t) -
      \dfrac{2z}{c^{2}} w_0^{c}(x,t) + \Bigg(\dfrac{z}{c^{2}} +
      \dfrac{1}{2c}\Bigg) w^{t}(x,t)
    \\[1ex]
  \gamma_{zx}^{c}(x,z,t)
    &= \dfrac{\partial u^c(x,z,t)}{\partial z} + \dfrac{\partial
       w^c(x,z,t)}{\partial x}\nonumber\\
    &=
    \begin{aligned}[t]
      &-\Bigg(\dfrac{2 z}{c^{2}}\Bigg) u_{0}^{c} + \Bigg(\dfrac{z}{c^{2}} -
        \dfrac{3 z^{2}}{2 c^{3}} \Bigg) u_{0}^{b} + \Bigg(1-\dfrac{3
        z^{2}}{c^{2}}\Bigg) \phi_{0}^{c} \\
      & + \Bigg(\dfrac{z}{c^{2}} + \dfrac{3 z^{2}}{2 c^{3}} \Bigg)
        u_{0}^{t} + \Bigg[-\Bigg(\dfrac{c+f_b}{2c^{2}}\Bigg) z +
        \Bigg(\dfrac{2c+3f_b}{4 c^{3}}\Bigg) z^{2}\Bigg] w_{,x}^{b}\\
      &+ \Bigg[\Bigg(\dfrac{c+f_t}{2c^{2}}\Bigg) z 
        + \Bigg(\dfrac{2c+3f_t}{4 c^{3}}\Bigg) z^{2}\Bigg] w_{,x}^{t} +
        \Bigg(1-\dfrac{z^2}{c^2}\Bigg) w_{0,x}^{c}
    \end{aligned}
%\label{e: shear_straincore}
\end{align}
\end{subequations}
\end{document}

(结果看起来类似,但标签的对齐方式不同)

相关内容