每次出现 LaTeX 错误,我都必须删除辅助文件。计数器太大

每次出现 LaTeX 错误,我都必须删除辅助文件。计数器太大

我正在写论文,每次我犯错并导致编译器错误时,LaTeX 都会停止正常工作,直到我删除辅助文件。它给出错误“计数器太大”,如下所示

./chap1.tex:1384: LaTeX Error: Counter too large.

我正在链接主 tex 文件。子 tex 文件有数十万个字符,包含我所有的研究成果,因此我不会提供这些内容。

我的文档包含很多参考文献和脚注,这可能与此有关。

目前,我在运行 LaTeX 的脚本中编写了一个选项,用于查找并保存所有相关的辅助文件,然后运行 ​​LaTeX 两次。我很乐意提供 MWE,但我不知道如何缩小范围以找到原因。

更新:我可以通过把结束括号放在文档中的某个随机位置来引发 LaTeX 错误,从而产生错误。此外,运行 LaTeX 四次后,错误消失。错误总是在同一个地方,按顺序发生(一次运行一个,下一次运行另一个):

chap1.tex 中的第 1384 行,位于段落内,包含两个脚注:

Let $\gls*{hattheta}\in\left(\arcsin\left(\sqrt{\nicefrac{1.86\,}{Rk_j}}\right),\nicefrac{1}{2}\,\arcsin\left(\nicefrac{k_p\,}{k_s}\right)\right)$ \label{thetahatpage} be some fixed angle satisfying both $\mathfrak{e}_{k_R}(\hat{\theta})=0$\footnote{observe \textcolor{red}{how?} that this indicates that $\mathfrak{e}^j_{k_R}(\theta)=0$ for $\theta\in(0,\hat{\theta})$} and $\tan\hat{\theta}<\frac{3k_p^2}{4\pi k_s^2}$.\footnote{observe that this ensures that \eqref{Eupperbound} holds for $\theta\in\left(0,\hat{\theta}\right)$, allowing us to apply the conclusions of Lemma \ref{Dnotlargelemma}.} We will now prove a result that holds in two situations: \textbf{either} (a) case (i), $h=g$, and $\theta\in\left[\hat{\theta},\nicefrac{\pi}{2}\right)$, \textbf{or} (b) case (i) and $h\in\{\mathcal{L}_jg,\theta_j\mathcal{L}_jg,\mathcal{L}_j^2g,\mathcal{L}_j\theta_j\mathcal{L}_jg\}$ and $\theta\in\left[\hat{\theta},\nicefrac{1}{2}\,\arcsin{\nicefrac{k_p\,}{k_s}}\right)$. The result is as follows:

chap1.tex 中的第 1671 行,它位于 alignat 环境中并包含 \numberthis 命令(这是我从另一个 stackexchange 问题中获得的,请参阅主 tex 文件以了解其定义。它的目的是对原本不会被编号的方程式进行编号。我使用它来对仅明确引用第一个和最后一个方程式的范围进行编号,因为我将其设置为数字通常仅在有引用时才出现):

