標簽:
【轉載請注明出處】http://www.cnblogs.com/mashiqi
2016/10/20
一年多沒寫博文了。今天寫一個短的,記錄一下使用LaTeX的一些經驗。
如何居中多行的公式呢?我試過很多種方法后,覺得下面這個最好用:
1 \begin{flalign*}2 % 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 centered3 % However, ‘flalign‘ will give each line a separate number. It cannot number the whole equations in one number.4 && a & = b & \5 && a & = b & \6 && a & = b & \7 && a & = b &8 \end{flalign*}
其中的多個&符號是專門安排好的。只用往第二個和第三個&符號后面添加代碼就行了,它們就能對齊 并且所有公式作為一個整體進行居中。但這里有個問題,就是編號的問題。這里沒有公式的編號。如果把flalign后面的*號去掉的話,那么就有編號了,但是是每一行公式一個編號,有些情況下這不太合適。因此,為了編號,我們要對上述代碼做如下更改:
1 \begin{flalign}2 % In this way (this arrange of &), the equation