I'm writing up my thesis, and every time I make a mistake and cause a compiler error, LaTeX stops working properly until I delete the aux file. It gives the error "Counter Too Large," which looks like

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

I am linking the master tex file. The child tex files are hundreds of thousands of characters and contain all my research, so I'm not providing those.

My document contains a lot of references and footnotes, which may have something to do with it.

For now, I wrote an option into my LaTeX-running script to find and rm all relevant aux files and run LaTeX twice. I'd love to provide an MWE, but I don't have a clue as to how to narrow it down to find the cause.

UPDATE: I am able to produce the error by causing a LaTeX error by putting an end brace in some random place in the document. Also, after running LaTeX four times, the error goes away. The errors are always at the same place, occuring in order (one on one run, another on the next):

line 1384 in chap1.tex, which is inside a paragraph and contains two footnotes:

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:

line 1671 in chap1.tex, which is inside an alignat environment and contains a \numberthis command (which I got from another stackexchange question, see the master tex file for the definition. It's purpose is to number equations that wouldn't otherwise be numbered. I use it to number ranges of equations for which I only explicitly reference the first and last, since I set it so that numbers normally only appear when there is a reference):

\tilde{G}_{31}^j:=\,&\frac{i\cos\phi}{2\pi}\tilde{H}_1h_4^j\numberthis\,.\\ %1671

line 2131 of app.tex, which is at the end of an align environment and contains a \footnotetext command:

\end{align}\footnotetext{\eqref{thetaj1}--\eqref{thetaj4} is analagous to this equation, though it differs by a constant.} %2131

Line 2795 in app.tex, a paragraph containing a \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]$:

After four runs, sanity returns and it compiles. I have to compile it a second time to get any references to work.

SECOND UPDATE: Here are some logs:

This is the log when the file compiled normally.

This is the log after I intentionally introduced an error.

This is the log the first time after I corrected the error, with the Counter too Large error on line 1384 of chap1.tex.

This is the log the second time after I corrected the error, with the Counter Too Large error on line 1671 of chap1.tex

This is the log the third time after I corrected the error, with the Counter Too Large error on line 2131 of app.tex

This is the log after the fourth Counter Too Large error, when the document successfully compiled again.

I forgot to save the fourth Counter Too Large log with the error on line 2795, but hopefully there is enough information here. If that log is needed, let me know and I'll run the experiment again.

closed as unclear what you're asking by Troy, Phelype Oleinik, Sebastiano, TeXnician, Stefan Pinnow May 11 '18 at 21:51

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hi, comments are not for intended and not so useful for extended discussion; this conversation has been moved to chat, thanks. – Stefan Kottwitz Jun 11 '17 at 17:27

Browse other questions tagged or ask your own question.