数学模式下 \textbf 出现奇怪的错误

数学模式下 \textbf 出现奇怪的错误
Atomic nuclei are associated with an intrinsic angular momentum called the spin angular momentum $\textbf{J}$. A dimensionless spin angular momentum $\textbf{I}$ is defined as $\textbf{I} = \textbf{J}/\hbar$. The magnitude and direction of $\textbf{I}$ are quantized in the sense that the magnitude of the vector is 
\begin{equation}\label{nmr1}
|\textbf{I}| = \sqrt{I(I + 1)}
\end{equation}
Here $I = 0, \frac{1}{2}, 1, \frac{3}{2},...$. If $\textbf{I} \neq 0$, the nucleus has a magnetic dipole moment $\textbf{\mu} = \gamma\hbar\textbf{I}$. The quantity $\gamma$ is gyromagnetic ratio, which is specific for each nucleus.

The magnetic moment in an external magnetic field experiences a torque $\textbf{N} = \textbf{\mu}\times\textbf{B_0}$ which tends to align the magnetic moment with the external field because it is energetically favorable for the magnetic moment to be in that orientation. The equation of motion for the magnetic moment in an external magnetic field is
\begin{equation}\label{nmr2}
\frac{d\textbf{\mu}}{dt} = -\gamma\textbf{B_0}\times\textbf{\mu}
\end{equation}
Equation \ref{nmr2} describes a vector $\textbf{\mu}$ precessing about the direction of $B_0$ with angular frequency $\omega = -\gamma B_0$. This motion is known as the Larmor precession. The Larmor frequency can be written as 
\begin{equation}\label{nmr3}
\nu = \frac{\omega}{2\pi} = -\frac{\gamma}{2\pi}B_0
\end{equation}

我正在 Overleaf 中编写上述文本。出现此错误:

<inserted text> 
                $
l.545 ...as a magnetic dipole moment $\textbf{\mu}
                                                   = \gamma\hbar\textbf{I}$....
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

! Extra }, or forgotten $.
\textdef@ ...th {#1}\let \f@size #2\selectfont #3}
                                                  }
l.545 ...as a magnetic dipole moment $\textbf{\mu}
                                                   = \gamma\hbar\textbf{I}$....
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

另一个错误是:

\textdef@ ...h {#1}\let \f@size #2\selectfont #3}}
                                                  
l.545 ...as a magnetic dipole moment $\textbf{\mu}
                                                   = \gamma\hbar\textbf{I}$....
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

! Extra }, or forgotten $.
\text@ ...style \ssf@size {\firstchoice@false #1}}
                                                  \check@mathfonts }
l.545 ...as a magnetic dipole moment $\textbf{\mu}
                                                   = \gamma\hbar\textbf{I}$....
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

我没有发现文本中有任何拼写错误。是什么导致了这些错误?

答案1

以下是一些建议(无特定顺序):

  • \textbf{I}分别将和的所有实例替换\textbf{J}\mathbf{I}\mathbf{J}

  • 加载bm包并将 的所有实例替换\textbf{\mu}\bm{\mu}

  • 将所有 替换textbf{B_0}\mathbf{B}_0,即执行不是将下标加粗0

  • 确保加载amsmath包并替换Equation \ref{nmr2}Equation~\eqref{nmr2}

  • 如果您希望将 bold-math 呈现为斜体(或倾斜)而不是直立字母,只需将所有实例替换\mathbf\bm


在此处输入图片描述

\documentclass{article} % or some other suitable document class
\usepackage{amsmath,bm}
\begin{document}

Atomic nuclei are associated with an intrinsic angular momentum 
called the spin angular momentum~$\mathbf{J}$. A dimensionless 
spin angular momentum~$\mathbf{I}$ is defined as 
$\mathbf{I} = \mathbf{J}/\hbar$. The magnitude and direction 
of~$\mathbf{I}$ are quantized in the sense that the magnitude 
of the vector is
\begin{equation}\label{nmr1}
\lvert\mathbf{I}\rvert = \sqrt{I(I + 1)}\,.
\end{equation}
Here $I = 0, 0.5, 1, 1.5,\dotsc$ If $\mathbf{I}\ne 0$, 
the nucleus has a magnetic dipole moment $\bm{\mu} = 
\gamma\hbar\mathbf{I}$. The quantity $\gamma$ is the 
gyromagnetic ratio, which is specific for each nucleus.

The magnetic moment in an external magnetic field experiences 
a torque $\mathbf{N} = \bm{\mu}\times\mathbf{B}_0$ which tends 
to align the magnetic moment with the external field because 
it is energetically favorable for the magnetic moment to be 
in that orientation. The equation of motion for the magnetic 
moment in an external magnetic field is
\begin{equation}\label{nmr2}
\frac{d\bm{\mu}}{dt} = -\gamma\mathbf{B}_0\times\bm{\mu}\,.
\end{equation}
Equation \eqref{nmr2} describes a vector $\bm{\mu}$ precessing 
about the direction of~$\mathbf{B}_0$ with angular frequency 
$\omega = -\gamma \mathbf{B}_0$. This motion is known as the 
Larmor precession. The Larmor frequency can be written as
\begin{equation}\label{nmr3}
\nu = \frac{\omega}{2\pi} = -\frac{\gamma}{2\pi}\mathbf{B}_0\,.
\end{equation}
\end{document}

相关内容