2

I have an up to date MikTex distribution. Roughly following Trouble making a glossary, I have the following code in test.tex

\documentclass{article}

\usepackage{shellesc}
\usepackage[acronym,nomain,toc,automake]{glossaries-extra}

\setabbreviationstyle[acronym]{long-short}

\loadglsentries{glosario}

\makeglossaries

\begin{document}
First use: \gls{CCTV}. Next use: \gls{CCTV}.
\printglossary[type=\acronymtype]
\end{document}

and glosario.tex containing

\newacronym{CCTV}{CCTV}{Closed Circuit Television}

This works with pdflatex -shell-escape test.tex, however, when I use lualatex -shell-escape test.tex, the entries are not found. This is the output

This is LuaTeX, Version 1.09.0 (MiKTeX 2.9.6930 64-bit)
 system commands enabled.
(./test.tex
LaTeX2e <2018-12-01>

luaotfload | main : initialization completed in 1.454 seconds
("C:/Program Files/MiKTeX 2.9/tex/latex/base/article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:/Program Files/MiKTeX 2.9/tex/latex/base/size10.clo"))
("C:/Program Files/MiKTeX 2.9/tex/latex/tools/shellesc.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/glossaries-extra/glossaries-extra.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/xkeyval/xkeyval.sty"
("C:/Program Files/MiKTeX 2.9/tex/generic/xkeyval/xkeyval.tex"
("C:/Program Files/MiKTeX 2.9/tex/generic/xkeyval/xkvutils.tex"
("C:/Program Files/MiKTeX 2.9/tex/generic/xkeyval/keyval.tex"))))
("C:/Program Files/MiKTeX 2.9/tex/latex/etoolbox/etoolbox.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/glossaries/base/glossaries.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/base/ifthen.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/mfirstuc/mfirstuc.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/textcase/textcase.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/xfor/xfor.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/datatool/datatool-base.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/amsmath/amsmath.sty"
For additional information on amsmath, use the `?' option.
("C:/Program Files/MiKTeX 2.9/tex/latex/amsmath/amstext.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/amsmath/amsgen.sty"))
("C:/Program Files/MiKTeX 2.9/tex/latex/amsmath/amsbsy.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/amsmath/amsopn.sty"))
("C:/Program Files/MiKTeX 2.9/tex/latex/substr/substr.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/datatool/datatool-fp.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp.sty"
`Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/defpattern.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-basic.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-addons.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-snap.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-exp.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-trigo.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-pas.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-random.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-eqn.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-upn.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/fp/fp-eval.sty"))))
("C:/Program Files/MiKTeX 2.9/tex/latex/glossaries/base/glossaries-compatible-3
07.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/glossaries/styles/glossary-hypernav.sty
") ("C:/Program Files/MiKTeX 2.9/tex/latex/glossaries/styles/glossary-list.sty"
) ("C:/Program Files/MiKTeX 2.9/tex/latex/glossaries/styles/glossary-long.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/tools/longtable.sty"))
("C:/Program Files/MiKTeX 2.9/tex/latex/glossaries/styles/glossary-super.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/supertabular/supertabular.sty"))
("C:/Program Files/MiKTeX 2.9/tex/latex/glossaries/styles/glossary-tree.sty")))
 (./glosario.tex) (./test.aux) (./test.acr)This is makeindex, version 2.15 [MiKTeX 2.9.6930 64-bit] (kpathsea + Thai support).
Scanning style file ./test.ist.............................done (29 attributes redefined, 0 ignored).
Scanning input file test.acn...done (0 entries accepted, 0 rejected).
Nothing written in test.acr.
Transcript written in test.alg.

Am I missing something or is this a bug?

  • 3
    Your example works for me with TL 2018, with lualatex – user31729 Jan 6 at 12:01
  • 2
    I can reproduce the problem on windows, both with miktex and texlive. That's rather curious. (Side remark: --shell-escape shouldn't be needed). – Ulrike Fischer Jan 6 at 12:14
  • Without \usepackage{shellesc} lualatex is not calling makeindex for me. – John Jan 6 at 12:27
  • I didn't mean the package but the option --shell-escape. – Ulrike Fischer Jan 6 at 12:37
1

You need to use automake=immediate in this situation. (New to glossaries version 4.22 2019-01-06.) This executes the system command at the start of \makeglossaries (before the glossary files are opened) using \immediate. You will get a warning on the first LaTeX run when the files don't exist.

With automake=true (or simply automake), the system command is executed at the end of the document, but \immediate can't be used in this case. Unlike indexes, glossaries may occur at the start of the document rather than the end, and it's possible that there are commands such as \gls on the last page. The indexing performed by these commands can't use \immediate as it can cause problems with the associated page number due to TeX's asynchronous output routine. If \write18 is called with \immediate in this case, there's a possibility that the system command may be called before the glossary files are complete.

2

The problem is that with luatex (and the shellesc package) \write18 is actually an \immediate\write18 (see the documentation of shellesc). And this means that the makeindex command is executed before the acn-file has been written and closed. This is imho a bug in glossaries and should be reported.

You can patch the command like this:

\documentclass{article}

\usepackage{shellesc}
\usepackage[acronym,nomain,toc,automake]{glossaries-extra}

\setabbreviationstyle[acronym]{long-short}

\loadglsentries{glosario}

\makeglossaries

\usepackage{etoolbox}
\makeatletter
\patchcmd\@gls@automake{\write18}{\DelayedShellEscape}{}{\fail}
\makeatother
\begin{document}

\First use: \gls{CCTV}. Next use: \gls{CCTV}.
\printglossary[type=\acronymtype]
\end{document}

This will also work with pdflatex. You don't need the --shell-escape option, makeindex is in the list of safe applications.

  • Thanks a lot. I sent a message to the maintainer. – John Jan 6 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.