[Tex/LaTex] why does \printglossary refuse to print anything

glossariestexi2dvi

Can someone help me understand what's missing from this simply usages of
the glossaries package? The document doesn't print any glossary at all.
And the log file complains that test.acr and test.gls are missing.

I've investigated related issue \printglossary does not produce any content
but that does not seem to help.

Normally I'm using texi2dvi to compile my documents. If I need to run makeglossaries manually (or as part of the makefile) what's the model for using it.

\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}

Best Answer

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