偏微分方程系统中的项对齐

偏微分方程系统中的项对齐

我正在尝试更好地对齐这个 PDE 系统内的项。我也尝试过使用数组,但没有得到好的结果。提前致谢


\begin{align}
    &\frac{\partial\mathbf{e}_1}{\partial\alpha_1} = &   
                                                     & -\frac{1}{A_2}\frac{\partial{A_1}}{\partial\alpha_2}\mathbf{e}_2  
                                                     & -\frac{A_1}{R_1}\mathbf{e}_n
            \label{4.18a} \\
    &\frac{\partial\mathbf{e}_1}{\partial\alpha_2} = &   
                                                     & \;\frac{1}{A_1}\frac{\partial{A_2}}{\partial\alpha_1}\mathbf{e}_2 
                                                     & 
            \label{4.18b} \\
    &\frac{\partial\mathbf{e}_2}{\partial\alpha_1} = & \frac{1}{A_2}\frac{\partial{A_1}}{\partial\alpha_2}\mathbf{e}_1 
                                                     &  
                                                     &
            \label{4.18c} \\
    &\frac{\partial\mathbf{e}_2}{\partial\alpha_2} = & -\frac{1}{A_1}\frac{\partial{A_2}}{\partial\alpha_1}\mathbf{e}_1 
                                                     &  
                                                     & -\frac{A_2}{R_2}\mathbf{e}_n 
            \label{4.18d} \\
    &\frac{\partial\mathbf{e}_n}{\partial\alpha_1} = & \frac{A_1}{R_1}\mathbf{e}_1 
                                                     & 
                                                     & 
            \label{4.18e}\\
    &\frac{\partial\mathbf{e}_n}{\partial\alpha_2} = & 
                                                     & \frac{A_2}{R_2}\mathbf{e}_2
                                                     & 
            \label{4.18f}
\end{align}

答案1

我会将align其改为alignat{n}。它的工作方式与 相同,align但会删除用 分隔的列之间的额外间距&array也可以。但是,它不接受多个标签。

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{alignat}{4} 
  \frac{\partial\mathbf{e}_1}{\partial\alpha_1}
  &={}
  &
  && {}-\frac{1}{A_2} \frac{\partial{A_1}}{\partial\alpha_2} \mathbf{e}_2
  && {}-\frac{A_1}{R_1}\mathbf{e}_n \label{4.18a} \\
  \frac{\partial\mathbf{e}_1}{\partial\alpha_2}
  &={}
  &
  && \frac{1}{A_1} \frac{\partial{A_2}}{\partial\alpha_1} \mathbf{e}_2
  && \label{4.18b} \\
  \frac{\partial\mathbf{e}_2}{\partial\alpha_1}
  &={}
  &\frac{1}{A_2}\frac{\partial{A_1}}{\partial\alpha_2} \mathbf{e}_1
  &&
  && \label{4.18c} \\
  \frac{\partial\mathbf{e}_2}{\partial\alpha_2}
  &={}
  &-\frac{1}{A_1}\frac{\partial{A_2}}{\partial\alpha_1} \mathbf{e}_1
  &&
  && {}-\frac{A_2}{R_2} \mathbf{e}_n \label{4.18d} \\
  \frac{\partial\mathbf{e}_n}{\partial\alpha_1}
  &={}
  &\frac{A_1}{R_1}\mathbf{e}_1
  && && \label{4.18e} \\
  \frac{\partial\mathbf{e}_n}{\partial\alpha_2}
  &={}
  &
  && \frac{A_2}{R_2}\mathbf{e}_2
  && \label{4.18f}
\end{alignat}
\end{document}

这是基于的解决方案的 sbippet array

