使用 eqnarray* 对方程进行编号

使用 eqnarray* 对方程进行编号

我正在使用 eqnarray 来编写长方程式。但是当我使用它而不是方程式环境时,方程式没有编号。有人能帮我解决这个问题吗?

这是我正在使用的语法。

\begin{eqnarray*} 
f_{lin}(z) & = &  f(z_{0}) + 
\frac{\partial f(z)}{\partial \ddot{\theta}}\bigg|_{z = z_{0}}\ddot{\theta} + 
\frac{\partial f(z)}{\partial \ddot{\alpha}}\bigg |_{z = z_{0}}\ddot{\alpha} + 
\frac{\partial f(z)}{\partial \dot{\theta}}\bigg |_{z = z_{0}}\dot{\theta} \\
& &  + \frac{\partial f(z)}{\partial \dot{\alpha}}\bigg |_{z = z_{0}}\dot{\alpha} + 
\frac{\partial f(z)}{\partial \theta}\bigg |_{z = z_{0}}\theta + 
\frac{\partial f(z)}{\partial \alpha}\bigg |_{z = z_{0}}\alpha
\end{eqnarray*}

答案1

除了建议您使用环境align(由包提供amsmath)而不是环境之外eqnarray*,我还建议您将每行的第一个+符号而不是符号设为对齐点=;这样,方程的结构就会变得非常明显。而且,由于字符串\bigg|_{z = z_{0}}出现次数不少于六次,因此为其创建快捷宏很方便。

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath} % provides the "align" environment
\newcommand\atz{\bigg\vert_{z=z_0}\!} % a shortcut macro
\begin{document}
\begin{align} 
f_{\textit{lin}}(z) =  f(z_{0}) 
&+ 
\frac{\partial f(z)}{\partial \ddot{\theta}}\atz \ddot{\theta} + 
\frac{\partial f(z)}{\partial \ddot{\alpha}}\atz \ddot{\alpha} + 
\frac{\partial f(z)}{\partial \dot{\theta}}\atz \dot{\theta} \notag \\ 
&+ \frac{\partial f(z)}{\partial \dot{\alpha}}\atz \dot{\alpha} + 
\frac{\partial f(z)}{\partial \theta}\atz \theta + 
\frac{\partial f(z)}{\partial \alpha}\atz \alpha
\end{align}
\end{document}

如果您不想使用环境align,那么您可以使用环境split中的环境equation;主要区别在于,在行的垂直方向上有一个居中的方程编号equation

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath}
\newcommand\atz{\bigg\vert_{z=z_0}\!} % a shortcut macro
\begin{document}
\begin{equation}
\begin{split} 
f_{\textit{lin}}(z) =  f(z_{0}) 
&+ 
\frac{\partial f(z)}{\partial \ddot{\theta}}\atz \ddot{\theta} + 
\frac{\partial f(z)}{\partial \ddot{\alpha}}\atz \ddot{\alpha} + 
\frac{\partial f(z)}{\partial \dot{\theta}}\atz \dot{\theta} \\[1ex] % some additional vertical separation
&+ \frac{\partial f(z)}{\partial \dot{\alpha}}\atz \dot{\alpha} + 
\frac{\partial f(z)}{\partial \theta}\atz \theta + 
\frac{\partial f(z)}{\partial \alpha}\atz \alpha
\end{split}
\end{equation}
\end{document}

答案2

加载包amsmath然后使用:

\begin{align} 
f_{lin}(z) & =  f(z_{0}) + 
  \frac{\partial f(z)}{\partial \ddot{\theta}}\bigg|_{z = z_{0}}\ddot{\theta} + 
  \frac{\partial f(z)}{\partial \ddot{\alpha}}\bigg |_{z = z_{0}}\ddot{\alpha} + 
  \frac{\partial f(z)}{\partial \dot{\theta}}\bigg |_{z = z_{0}}\dot{\theta} \\\nonumber
& \quad  + \frac{\partial f(z)}{\partial \dot{\alpha}}\bigg |_{z = z_{0}}\dot{\alpha} + 
  \frac{\partial f(z)}{\partial \theta}\bigg |_{z = z_{0}}\theta + 
  \frac{\partial f(z)}{\partial \alpha}\bigg |_{z = z_{0}}\alpha
\end{align}

相关内容