\begin{alignat}{1}
\tilde{G}_{11}^j:=\,&\frac{\cos^2\phi}{2\pi}\tilde{H}_0h_1^j-\frac{\cos(2\phi)}{2r\pi}\tilde{H}_1\left[\frac{h_1^j}{\varrho}\right]+\frac{\sin^2\phi}{2\pi}\tilde{H}_0h_2^j+\frac{\cos(2\phi)}{2r\pi}\tilde{H}_1\left[\frac{h_2^j}{\varrho}\right]\label{tildegxxj}\,.\\
\tilde{G}_{21}^j:=\,&\frac{\sin\phi\cos\phi}{2\pi}\tilde{H}_0[h_1^j-h_2^j]-\frac{\sin\phi\cos\phi}{r\pi}\tilde{H}_1\left[\frac{h_1^j-h_2^j}{\varrho}\right]\numberthis\,.\\
\tilde{G}_{31}^j:=\,&\frac{i\cos\phi}{2\pi}\tilde{H}_1h_4^j\numberthis\,.\\ %1671
\tilde{G}_{12}^j:=\,&\frac{\sin\phi\cos\phi}{2\pi}\tilde{H}_0[h_1^j-h_2^j]-\frac{\sin\phi\cos\phi}{r\pi}\tilde{H}_1\left[\frac{h_1^j-h_2^j}{\varrho}\right]\numberthis\,.\\
\tilde{G}_{22}^j:=\,&\frac{\sin^2\phi}{2\pi}\tilde{H}_0h_1^j+\frac{\cos(2\phi)}{2r\pi}\tilde{H}_1\left[\frac{h_1^j}{\varrho}\right]+\frac{\cos^2\phi}{2\pi}\tilde{H}_0h_2^j-\frac{\cos(2\phi)}{2r\pi}\tilde{H}_1\left[\frac{h_2^j}{\varrho}\right]\numberthis\,.\\
\tilde{G}_{32}^j:=\,&\frac{i\sin\phi}{2\pi}\tilde{H}_1h_4^j\numberthis\,.\\
\tilde{G}_{13}^j:=\,&\frac{i\cos\phi}{2\pi}\tilde{H}_1h_3^j\numberthis\,.\\
\tilde{G}_{23}^j:=\,&\frac{i\sin\phi}{2\pi}\tilde{H}_1h_3^j\numberthis\,.\\
\tilde{G}_{33}^j:=\,&\frac{1}{2\pi}\tilde{H}_0h_5^j\label{tildegzzj}\numberthis\,.\\
G^{R,j}_{11}:=\,&\frac{\cos^2\phi}{2\pi}H^R_0h_1^j-\frac{\cos(2\phi)}{2r\pi}H^R_1\left[\frac{h_1^j}{\varrho}\right]+\frac{\sin^2\phi}{2\pi}H^R_0h_2^j+\frac{\cos(2\phi)}{2r\pi}H^R_1\left[\frac{h_2^j}{\varrho}\right]\label{gxxRj1}\numberthis\,.\\
G^{R,j}_{21}:=\,&\frac{\sin\phi\cos\phi}{2\pi}H^R_0[h_1^j-h_2^j]-\frac{\sin\phi\cos\phi}{r\pi}H^R_1\left[\frac{h_1^j-h_2^j}{\varrho}\right]\numberthis\,.\\
G^{R,j}_{31}:=\,&\frac{i\cos\phi}{2\pi}H^R_1h_4^j\numberthis\,.\\
G^{R,j}_{12}:=\,&\frac{\sin\phi\cos\phi}{2\pi}H^R_0[h_1^j-h_2^j]-\frac{\sin\phi\cos\phi}{r\pi}H^R_1\left[\frac{h_1^j-h_2^j}{\varrho}\right]\numberthis\,.\\
G^{R,j}_{22}:=\,&\frac{\sin^2\phi}{2\pi}H^R_0h_1^j+\frac{\cos(2\phi)}{2r\pi}H^R_1\left[\frac{h_1^j}{\varrho}\right]+\frac{\cos^2\phi}{2\pi}H^R_0h_2^j-\frac{\cos(2\phi)}{2r\pi}H^R_1\left[\frac{h_2^j}{\varrho}\right]\numberthis\,.\\
G^{R,j}_{32}:=\,&\frac{i\sin\phi}{2\pi}H^R_1h_4^j\numberthis\,.\\
G^{R,j}_{13}:=\,&\frac{i\cos\phi}{2\pi}H^R_1h_3^j\numberthis\,.\\
G^{R,j}_{23}:=\,&\frac{i\sin\phi}{2\pi}H^R_1h_3^j\numberthis\,.\\
G^{R,j}_{33}:=\,&\frac{1}{2\pi}H^R_0h_5^j\,.\label{gzzRj1}
\end{alignat}

app.tex 的第 2131 行,位于 align 环境的末尾,包含 \footnotetext 命令:

\begin{align}
\theta_p^2(\nu_{\theta,s})=\,&\left(\nu_{\theta,s}(t)\right)^2-k_p^2\\
=\,&k_s^2\sin^2\theta-k_p^2+\frac{tk_s\cos\theta\sin\theta}{\sqrt{2}}(\alpha_+-i\alpha_-)\\
&+ik_st^2\sin^2\theta+\frac{it^2k_s\sin^2\theta}{2}+\frac{t^2\cos^2\theta}{8}\left(\alpha_+-i\alpha_-\right)^2\\
&+\frac{t^3\sin\theta\cos\theta}{2\sqrt{2}}\left[i\alpha_++\alpha_-\right]-\frac{t^4\sin^2\theta}{4}\footnotemark
\end{align}\footnotetext{\eqref{thetaj1}--\eqref{thetaj4} is analagous to this equation, though it differs by a constant.} %2131

app.tex 中的第 2795 行,包含 \footnote 的段落。

 Recalling that $K_m(\zeta):=\frac{e^{-i\zeta}H_{m-1}^{(1)}(\zeta)}{2}$, we have by NIST 10.17.13--15\footnote{and 10.17.1, and the note that 10.7.15 applies to $\mathcal{V}_{z,-i\infty}\left(t^{-l}\right)$ in conjugate sectors} that for $\arg\zeta\in\left[-\nicefrac{\pi}{4},\pi\right]$:

运行四次后,一切正常,可以编译了。我必须再编译一次才能使所有引用正常工作。

第二次更新:以下是一些日志:

这是文件正常编译时的日志。

这是我故意引入错误后的日志。

这是我纠正错误后第一次的日志,chap1.tex 的第 1384 行出现 Counter too Large 错误。

这是我修正错误后第二次的日志,chap1.tex 第 1671 行出现 Counter Too Large 错误

这是我修正错误后第三次的日志,app.tex 的第 2131 行出现 Counter Too Large 错误

这是第四次出现 Counter Too Large 错误之后,文档再次成功编译的日志。

我忘记保存第 2795 行错误所在的第四个“计数器过大”日志,但希望这里有足够的信息。如果需要该日志,请告诉我,我会再次运行实验。

相关内容