1

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}

  • 1
    no the problem is that without hyperref labels store two values (number and page), with hyperref five (number, page, name, destination, and a free one). One could perhaps catch it, but the real plan is to use five values without hyperref too. – Ulrike Fischer Jul 19 '22 at 21:07
  • @UlrikeFischer Curiosity: Is the official status of the fifth field "free"? Isn't it used for the url for xr? – gusbrs Jul 19 '22 at 21:38
  • @gusbrs I don't think that it is used anywhere, at least I never saw a use somewhere. – Ulrike Fischer Jul 19 '22 at 21:54
  • @UlrikeFischer I'm pretty sure it is used by xr, 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:12
  • Removing the aux file fixes the error, which is triggered also when there is no underscore. – egreg Jul 19 '22 at 22:26
  • Progressing in TeX is difficult. Programming in TeX, use aux, patch internal commands, and ensure that nothing breaks even when the aux of with-package is compiled without-package or vice-versa is even more difficult. (for one, you need appropriate no-op \providecommand to make sure that the document doesn't break when your package is removed.) – user202729 Jul 20 '22 at 03:27
  • Urlike is a member of the LaTeX project so "in theory" it would be possible to change the kernel to use 5 values as well (except... would that break a lot of packages? I'm not sure. Also worst-case you get error when you keep the aux and upgrade LaTeX version, but this one is rather unlikely) – user202729 Jul 20 '22 at 03:29
  • Reverse question of https://tex.stackexchange.com/a/82671/250119 I guess. – user202729 Jul 20 '22 at 03:44

0 Answers0