对齐多个短方程和长方程

对齐多个短方程和长方程

有人能帮我吗?我已经尝试了许多其他类似的建议,但似乎都没有给出我想要的结果。我有一组短方程和长方程

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
    \begin{gather} 
        \mathcal{C}\left(\vec{u}_h,q_h, \rho\right)  = \mathcal{B}^1(q_h),\label{DiscretizedConti} \\
        \mathcal{U}^C\left(\vec{u}_h,\vec{u}_h,\vec{v}_h, \rho\right) + \mathcal{U}^P\left(p_h,\vec{v}_h\right) + \frac{1}{\text{Re}}\mathcal{U}^D\left(\vec{u}_h,\vec{v}_h,\mu\right) + \frac{1}{\text{Fr}^2}\mathcal{U}^S\left(\rho, \vec{v}_h\right) = \mathcal{B}^2(\vec{v}_h),  \\
        \mathcal{S}^C\left(\vec{u}_h,T_h,r_h, \rho\right) + \frac{1}{\text{Re}~\text{Pr}}\mathcal{S}^D\left(T_h,r_h,k/c_p(T_h)\right) + \text{H}~\textbf{Da} ~ \mathcal{S}^S\left(r_h, Q(T_h,\vec{Y}_h), \omega(T_h,\vec{Y}_h),c_p\right) = \mathcal{B}^3(r_h),  \\
        \mathcal{S}^C\left(\vec{u}_h,Y_i, s_{\alpha h}, \rho\right) + \frac{1}{\text{Re}~\text{Pr}~\text{Le}\alpha}\mathcal{S}^D\left(Y_i,s_{\alpha h},\rho\right) + \mathcal{M}^S_\alpha\left(s_{\alpha h},\omega(T_h,\vec{Y}_h )\right) = \mathcal{B}^3(s_{\alpha h}). 
    \end{gather}
\end{subequations}  
\end{document}

我想要得到这样的东西

感谢您的帮助/建议!

答案1

像这样?

在此处输入图片描述

使用包multlined中定义的环境mathtools

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{subequations}
    \begin{gather}
\mathcal{C}\left(\vec{u}_h,q_h, \rho\right)  
    = \mathcal{B}^1(q_h),\label{DiscretizedConti} \\
\begin{multlined}[0.7\linewidth]
\mathcal{U}^C\left(\vec{u}_h,\vec{u}_h,\vec{v}_h, \rho\right) +
    \mathcal{U}^P\left(p_h,\vec{v}_h\right) +    \\ 
\frac{1}{\text{Re}}\mathcal{U}^D\left(\vec{u}_h,\vec{v}_h,\mu\right) + 
    \frac{1}{\text{Fr}^2}\mathcal{U}^S\left(\rho, \vec{v}_h\right) = \mathcal{B}^2(\vec{v}_h),
\end{multlined} \\
\begin{multlined}[0.7\linewidth]
\mathcal{S}^C\left(\vec{u}_h,T_h,r_h, \rho\right) + 
    \frac{1}{\text{Re}~\Pr}\mathcal{S}^D\left(T_h,r_h,k/c_p(T_h)\right) + \\
\text{H}~\mathbf{Da} ~ \mathcal{S}^S\left(r_h, Q(T_h,\vec{Y}_h), \omega(T_h,\vec{Y}_h),c_p\right)
    = \mathcal{B}^3(r_h),  
\end{multlined} \\
\begin{multlined}[0.7\linewidth]
\mathcal{S}^C\left(\vec{u}_h,Y_i, s_{\alpha h}, \rho\right) + 
    \frac{1}{\mathrm{Re}~\Pr ~\mathrm{Le}\alpha}\mathcal{S}^D\left(Y_i,s_{\alpha h},\rho\right) +\\
\mathcal{M}^S_\alpha\left(s_{\alpha h},\omega(T_h,\vec{Y}_h )\right) 
     = \mathcal{B}^3(s_{\alpha h}).
\end{multlined} 
    \end{gather}
\end{subequations}
\end{document}

答案2

如何翻转等式的左侧和右侧,以便这些\mathcal{B}项出现在每个等式的开头而不是结尾?进行此更改将允许使用环境,使其看起来更自然align

在此处输入图片描述

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

\begin{subequations}
\begin{align}
\mathcal{B}^1(q_h)
&= \mathcal{C}(\vec{u}_h,q_h, \rho) \,, \label{DiscretizedConti} \\[1ex]
\mathcal{B}^2(\vec{v}_h)
&= \mathcal{U}^C(\vec{u}_h,\vec{u}_h,\vec{v}_h, \rho) + \mathcal{U}^P(p_h,\vec{v}_h) 
  + \frac{1}{\mathrm{Re}}\mathcal{U}^D(\vec{u}_h,\vec{v}_h,\mu) \notag \\
&\quad + \smash{\frac{1}{\mathrm{Fr}^2}}\,\mathcal{U}^S(\rho, \vec{v}_h) \,,  \\[1ex]
\mathcal{B}^3(r_h)
&= \mathcal{S}^C(\vec{u}_h,T_h,r_h, \rho) 
  + \frac{1}{\mathrm{Re}\,\mathrm{Pr}}\mathcal{S}^D\bigl(T_h,r_h,k/c_p(T_h)\bigr) \notag\\
&\quad + \mathrm{H}\,\mathbf{Da} \,\mathcal{S}^S \bigl(r_h, Q(T_h,\vec{Y}_h), 
 \omega(T_h,\vec{Y}_h),c_p\bigr) \,,  \\[1ex]
\mathcal{B}^3(s_{\alpha h})
&=\mathcal{S}^C(\vec{u}_h,Y_i, s_{\alpha h}, \rho) 
  + \frac{1}{\mathrm{Re}\,\mathrm{Pr}\,\mathrm{Le}\,\alpha}
  \mathcal{S}^D(Y_i,s_{\alpha h},\rho) \notag \\
&\quad + \mathcal{M}^S_\alpha \bigl(s_{\alpha h},\omega(T_h,\vec{Y}_h ) \bigr) \,. 
\end{align}
\end{subequations}  

\end{document}

请注意,我已删除所有 11 个对\left\right大小指令。它们似乎没有做任何有用的事情,但它们确实造成了大量的代码混乱。

相关内容