Compiling the following document first without hyperref, then with hyperref (consecutively), produces the error
Runaway argument?
{\@firstoffive }\fi
./test.tex:7: Paragraph ended before \Hy@setref@link was complete.
<to be read again>
\par
l.7
Why is that so? (It is related to the underscore in label in section, I suppose, but I am not sure.)
\documentclass{article}
% \usepackage{hyperref}
\begin{document}
\section{Mathematical Proofs\label{sec_proofs}}
\ref{sec_proofs}
\end{document}
xr? – gusbrs Jul 19 '22 at 21:38xr, but I don't recall why I think this. If I'm not mistaken, it belongs to the imported labels of the external file, so you never see the field in the .aux file, you have to show the labels directly. I could make sure of this, if you'd like. – gusbrs Jul 19 '22 at 22:12auxfile fixes the error, which is triggered also when there is no underscore. – egreg Jul 19 '22 at 22:26\providecommandto make sure that the document doesn't break when your package is removed.) – user202729 Jul 20 '22 at 03:27