1

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}{}}
]
4
  • 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... – Alenanno Jan 15 '16 at 10:27
  • Welcome to TeX SE by the way! – Alenanno Jan 15 '16 at 10:28
  • Well, your code works as expected for me. Have you tried deleting the auxiliary files and recompiling? – Alenanno Jan 15 '16 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 – Massimo Manghi Jan 15 '16 at 11:26
4

The fact that the writefile appears on the terminal means that the information got written to the aux file after the aux file was closed for writing.

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.

7
  • Thanks! that's a step ahead toward a solution, but there is no obvious point where this redefinition could have taken place. The code posted is a quite accurate excerpt, only a plain text paragraph between the first and second figure blocks was removed, no Latex commands were purged for brevity (exception a few \ref or \cite commands in the text paragraph) – Massimo Manghi Jan 15 '16 at 11:35
  • @MassimoManghi What about the preamble: any particular options? – Alenanno Jan 15 '16 at 11:38
  • hold on, David, you are correct. I initially misinterpreted your suggestion. I expected the redefinition to be between the figure inclusion, but I found out the main .tex file redefined \clearpage to avoid page break between \section blocks. It works now after I removed a \let\clearpage\relax command, still it's weird because it was in the main file and placed before all the \include sequence of 6 paper sections but struck only on the last one. I have now to understand how to properly avoid page breaks between \section blocks – Massimo Manghi Jan 15 '16 at 11:41
  • @Alenanno thank you for your help and glad to be a member of Tex SE! – Massimo Manghi Jan 15 '16 at 11:48
  • @MassimoManghi You're welcome. Consider accepting David's answer if it solved your problem (the √ sign next to the answer). – Alenanno Jan 15 '16 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.