![方程式标题中的控制序列未定义](https://linux22.com/image/443862/%E6%96%B9%E7%A8%8B%E5%BC%8F%E6%A0%87%E9%A2%98%E4%B8%AD%E7%9A%84%E6%8E%A7%E5%88%B6%E5%BA%8F%E5%88%97%E6%9C%AA%E5%AE%9A%E4%B9%89.png)
\begin{equation}
\centering \Large \textbf{$\lambda_{c} = \frac{18.64}{B \times E^{2} }$ }
\label{eq1:Critical wavelength}
\end{equation}
\begin{center}
\captionof
{equation}{where B is the bending magnet magnetic field ( B = 1T ) , E is the energy of the booster}
\end{center}
答案1
从片段制作测试文档
\documentclass{article}
\begin{document}
\begin{equation}
\centering \Large \textbf{$\lambda_{c} = \frac{18.64}{B \times E^{2} }$ }
\label{eq1:Critical wavelength}
\end{equation}
\begin{center}
\captionof
{equation}{where B is the bending magnet magnetic field ( B = 1T ) , E is the energy of the booster}
\end{center}
\end{document}
产生错误
! Missing $ inserted.
<inserted text>
$
l.6
?
因为数学模式不允许有空行。
删除空白行
LaTeX Font Warning: Command \Large invalid in math mode on input line 6.
所以删除\Large
你得到
! Undefined control sequence.
l.10 \captionof
按照或包\captionof
的定义,但添加caption
capt-of
\usepackage{capt-of}
定义\captionof
命令,但由于方程式字幕未设置,因此您得到
! Undefined control sequence.
<write> \@writefile{\ext@equation
}{\protect \contentsline {equation}{\prote...
l.14 \end{document}
?
由于方程式已经有方程式编号,因此很难猜测您希望单独编号的标题采用什么格式,因此我建议删除它。此外,\centering
和\textbf
在此上下文中没有执行任何操作,因此我认为您想要:
\documentclass{article}
\begin{document}
Some text
\begin{equation}
\lambda_{c} = \frac{18.64}{B \times E^{2} }
\label{eq1:Critical wavelength}
\end{equation}
where $B$ is the bending magnet magnetic field ($B = 1T$),
$E$ is the energy of the booster.
\end{document}