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

\caption{AFM image ...}

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

\caption{Boxplot of ...}

\caption{Boxplot of ...}

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

\@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... – 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

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.

  • 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.