How to diagnose a permanent "Label(s) may have changed" warning?
(By the way, if LaTeX knows that labels may have changed, why can't it tell me which labels?)
The following document will give the re-run error message each time.
\documentclass{article}
\makeatletter
% \def\@testdef #1#2#3{%
% \def\reserved@a{#3}\expandafter \ifx \csname #1@#2\endcsname
% \reserved@a \else
% \typeout{^^Jlabel #2 changed:^^J%
% \meaning\reserved@a^^J%
% \expandafter\meaning\csname #1@#2\endcsname^^J}%
% \@tempswatrue \fi}
\begin{document}
\providecommand\r@foo{{1}{1}}
\edef\@currentlabel{.\expandafter\@firstoftwo\r@foo}
\label{foo}
a
\end{document}
produces a log
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
If you uncomment the block in the preamble you get an additional diagnostic telling you which label has changed, and the old and new definition:
label foo changed:
macro:->{............1}{1}
macro:->{...........1}{1}
)
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.