In my answer to this question on how to make latexmk use makeglossaries for generating glossaries, I propose the following custom dependency:
add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');
sub run_makeglossaries {
if ( $silent ) {
system "makeglossaries -q '$_[0]'";
}
else {
system "makeglossaries '$_[0]'";
};
}
When latexmk is run on the LaTeX input file
\documentclass{article}
\usepackage[acronym]{glossaries}
\newglossaryentry{test}{name={Test}, description={A Test}}
\newacronym{AT}{AT}{A Test}
\makeglossaries
\glsaddall
\begin{document}
\printglossaries
\end{document}
the first time it invokes latex, makeglossaries and latex (in that order). This is as expected, since makeglossaries processes all defined glossaries (here the main glossary and the list of acronyms) in a single call.
Now, assume I apply some trivial changes to both the term test and the acronym AT (e.g., I convert Test to lowercase). Then, the command sequence issued by latexmk is latex, makeglossaries, makeglossaries and latex. Thus, makeglossaries is called twice while it would suffice to call it once.
Hence, I wonder: Is it possible to improve my custom dependency such that latexmk also handles the preceding case correctly?
'(glo)|(acn)'or'(gls)|(acr)'. This is completely untested, but if it does not work, it should be simple for a Perlian to extendlatexmkaccording to that idea. – Patrick Häcker Jun 17 '12 at 20:14