左对齐和右对齐的长等式

左对齐和右对齐的长等式

大家好,

我有下面的等式,如果写在一行中,第一个等式会超出我的范围。所以我想让它出现在两行中,第一行在左侧对齐,第二行在右侧对齐。这是一种好的做法吗?或者我必须用其他方式来表达,尤其是数学家接受的方式。

这是我的 latex 命令的输出

\documentclass{report}
\usepackage{amssymb,amsmath}

\begin{document}

\begin{eqnarray}\nonumber
\mathbf{c}_m^t(b_0\mathbf{I}_m +b_{1}\mathbf{Q}_{m}+b_{2}\mathbf{Q}^2_{m}+\cdots +b_n \mathbf{Q}_m^n)\mathbf{H}_m=&\\ \label{panjang}
=\mathbf{eQ}_m^{\alpha}(a_0 \mathbf{I}_m^{}+a_1\mathbf{Q}_m+a_2\mathbf{Q}_m^{2}+\cdots+a_n\mathbf{Q}_m^{n})\mathbf{H}_m
\end{eqnarray}
where \(\mathbf{e}=\begin{bmatrix}\sqrt{m} & 0 & \cdots & 0\end{bmatrix}\). Rewrite Eqn. \ref{panjang} with
\begin{eqnarray}g_1(\mathbf{Q}_{m})=a_0 \mathbf{I}_m+a_1\mathbf{Q}_m^{}+a_2\mathbf{Q}_m^{2}+\cdots+a_n\mathbf{Q}_m^{ n}\end{eqnarray} 
and 
\begin{eqnarray}
g_2(\mathbf{Q}_{m})=b_0\mathbf{I}_m +b_{1}\mathbf{Q}_{m}+b_{2}\mathbf{Q}^2_{m}+\cdots +b_n \mathbf{Q}_m^n\end{eqnarray} it becomes
\begin{eqnarray}
\mathbf{c}_m^t g_{2}(\mathbf{Q}_{m})&=&
\mathbf{e}\mathbf{Q}_m^\alpha g_1(\mathbf{Q}_{m}).
\end{eqnarray}

\end{document}

答案1

eqnarray我肯定会用一个环境替换第一个multline环境,正如@canaaerus 在他的回答中所建议的那样。

此外,我还将第二和第三个eqnarray环境替换为单身的 align环境(用宏and插入单词\shortintertext),我会eqnarray用简单环境替换最终环境equation。基本上,没有理由使用eqnarray,尤其是当可用的替代方案要好得多的时候。

此外,我会创建一个宏,将经常出现的缩写\mathbf{Q}为更短的,例如,,\Q即我设置了宏。最后,如果您想在交叉引用的方程编号周围放置括号,您可以使用(而不是)\newcommand{\Q}{\mathbf{Q}}让 LaTeX 自动为您执行此操作。\eqref\ref

综合起来,修改后的 MWE 结果如下:

\documentclass{report}
\usepackage{mathtools}
\numberwithin{equation}{chapter} % just for the MWE
\newcommand{\Q}{\mathbf{Q}}
\begin{document}
\setcounter{chapter}{5} % just for the MWE
\setcounter{equation}{19} % just for the MWE
\begin{multline}\label{panjang}
\mathbf{c}_m^t(b_0\mathbf{I}_m +b_{1}\Q_{m}+b_{2}\Q^2_{m}+\dots +b_n \Q_m^n)\mathbf{H}_m\\ 
=\mathbf{eQ}_m^{\alpha}(a_0 \mathbf{I}_m^{}+a_1\Q_m+a_2\Q_m^{2}+\dots+a_n\Q_m^{n})\mathbf{H}_m
\end{multline}
where \(\mathbf{e}=
\begin{bmatrix}\sqrt{m} & 0 & \dots & 0\end{bmatrix}\). Rewrite Eqn.~\eqref{panjang} with
\begin{align}g_1(\Q_{m})&=a_0 \mathbf{I}_m+a_1\Q_m^{}+a_2\Q_m^{2}+\dots+a_n\Q_m^{ n}
\shortintertext{and}
g_2(\Q_{m})&=b_0\mathbf{I}_m +b_{1}\Q_{m}+b_{2}\Q^2_{m}+\dots +b_n \Q_m^n
\end{align} 
so that it becomes
\begin{equation}
\mathbf{c}_m^t g_{2}(\Q_{m}) =
\mathbf{e}\Q_m^\alpha g_1(\Q_{m}).
\end{equation}
\end{document}

在此处输入图片描述

答案2

例如在TeX 常见问题解答eqnarray不鼓励使用。

为了实现所需的布局,您可以使用例如multline来自的环境amsmath。还可以做什么,例如在LaTeX 数学简明指南。我不会=在第一行末尾放一个。但除此之外,我认为在这种情况下,您的方法是最好的方法。

相关内容