LaTeX數學公式編輯(2)——跨頁公式
阿新 • • 發佈:2018-11-02
1. 引言
寫小論文和畢業論文的過程中, 難免會出現較長的公式. 如果運氣好, 這個公式剛好在一頁之內, 對排版沒有影響; 如果這個公式恰好是上一頁放不下, 放到下一頁的話, 上一頁又空一大片, 這樣就很不美觀了.
在LaTeX中, \begin{equation}...\end{equation}
命令是不允許跨頁的, 這時\begin{align}...\end{align}
就是一個最好的選擇了. 同時, 需要在導言區加上命令\allowdisplaybreaks[4]
下面兩節給出編號和不編號的示例.
2. 不編號公式
命令
\begin{align*}
\cos 2x = & \cos^2 x - \sin^2 x \\
= & 2\cos^2 x - 1\\
= & 1 - 2\sin^2 x\\
= & \cos^2 x - \sin^2 x \\
= & 2\cos^2 x - 1.
\end{align*}
的執行結果為
3. 編號公式
\begin{align}...\end{align}
中如果沒有加星號, 就會對其中的每一行公式編號, 這常常不是我們想要的. 所以在此我們使用命令\notag
\begin{align}
\cos 2x = & \cos^2 x - \sin^2 x \notag \\
= & 2\cos^2 x - 1 \notag \\
= & 1 - 2\sin^2 x \notag \\
= & \cos^2 x - \sin^2 x \notag \\
= & 2\cos^2 x - 1
\end{align}
中, \notag
阻止了前四行的編號, 只對第5行編號, 執行結果為
4. 說明
對於跨頁公式, 也許有更好的辦法來處理.