\begin{equation}
  \everymath={\displaystyle}
  \setlength\arraycolsep{0.16em}
  \begin{array}{r c r r r}
    \frac{\partial\mathbf{e}_1}{\partial\alpha_1} &=&
      & {}-\frac{1}{A_2} \frac{\partial{A_1}}{\partial\alpha_2} \mathbf{e}_2
      & {}-\frac{A_1}{R_1}\mathbf{e}_n \\
    \frac{\partial\mathbf{e}_1}{\partial\alpha_2} &=&
      & \frac{1}{A_1} \frac{\partial{A_2}}{\partial\alpha_1} \mathbf{e}_2 \\
    \frac{\partial\mathbf{e}_2}{\partial\alpha_1} &=&
      \frac{1}{A_2}\frac{\partial{A_1}}{\partial\alpha_2} \mathbf{e}_1 & & \\
    \frac{\partial\mathbf{e}_2}{\partial\alpha_2} &=&
      -\frac{1}{A_1}\frac{\partial{A_2}}{\partial\alpha_1} \mathbf{e}_1
      & & {}-\frac{A_2}{R_2} \mathbf{e}_n \\
    \frac{\partial\mathbf{e}_n}{\partial\alpha_1} &=&
      \frac{A_1}{R_1}\mathbf{e}_1 & & \\
    \frac{\partial\mathbf{e}_n}{\partial\alpha_2} &=&
      & \frac{A_2}{R_2}\mathbf{e}_2 &
  \end{array}
  \label{4.18}
\end{equation}

答案2

对齐点应位于\mathbf{e}alignat应被使用。

在第二种实现中,在n学期。

\documentclass{article}
\usepackage{amsmath}

\newcommand{\pder}[2]{\frac{\partial#1}{\partial#2}}

\begin{document}

\begin{alignat}{4}
  \pder{\mathbf{e}_1}{\alpha_1} &={}&
  &&
  -\frac{1}{A_2}\pder{A_1}{\alpha_2}&\mathbf{e}_2
  &{}% <--- next - is an operation symbol
  -\frac{A_1}{R_1}&\mathbf{e}_n
\label{4.18a} \\
  \pder{\mathbf{e}_1}{\alpha_2} &={}&
  &&
  \frac{1}{A_1}\pder{A_2}{\alpha_1}&\mathbf{e}_2 
\label{4.18b} \\
  \pder{\mathbf{e}_2}{\alpha_1} &={}&
  \frac{1}{A_2}\pder{A_1}{\alpha_2}&\mathbf{e}_1 
\label{4.18c} \\
  \pder{\mathbf{e}_2}{\alpha_2} &={}&
  -\frac{1}{A_1}\pder{A_2}{\alpha_1}&\mathbf{e}_1 
  &&
  &{}% <--- next - is an operation symbol
  -\frac{A_2}{R_2}&\mathbf{e}_n 
\label{4.18d} \\
  \pder{\mathbf{e}_n}{\alpha_1} &={}&
  \frac{A_1}{R_1}&\mathbf{e}_1 
\label{4.18e}\\
  \pder{\mathbf{e}_n}{\alpha_2} &={}&
  &&
  \frac{A_2}{R_2}&\mathbf{e}_2
\label{4.18f}
\end{alignat}

\begin{alignat}{4}
  \pder{\mathbf{e}_1}{\alpha_1} &={}&
  &&
  -\frac{1}{A_2}\pder{A_1}{\alpha_2}&\mathbf{e}_2
  &\qquad{}% <--- next - is an operation symbol
  -\frac{A_1}{R_1}&\mathbf{e}_n
\label{foo:a} \\
  \pder{\mathbf{e}_1}{\alpha_2} &={}&
  &&
  \frac{1}{A_1}\pder{A_2}{\alpha_1}&\mathbf{e}_2 
\label{foo:b} \\
  \pder{\mathbf{e}_2}{\alpha_1} &={}&
  \frac{1}{A_2}\pder{A_1}{\alpha_2}&\mathbf{e}_1 
\label{foo:c} \\
  \pder{\mathbf{e}_2}{\alpha_2} &={}&
  -\frac{1}{A_1}\pder{A_2}{\alpha_1}&\mathbf{e}_1 
  &&
  &\qquad{}% <--- next - is an operation symbol
  -\frac{A_2}{R_2}&\mathbf{e}_n 
\label{foo:d} \\
  \pder{\mathbf{e}_n}{\alpha_1} &={}&
  \frac{A_1}{R_1}&\mathbf{e}_1 
\label{foo:e}\\
  \pder{\mathbf{e}_n}{\alpha_2} &={}&
  &&
  \frac{A_2}{R_2}&\mathbf{e}_2
\label{foo:f}
\end{alignat}

\end{document}

在此处输入图片描述

相关内容