如何在双列文档中使用对齐?

如何在双列文档中使用对齐?

我想用双列格式来写这个方程。我该怎么做?

我使用这个代码:

\documentclass[lettersize,journal]{IEEEtran}


\begin{align}
\bar{u}_{x_-} &= \frac{1}{M_r}\sum_{i=1}^{M_r} u_{x_-}^{(i)} = \frac{1}{M_r}\sum_{i=1}^{M_r}\frac{|x_{i,1}-x_{i,2}|}{(t_{i,1}-t_{i,2})}, \ \text{Cluster-1  (-x  direction)}\\
\bar{u}_{x_+} &= \frac{1}{M_r}\sum_{i=1}^{M_r} u_{x_+}^{(i)} = \frac{1}{M_r}\sum_{i=1}^{M_r}\frac{|x_{i,5}-x_{i,4}|}{(t_{i,5}-t_{i,4})},\ \text{Cluster-3 (+x  direction)}\\
\bar{u}_{y_+} &= \frac{1}{M_c}\sum_{j=1}^{M_c} u_{y_+}^{(j)} = \frac{1}{M_c}\sum_{j=1}^{M_c}\frac{|y_{5,j}-y_{4,j}|}{(t_{5,j}-t_{4,j})},\ \text{Cluster-2  (+y  direction)}\\
\bar{u}_{y_-} &= \frac{1}{M_c}\sum_{j=1}^{M_c} u_{y_-}^{(j)} = \frac{1}{M_c}\sum_{j=1}^{M_c}\frac{|y_{1,j}-y_{2,j}|}{(t_{1,j}-t_{2,j})}, \text{ Cluster-4  (-y  direction)}

\end{align}

答案1

使用不同的格式:

\documentclass[letterpaper,journal]{IEEEtran}
\usepackage{amsmath,mathtools}

\usepackage{lipsum} % for mock text

\begin{document}

\lipsum*[1][1-4]
\begin{align}
\shortintertext{Cluster-1 ($-x$ direction)}
\bar{u}_{x_-} &= \frac{1}{M_r}\sum_{i=1}^{M_r} u_{x_-}^{(i)} =
  \frac{1}{M_r}\sum_{i=1}^{M_r}\frac{|x_{i,1}-x_{i,2}|}{(t_{i,1}-t_{i,2})}, \\[1ex]
\shortintertext{Cluster-3 ($+x$ direction)}
\bar{u}_{x_+} &= \frac{1}{M_r}\sum_{i=1}^{M_r} u_{x_+}^{(i)} =
  \frac{1}{M_r}\sum_{i=1}^{M_r}\frac{|x_{i,5}-x_{i,4}|}{(t_{i,5}-t_{i,4})}, \\[1ex]
\shortintertext{Cluster-2 ($+y$ direction)}
\bar{u}_{y_+} &= \frac{1}{M_c}\sum_{j=1}^{M_c} u_{y_+}^{(j)} =
  \frac{1}{M_c}\sum_{j=1}^{M_c}\frac{|y_{5,j}-y_{4,j}|}{(t_{5,j}-t_{4,j})}, \\[1ex]
\shortintertext{Cluster-4 ($-y$ direction)}
\bar{u}_{y_-} &= \frac{1}{M_c}\sum_{j=1}^{M_c} u_{y_-}^{(j)} =
  \frac{1}{M_c}\sum_{j=1}^{M_c}\frac{|y_{1,j}-y_{2,j}|}{(t_{1,j}-t_{2,j})},
\end{align}
\lipsum

\end{document}

在此处输入图片描述

请注意,选项是letterpaper,而不是lettersize

像往常一样,当我处理时IEEEtran,我在添加后显示输出

\usepackage{newtxtext,newtxmath}

在此处输入图片描述

答案2

这是一个总体上与以下答案非常相似的答案@egreg 的回答-- 例如,它还使用了mathtools包及其\shortintertext宏,还建议加载newtxtextnewtxmath字体包。主要区别在于使用alignat{2}环境而不是align环境,以便对两个都符号列=

在此处输入图片描述

\documentclass[letterpaper,journal]{IEEEtran}
\usepackage{mathtools}
\usepackage{newtxtext,newtxmath} % optional

\begin{document}
\hrule % just to illustrate width of text block
\begin{alignat}{2}
\shortintertext{Cluster 1: $-x$ direction}
\bar{u}_{x_-} 
  &=  \frac{1}{M_r}\sum_{i=1}^{M_r} u_{x_-}^{(i)} 
  &&= \frac{1}{M_r}\sum_{i=1}^{M_r}\frac{|x_{i,1}-x_{i,2}|}{(t_{i,1}-t_{i,2})}\,,\\[2ex]
\shortintertext{Cluster 3: $+x$ direction}
\bar{u}_{x_+} 
  &=  \frac{1}{M_r}\sum_{i=1}^{M_r} u_{x_+}^{(i)} 
  &&= \frac{1}{M_r}\sum_{i=1}^{M_r}\frac{|x_{i,5}-x_{i,4}|}{(t_{i,5}-t_{i,4})}\,,\\[2ex]
\shortintertext{Cluster 2: $+y$ direction}
\bar{u}_{y_+} 
  &=  \frac{1}{M_c}\sum_{j=1}^{M_c} u_{y_+}^{(j)} 
  &&= \frac{1}{M_c}\sum_{j=1}^{M_c}\frac{|y_{5,j}-y_{4,j}|}{(t_{5,j}-t_{4,j})}\,,\\[2ex]
\shortintertext{Cluster 4: $-y$ direction}
\bar{u}_{y_-} 
  &=  \frac{1}{M_c}\sum_{j=1}^{M_c} u_{y_-}^{(j)} 
  &&= \frac{1}{M_c}\sum_{j=1}^{M_c}\frac{|y_{1,j}-y_{2,j}|}{(t_{1,j}-t_{2,j})}\,.
\end{alignat}
\hrule % just to illustrate width of text block
\end{document}

相关内容