Unless you modify the old texi2dvi
script to take care of makeglossaries
, I don't think you can get away with it.
With the new version of arara
(version 4), you can simply add something at the top of your document and compile with arara
:
% arara: pdflatex
% arara: makeglossaries if changed('acn') || changed('glo')
% arara: pdflatex if changed('acn') || changed('glo')
\documentclass[11pt]{report}
\usepackage[acronym,numberedsection]{glossaries}
\makeglossaries
\newglossaryentry{xyzzy}
{
name=\ensuremath{\bigcup V},
description={Unary union operator}
}
\newacronym{gcd}{GCD}{Greatest Common Divisor}
\begin{document}
\gls{xyzzy}
\acrshort{gcd}
\appendix
\chapter{Test chapter}
\printglossary[type=\acronymtype,title={Custom acronyms title}]
\printglossary[title={Custom glossary title}]
\end{document}
Running arara
the first time will show
> arara jim
__ _ _ __ __ _ _ __ __ _
/ _` | '__/ _` | '__/ _` |
| (_| | | | (_| | | | (_| |
\__,_|_| \__,_|_| \__,_|
Processing 'jim.tex' (size: 585 bytes, last modified: 07/12/2018
12:22:13), please wait.
(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS
(MakeGlossaries) The MakeGlossaries software ............ SUCCESS
(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS
Total: 1.52 seconds
The second time we get
> arara jim
__ _ _ __ __ _ _ __ __ _
/ _` | '__/ _` | '__/ _` |
| (_| | | | (_| | | | (_| |
\__,_|_| \__,_|_| \__,_|
Processing 'jim.tex' (size: 585 bytes, last modified: 07/12/2018
12:22:13), please wait.
(PDFLaTeX) PDFLaTeX engine .............................. SUCCESS
Total: 0.79 seconds
which shows that the unnecessary runs of makeglossaries
and pdflatex
are not performed.
Alternatively, use latexmk
: add a file named latexmkrc
to the working directory containing
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]'";
};
}
(courtesy of https://tex.stackexchange.com/a/44316/4427)
and run latexmk -pdf jim
instead of texi2dvi -p jim
(use the appropriate file name, of course).
texi2dvi
is a quite old script that doesn't know aboutglossaries
. What about switching to more modern tools such asarara
orlatexmk
?make
at the end of Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.