LaTeX 错误:错误的数学环境分隔符

LaTeX 错误:错误的数学环境分隔符

这是我的等式:

\begin{equation}
H(p)=-p\log(p)-(1-p)\log(1-p) 
\end{equation}

这是错误:

Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
! Missing \endgroup inserted.
<inserted text>
 \endgroup
l.319 \end{equation}

I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
Overfull \hbox (17.77782pt too wide) detected at line 319
 []
[]
Overfull \hbox (514.90825pt too wide) in paragraph at lines 316--319
[]\OT1/cmr/m/n/10 where $\OML/cmm/m/it/10
^^Misahyperparameterrangingbetween\OT
1/cmr/m/n/10 0\OML/cmm/m/it/10 and\OT1/cmr/m/n/10 1\OML/cmm/m/it/10
:$\OT1/cmr/
m/it/10 H(p)$\OML/cmm/m/it/10
denotestheShannonentropyand$\OT1/cmr/m/it/10 p$\O
ML/cmm/m/it/10 istheoutputofEncoder;
whichisthepropensityscore:$\OT1/cmr/m/it/1
0 H(p)$\OML/cmm/m/it/10 isrepresentedbythefollowingequation
\OT1/cmr/m/n/10 : [
]\OML/cmm/m/it/10 H\OT1/cmr/m/n/10 (\OML/cmm/m/it/10 p\OT1/cmr/m/n/10 ) =
[]

这是等式之前的文字:

\begin{equation}
\text{Dropout Probability}(x)=1-\frac{\gamma}{2}-\frac{1}{2} H(\hat{p}(x,t))
\end{equation}

where \textit{\gamma} is a hyperparameter ranging between 0 and 1. 
$H(p)$ denotes the Shannon entropy and $p$ is the output of 
Encoder, which is the propensity score. $H(p)$ is represented 
by the following equation:
\begin{equation}
H(p)=-p\log(p)-(1-p)\log(1-p) 
\end{equation}

答案1

显示的错误

! Missing \endgroup inserted.
<inserted text>
 \endgroup
l.319 \end{equation}

是不寻常的,但表明数学作用域可能没有正确顺序。应该在之前的错误中.log——总是检查日志文件,并按错误出现的顺序处理错误。为了帮助这里的帮助者,需要更多信息,最好是一个产生错误的小而可编译的示例。

幸运的是,等式前面的段落包含了错误来源—— \textit{gamma}。由于\gamma是纯数学,因此需要将其括在内$...$以指示数学表达式。这将在日志中产生更易于理解的错误消息,并且进行一次更正即可解决问题。

我要关闭这个问题,并提供这个答案只是因为报告的错误信息是不寻常的。

相关内容