# debugging missing reference to figure

to put it plainly: is there a way to debug the way a \begin{figure}...\end{figure} block is processed? I got all my figures in my paper, their references are alright except for 2 of them (incidentally the last 2 in the document) even though they're declared in exactly the same way like any other picture in the paper. Reference to them don't go into the .aux file but I don't see errors that can help understand.

the following is the way pictures are included

% this picture number shows up correctly wherever referenced

\begin{figure}
\centering
\includegraphics[width=8cm]{denCont.eps}
\includegraphics[width=8cm]{denCont_irr.eps}
\caption{AFM image ...}
\label{fig:DEN}
\end{figure}

% these 2 are placed in the page as expected but references don't appear

\begin{figure}
\centering
\includegraphics[width=8cm]{RplotNONDEN.eps}
\caption{Boxplot of ...}
\label{fig:BoxND}
\end{figure}

\begin{figure}
\centering
\includegraphics[width=8cm]{RplotDEN_EN.eps}
\caption{Boxplot of ...}
\label{fig:BoxDEN}
\end{figure}


the only clue in the console output is in this trace of the \@writefile command but doesn't hint at any explicit error

[7
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Boxplot of ...}}{7}{figure.5}}
\newlabel{fig:BoxND}{{5}{7}{Boxplot of ...}{figure.5}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Boxplot of...}}{7}{figure.6}}
\newlabel{fig:BoxDEN}{{6}{7}{Boxplot of ...}{figure.6}{}}
]

• Well, you could post an example of a random figure in your document, and then the last two, so we can compare. The content is not important, but post all the tags, etc... Jan 15, 2016 at 10:27
• Welcome to TeX SE by the way! Jan 15, 2016 at 10:28
• Well, your code works as expected for me. Have you tried deleting the auxiliary files and recompiling? Jan 15, 2016 at 11:10
• yes, I did. I insist there must be a reason for the console output I showed before. It's not printed for any other figure except for the 2 with missing references. Still there is no error message associated to it, hence my question about a mechanism for deeper debugging Jan 15, 2016 at 11:26

99 times out of a hundred when that is seen it is because \include has been redefined not to use \clearpage, in which case the solution is to remove that redefinition.