我有七个不同的方程式,我想将它们左对齐。
下面是我用来对齐方程的代码:
\begin{equation}
\phi_{1} \; = \; n_{20} + n_{02}
\end{equation}
\begin{equation}
\phi_{2} \; = \; (n_{20} - n_{02})^2 + 4n_{11}^2
\end{equation}
\begin{equation}
\phi_{3} \; = \; n_{30} - n_{12}^2 + 3n_{21} - n_{03}^2
\end{equation}
\begin{equation}
\phi_{4} \; = \; n_{30} + n_{12}^2 + 3n_{21} + n_{03}^2
\end{equation}
\begin{multline}
\phi_{5} \; = \; (n_{30} - 3n_{12})(n_{30} + n_{12})[(n_{30} + n_{12}^2) -3(n_{30} + n_{12})^2] + (3n_{12} - n_{03})(n_{21} + n_{03})[3(n_{30} + n_ {12})^2 - (n_{21} + n_{03})^2]
\end{multline}
\begin{equation}
\phi_{6} \; = \; (n_{20} - n_{02})[(n_{30} + n_{12}^2) - (n_{21} + n_{03})^2] + 4n_{11}(n_{30} + n_{12})(n_{21} + n_{03})
\end{equation}
\begin{equation}
\phi_{7} \; = \; (3n_{21} - n_{03})(n_{30} + n_{12})[(n_{30} + n_{12})^2 - 3(n_{21} + n_{03})^2] + (3n_{12} - n_{30})(n_{21} + n_{03})[3(n_{30} + n_{12})^2 - (n_{21} + n_{03}^2)]
\end{equation}
我希望方程式左对齐并在每一行上均匀分布,也就是说,如果方程式太长,它应该转到下一行。
答案1
单一align
环境似乎是正确的,另外还有方程式 5、6 和 7 的额外换行符;这些方程式的后半部分\quad
相对于前半部分缩进(缩进量为)。请注意,我对符号进行了对齐=
,而不是完全左对齐。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\phi_{1} &= n_{20} + n_{02}\\
\phi_{2} &= (n_{20} - n_{02})^2 + 4n_{11}^2\\
\phi_{3} &= n_{30} - n_{12}^2 + 3n_{21} - n_{03}^2\\
\phi_{4} &= n_{30} + n_{12}^2 + 3n_{21} + n_{03}^2\\
\phi_{5} &= (n_{30} - 3n_{12})(n_{30} + n_{12})[(n_{30} + n_{12}^2) -3(n_{30} + n_{12})^2] \notag\\
&\quad+ (3n_{12} - n_{03})(n_{21} + n_{03})[3(n_{30} + n_ {12})^2 - (n_{21} + n_{03})^2]\\
\phi_{6} &= (n_{20} - n_{02})[(n_{30} + n_{12}^2) - (n_{21} + n_{03})^2] \notag\\
&\quad+ 4n_{11}(n_{30} + n_{12})(n_{21} + n_{03})\\
\phi_{7} &= (3n_{21} - n_{03})(n_{30} + n_{12})[(n_{30} + n_{12})^2 - 3(n_{21} + n_{03})^2] \notag\\
&\quad+ (3n_{12} - n_{30})(n_{21} + n_{03})[3(n_{30} + n_{12})^2 - (n_{21} + n_{03}^2)]
\end{align}
\end{document}
答案2
您可以使用align
和split
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\phi_{1} &= n_{20} + n_{02}
\\
\phi_{2} &= (n_{20} - n_{02})^2 + 4n_{11}^2
\\
\phi_{3} &= n_{30} - n_{12}^2 + 3n_{21} - n_{03}^2
\\
\phi_{4} &= n_{30} + n_{12}^2 + 3n_{21} + n_{03}^2
\\
\begin{split}
\phi_{5} &= (n_{30} - 3n_{12})(n_{30} + n_{12})[(n_{30} + n_{12}^2) -3(n_{30} + n_{12})^2] \\
&\qquad+ (3n_{12} - n_{03})(n_{21} + n_{03})[3(n_{30} + n_ {12})^2 - (n_{21} + n_{03})^2]
\end{split}
\\
\begin{split}
\phi_{6} &= (n_{20} - n_{02})[(n_{30} + n_{12}^2) - (n_{21} + n_{03})^2] \\
&\qquad+ 4n_{11}(n_{30} + n_{12})(n_{21} + n_{03})
\end{split}
\\
\begin{split}
\phi_{7} &= (3n_{21} - n_{03})(n_{30} + n_{12})[(n_{30} + n_{12})^2 - 3(n_{21} + n_{03})^2] \\
&\qquad+ (3n_{12} - n_{30})(n_{21} + n_{03})[3(n_{30} + n_{12})^2 - (n_{21} + n_{03}^2)]
\end{split}
\end{align}
\end{document}
align
与有什么区别\notag
? a 中的方程编号split
垂直居中(除非tbtags
将选项传递给amsmath
)。