# Why does the compiler keeps telling me (forever) to rerun because labels have changed?

I have a LaTeX paper (multifile setup, using \input{} statements) that , since a few days ago, keeps telling me at each compile (both with pdflatex or latex):

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right


Even recompiling, say, ten times does not fix it. All references in the paper seems fine, though (can't be 100% sure, would need to check each and every \ref in the source with the PDF output).

It's probably because I misplaced a label or reference in some way. But how to find it, and fix the issue? What sort of misplacements result in this repeated message?

Edit: I've tracked it down to an issue with the acronym package in combination with using \ac{} in the abstract definition of an elsarticle (Elsevier's latex class, I am using the latest version, i.e. 1.20b from 2009-09-17) document. Below is a minimal copy/paste example where the issue appears:

\documentclass[final,5p, times,twocolumn]{elsarticle}
%\documentclass{article} --> no problem when using this one (and removing frontmatter)
\usepackage[nolist]{acronym}

\begin{document}
\begin{frontmatter}
\begin{abstract}
This is just a sentence with an acronym in it: \ac{ICT}.
\end{abstract}
\end{frontmatter}

\acrodef{ICT}{Information and Communication Technologies}
\end{document}


It is not clear to me if this is because of a bug in the acronym package, or elsarticle.

-
I have seen things like that when people used \ref{} in things like margin notes. At every recompile the note jumped between two pages, always leaving changed references... So the answer is "yes", you must have done something. It is nearly impossible to tell you what you did wrong. My advice is to do the classic: Comment some inputs, does it go away? Can you find the one input for which the warning appears? or are those multiple inputs? once you found the input, comment parts of that file to pin point where the problem occurs. –  Martin H Apr 17 '13 at 9:00
are there any other warnings (about duplicate labels for example). Otherwise run latex save the .aux file to a different name run latex again and compare the difference between the old and new aux files. –  David Carlisle Apr 17 '13 at 9:16
@Martin: using commenting inputs, I figured out the problem is attributed to the use of \ac{} (from the acronym package) in my abstract. Removing them makes it work (which is OK for me, as I did an \acresetall after the abstract anyway). Usage of acronyms in the other parts of the paper doesn't give this problem, weird. @David: both .aux fields are identical, also weird –  Rabarberski Apr 17 '13 at 9:23
@Rabarberski we don't like to leave qns unanswered do you want to self-answer or should we close too-localised or do you want to leave open and see if someone can debug acronym. Your choice but if you want the last it would help if you could add a small complete document that shows the problem now you havee narrowed it down. –  David Carlisle Apr 17 '13 at 9:36
@David: I've inserted a small complete document where the problem occurs. Might indeed be too localized, but still, could be of interest to other people running into the same problem. –  Rabarberski Apr 17 '13 at 13:47

## 1 Answer

This is actually a bad interaction with the \twocolumn command, and so is a more general problem that just for the elsarticle class. Here is a minimal example triggering the error:

\documentclass[twocolumn]{article}
\usepackage[nolist]{acronym}

\begin{document}
\twocolumn[Heading with acronym \ac{ICT}]{
Some text.}

\acrodef{ICT}{Information and Communication Technologies}
\end{document}


As @Jouhn Collins notices the .aux file now has \reset@new@label placed too late:

\relax
\undonewlabel{acro:ICT}
\newlabel{acro:ICT}{{}{1}}
\acronymused{ICT}
\reset@newl@bel
\newacro{ICT}[ICT]{Information and Communication Technologies}


A work around is to add a macro that writes \reset@new@label out to the .aux file. (I am very reluctant to meddle with the definition of \twocolumn. Trying to this at \begin{document} is too late.) Here is such a fix, first in the minimal example:

\documentclass[twocolumn]{article}
\usepackage[nolist]{acronym}

\makeatletter
\newcommand{\extraclearlabels}{\protected@write\@auxout{}{%
\string\reset@newl@bel
}}
\makeatother

\begin{document}
\twocolumn[\extraclearlabels Heading with acronym \ac{ICT}]{
Some text.}

\acrodef{ICT}{Information and Communication Technologies}
\end{document}


and now in the original example:

\documentclass[final,5p,times,twocolumn]{elsarticle}
\usepackage[nolist]{acronym}
\makeatletter
\newcommand{\extraclearlabels}{\protected@write\@auxout{}{%
\string\reset@newl@bel
}}
\makeatother

\begin{document}

\begin{frontmatter}
\begin{abstract}
\extraclearlabels
This is just a sentence with an acronym in it: \ac{ICT}.
\end{abstract}
\end{frontmatter}

In text acronym \ac{ICT}.

\acrodef{ICT}{Information and Communication Technologies}
\end{document}

-