My document includes several PDF files generated by PlantUML. These files are stored in different directories underneath the document directory. So far, I've created these files with a combination of shell scripts and Makefiles. Today I learned about latexmk's custom dependencies.
I've added the following to my .latexmkrc
:
add_cus_dep('puml', 'pdf', 0, 'puml2pdf');
sub puml2pdf { system( "plantuml -Djava.awt.headless=true -charset UTF-8 -tpdf \"$_[0].puml\" \"$_[0].pdf\" "); }
Now latexmk should detect a missing PDF file on the first run and the custom dependency should kick in to run plantuml
as defined. Unfortunately, it doesn't. lualatex
fails with an error and the custom dependency is never written to the .fls
file:
LaTeX Warning: File `signservice_isignaturecore.pdf' not found on input line 529.
! Package luatex.def Error: File `signservice_isignaturecore.pdf' not found: using draft setting.
See the luatex.def package documentation for explanation.
Type H <return> for immediate help.
...
l.529 ...sinf.opmon.ieventsenderforoperationmonitor}
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Output loop---200 consecutive dead cycles.
\AP@clearpage ...e \m@ne {}\vbox {}\penalty -\@Mi
l.529 ...sinf.opmon.ieventsenderforoperationmonitor}
I've concluded that your \output is awry; it never does a
\shipout, so I'm shipping \box\outputbox out myself. Next time
increase \maxdeadcycles if you want me to be more patient!
The error probably results from the following construction in which I rotate the page and try to make sure that the float isn't placed too far way from text where it is referenced:
\afterpage{%
\clearpage% Flush earlier floats (otherwise order might not be correct)
\begin{landscape}% Landscape page
\centering % Center table
{
\begin{figure}[htbp]
\hypertarget{fig:mod.signservice.core.isignaturecore}{%
\includegraphics[width=0.75\columnwidth,keepaspectratio]{signservice_isignaturecore.pdf}
\caption{Klassenhierarchie für \java{IsignatureCore}}
\label{fig:mod.signservice.core.isignaturecore}}
\end{figure}
}
\end{landscape}
\clearpage% Flush page
}
Now two questions arise:
How can I convince
latexmk
to write the missing dependency to the.fls
file despite the error?Is it correct that in order to make
latexmk
recognize the dependency in the first place, it must be started in-silent
mode, otherwiselualatex
halts and requires user input. In this case, latexmk can't be used in a CI/CD environment without user interaction.
! Output loop---200 consecutive dead cycles
. 2. The extract that lualatex prints from line 529 has nothing in common with the document code extract that you show. There is clearly a problem caused by something else in your document. You need to sort that out first: E.g., comment out the\includegraphics
line; I predict you will still get errors. Only worry about the custom dependency after the document is corrected.-interaction=batchmode
tolatexmk
. That is often better than just using the-silent
option if you are debugging problems. That's because the-silent
option also causeslatexmk
to reduce the number of messages it writes, and these likely to be relevant to debugging.-time
option tolatexmk
. That causeslatexmk
to give an end-of-run summary of what it ran (together with the timings).