imakeidx
and latexmk
are two of my favorite utilities of all TeX-time, especially in the face of book-size compilations (super thanks @egreg and @John Collins!). Apart from ease of producing multiple indices, one of the most useful properties of imakeidx
is in-document compilation index sub-compilation (how I wish glossaries
and biblatex
could be extended to behave the same way!)
Given MWE:
\documentclass{article}
\usepackage{imakeidx}
\makeindex
\begin{document}
This.\index{this}
\printindex
\end{document}
makeindex
is invoked once midway during straightforward latex
compilation. However, when using latexmk -recorder (etc.)
, latexmk
ignores the new .ind
file that imakeidx
produces half-way through and invokes makeindex
on the .idx
file all over again.
Of course, this inefficiency is hardly noticeable with this toy MWE. But given many-filed book-size documents with multiple large indices, biblatex
/biber
, multiple glossaries
and several tocs necessitating several passes before reaching completion, the extra work that latexmk
creates (rather than eliminates) tests my sense of elegance (and sometimes my patience) greatly.
How, then, can I improve latexmk
's over-eagerness to invoke makeindex
in documents using imakeidx
? I'm hoping for some simple rules to add to my .latexmkrc
. I am particularly interested in keeping the number of makeindex
invocations to a minimum across multiple passes (not shown with this MWE) -- say, to a maximum of two invocations per any index file.
[[ Bonus points for extending glossaries
and/or biblatex
capability for in-document compilation a la imakeidx
's brand of \write18
magic. ; ) ]]
Arara
is a candidate worth trying for jobs like this. It is easily configureable.Arara
certainly looks like a useful tool (kudos also for its tremendously readable manual. I wish many others could be so good —biblatex
manual authors are you listening!??). Still, I'm struggling to see how it might fit the bill without make-like dependency-conditioned compilation. To me, it seems ideal for configuring "straight through" processing, but, without diving into Java coded rules, it doesn't solve my problem – efficient dependency-constrained assembly pipeline automation. However, please correct me if it is up to this and I'll take another look.arara
just can't solve the problem asked above. BTW, in fairness,latexmk
's author John Collins is equally active, generous etc. in this and other fora. : )