LaTeX数学公式编辑(2)——跨页公式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/beta_2187/article/details/81263608

1. 引言

写小论文和毕业论文的过程中, 难免会出现较长的公式. 如果运气好, 这个公式刚好在一页之内, 对排版没有影响; 如果这个公式恰好是上一页放不下, 放到下一页的话, 上一页又空一大片, 这样就很不美观了.
在LaTeX中, \begin{equation}...\end{equation}命令是不允许跨页的, 这时\begin{align}...\end{align}就是一个最好的选择了. 同时, 需要在导言区加上命令\allowdisplaybreaks[4]. 括号中的参数可为1,2,3,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. 说明

对于跨页公式, 也许有更好的办法来处理.

猜你喜欢

转载自blog.csdn.net/beta_2187/article/details/81263608