【转载请注明出处】http://www.cnblogs.com/mashiqi
2016/10/20
一年多没写博文了。今天写一个短的,记录一下使用LaTeX的一些经验。
有些时候,我们的latex文档是这样开头的
\documentclass[fleqn,leqno]{article}
其中 leqno 参数的作用是使得公式的编号显示在左边。当参数 fleqn 存在时,公式往往不能正确的居中。这时,我们就需要特别小心的使用equation、align、flalign、alignat等命令。下面详细讲讲。
1、多行公式在一个地方对齐
如何居中多行的公式呢?我试过很多种方法后,觉得下面这个最好用:
\begin{flalign*}% In this way (this arrange of &), the equation will in the center and align at the third &. If use this method for 'split', equations will not be centered% However, 'flalign' will give each line a separate number. It cannot number the whole equations in one number.&& a & = b & \\&& a & = b & \\&& a & = b & \\&& a & = b &\end{flalign*}
其中的多个&符号是专门安排好的。只用往第二个和第三个&符号后面添加代码就行了,它们就能对齐 并且所有公式作为一个整体进行