1

I would like to use the documentclass revtex4 and in it I would like to use the package glossaries-extra.

Unfortunately, when I put the two together, I get the following message: Error: Missing \glsxtr@resource in aux file. (Have you used \glsxtrresourcefile or \GlsXtrLoadResources?) system returned with code 768.

And it looks like, the glossaries-extra package is not able to find my entries, but I do not see why it should not work, I use the same kind of code for many documents (with \documentclass{article} for example) without any trouble.

Here is my minimal non-working example aipsamp-test.tex:

% arara: pdflatex: { synctex: yes, shell: yes, interaction: batchmode }
% arara: pdflatex: { synctex: yes, shell: yes, interaction: batchmode }

%\documentclass[twocolumn]{article} \documentclass[% aip, amsmath, amssymb, reprint,% Neither reprint nor twocolumn options work. % twocolumn, ]{revtex4-2} % or revtex4-1.

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{filecontents}{SymbolsAcronymsTest.bib}
    @acronym{fem,short= {FEM}, long= {Finite Element Method}}

    @symbol{dens,
        name={\ensuremath{ \rho }},
        description={mass density},
    }
\end{filecontents}

\newcommand{\PathSymbolsEntries}{./SymbolsAcronymsTest}%.bib
\usepackage[record, automake]{glossaries-extra}
    \newglossary*{acronym}{Abbreviations}
    \newglossary*{symbol}{Nomenclature}

    \GlsXtrLoadResources[
        src={\PathSymbolsEntries}, 
        type={acronym},
        match={entrytype=acronym},
    ]

    \GlsXtrLoadResources[
        src={\PathSymbolsEntries},
        type=symbol,
        match={entrytype=symbol},
    ]

\begin{document} \title{Sample Title} \author{A. Author} \date{\today} \begin{abstract} An article usually includes an abstract. \end{abstract} \maketitle

\section{First-level heading}
    This sample document demonstrates proper use of REV. 
    $\gls{dens}$, \gls{fem}

\printunsrtglossary[type=acronym]
\printunsrtglossary[type=symbol]

\end{document}

Is there known incompatibilities ? Or do you have any ideas ? Thanks by advance.

Edit

The issue is clearly seen through the shell command:

pdflatex --shell-escape ./aipsamp-test.tex 1>log.txt
pdflatex --shell-escape ./aipsamp-test.tex 1>log.txt
Error: Missing \glsxtr@resource in aux file. (Have you used \glsxtrresourcefile or \GlsXtrLoadResources?)
system returned with code 768

Also as the previous command shows it the error does not stop the compilation but just gives a warning in the terminal. So the problem does not appear in the logfile. Therefore, I think that the problem comes from the glossaries-extra internal runsystem(bib2gls aipsamp-test) from the automake option.

Otherwise in the produced document, the section Acronym and Nomenclature are empty and there is question mark where rho and FEM should appear, as it can be seen in red in the screenshot below.enter image description here

Here is the log file aipsamp-test.log generated:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex 2020.9.17)  17 SEP 2020 16:58
entering extended mode
 \write18 enabled.
 %&-line parsing enabled.
**./aipsamp-test.tex
(./aipsamp-test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/revtex/revtex4-2.cls
Document Class: revtex4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/re
vtex/ for documentation)
 Copyright (c) 2019 American Physical Society.
 mailto:revtex@aps.org
 Licensed under the LPPL:
http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt
 Arthur Ogawa <arthur_ogawa at sbcglobal dot net>
 Based on work by David Carlisle <david at dcarlisle.demon.co.uk>Version (4.2c)
: Modified by Mark Doyle
 .
ltxutil[2019/01/18/14:29:48 4.2c utilities package (portions licensed from W. E
. Baxter web at superscript.com)]
LaTeX Info: Redefining \@centercr on input line 315.
Class revtex4-2 Info: Repairing broken LaTeX eqnarray on input line 365.
\eqncolsep=\skip47
Class revtex4-2 Info: Repairing hyperref-unfriendly LaTeX definition of \mpfoot
note on input line 440.
Class revtex4-2 Info: Repairing broken LateX \@sect on input line 762.
\intertabularlinepenalty=\count167
\@tbpen=\count168
\@arstrutbox@hline=\box45
Class revtex4-2 Info: Repairing broken LaTeX \@xbitor on input line 1793.
Class revtex4-2 Info: Making \typeout \long on input line 2053.
ltxfront[2019/01/18/14:29:48 4.2c frontmatter package (AO,DPC,MD)]
\c@affil=\count169
\c@collab=\count170
\absbox=\box46
ltxgrid[2019/01/18/14:29:48 4.2c page grid package (portions licensed from W. E
. Baxter web at superscript.com)]
\c@linecount=\count171
\output@latex=\toks15
\box@size@1=\box47
\box@size@2=\box48
\@protection@box=\box49
\@topmark@saved=\toks16
\footins@saved=\box50
\footins@recovered=\box51
\column@recovered=\box52
\pagesofar=\box53
\footsofar=\box54
\pagegrid@col=\count172

Class revtex4-2 Warning: Failed to recognize @vspace, @vspacer, @no@pgbk, @ newline, and \; no patches applied. Please get a more up-to-date class, .

\c@part=\count173 \c@section=\count174 \c@subsection=\count175 \c@subsubsection=\count176 \c@paragraph=\count177 \c@subparagraph=\count178 \abovecaptionskip=\skip48 \belowcaptionskip=\skip49 \c@figure=\count179 \fbox@1=\box55 \c@table=\count180 \fbox@2=\box56 \c@video=\count181 \fbox@4=\box57 @bibdataout=\write3 \widetext@top=\box58 \widetext@bot=\box59 Class revtex4-2 Info: Selecting society aip on input line 7581. (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/revtex/aip4-2.rtx File: aip4-2.rtx 2019/01/18/14:29:48 4.2c AIP substyle for REVTeX Class revtex4-2 Info: RevTeX society AIP selected on input line 87. )

Class revtex4-2 Warning: No journal specified, using default cha.

Using journal substyle cha. Class revtex4-2 Info: Reading file aps10pt4-2.rtx on input line 7586. (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/revtex/aps10pt4-2.rtx File: aps10pt4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/revtex/ for documentation) Class revtex4-2 Info: RevTeX pointsize 10pt selected on input line 36. ) Class revtex4-2 Info: Overriding 10pt on input line 7586.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/textcase/textcase.sty Package: textcase 2019/09/14 v1.00 Text only upper/lower case changing (DPC) ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsfonts/amssymb.sty Package: amssymb 2013/01/14 v3.01 AMS font symbols

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support @emptytoks=\toks17 \symAMSa=\mathgroup4 \symAMSb=\mathgroup5 LaTeX Font Info: Redeclaring math symbol \hbar on input line 98. LaTeX Font Info: Overwriting math alphabet \mathfrak' in versionbold' (Font) U/euf/m/n --> U/euf/b/n on input line 106. )) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amsmath.sty Package: amsmath 2020/01/20 v2.17e AMS math features @mathmargin=\skip50

For additional information on amsmath, use the `?' option. (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amstext.sty Package: amstext 2000/06/29 v2.01 AMS text

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions @emptytoks=\toks18 \ex@=\dimen134 ) LaTeX Info: Redefining \text on input line 28. ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen135 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsmath/amsopn.sty Package: amsopn 2016/03/08 v2.02 operator names ) \inf@bad=\count182 LaTeX Info: Redefining \frac on input line 227. \uproot@=\count183 \leftroot@=\count184 LaTeX Info: Redefining \overline on input line 389. \classnum@=\count185 \DOTSCASE@=\count186 LaTeX Info: Redefining \ldots on input line 486. LaTeX Info: Redefining \dots on input line 489. LaTeX Info: Redefining \cdots on input line 610. \Mathstrutbox@=\box60 \strutbox@=\box61 \big@size=\dimen136 LaTeX Font Info: Redeclaring font encoding OML on input line 733. LaTeX Font Info: Redeclaring font encoding OMS on input line 734. \macc@depth=\count187 \c@MaxMatrixCols=\count188 \dotsspace@=\muskip16 \c@parentequation=\count189 \dspbrk@lvl=\count190 \tag@help=\toks19 \row@=\count191 \column@=\count192 \maxfields@=\count193 \andhelp@=\toks20 \eqnshift@=\dimen137 \alignsep@=\dimen138 \tagshift@=\dimen139 \tagwidth@=\dimen140 \totwidth@=\dimen141 \lineht@=\dimen142 @envbody=\toks21 \multlinegap=\skip51 \multlinetaggap=\skip52 \mathdisplay@stack=\toks22 LaTeX Info: Redefining [ on input line 2859. LaTeX Info: Redefining ] on input line 2860. ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/url/url.sty \Urlmuskip=\muskip17 Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc. ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/natbib/natbib.sty Package: natbib 2010/09/13 8.31b (PWD, AO) \bibhang=\skip53 \bibsep=\skip54 LaTeX Info: Redefining \cite on input line 694. \c@NAT@ctr=\count194 ) Class revtex4-2 Info: Repairing natbib's \BibitemShut on input line 7588.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/revtex/revsymb4-2.sty Package: revsymb4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/revtex/ for documentation) LaTeX Info: Redefining \frak on input line 101. LaTeX Info: Redefining \Bbb on input line 117. LaTeX Info: Redefining \REV@mathfrak on input line 125. )) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/base/inputenc.sty Package: inputenc 2018/08/11 v1.3c Input encoding file \inpenc@prehook=\toks23 \inpenc@posthook=\toks24 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/base/fontenc.sty Package: fontenc 2020/02/11 v2.0o Standard LaTeX package )

LaTeX Warning: File `SymbolsAcronymsTest.bib' already exists on the system. Not generating it from this source.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries-extra/glossaries-e xtra.sty Package: glossaries-extra 2020/03/23 v1.44 (NLCT) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/xkeyval/xkeyval.sty Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

(/Applis/TexLive/texlive2020/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/Applis/TexLive/texlive2020/texmf-dist/tex/generic/xkeyval/xkvutils.tex \XKV@toks=\toks25 \XKV@tempa@toks=\toks26

(/Applis/TexLive/texlive2020/texmf-dist/tex/generic/xkeyval/keyval.tex)) \XKV@depth=\count195 File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) )) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/etoolbox/etoolbox.sty Package: etoolbox 2019/09/21 v2.5h e-TeX tools for LaTeX (JAW) \etb@tempcnta=\count196 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/base/glossaries.st y Package: glossaries 2020/03/19 v4.46 (NLCT) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/base/ifthen.sty Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC) ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty Package: mfirstuc 2017/11/14 v2.06 (NLCT) @glsmfirst=\toks27 @glsmrest=\toks28 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/xfor/xfor.sty Package: xfor 2009/02/05 v1.05 (NLCT) ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/datatool/datatool-base.sty Package: datatool-base 2019/09/27 v2.32 (NLCT)

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/substr/substr.sty Package: substr 2009/10/20 v1.2 Handle substrings \c@su@anzahl=\count197 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/datatool/datatool-fp.sty Package: datatool-fp 2019/09/27 v2.32 (NLCT)

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp.sty Package: fp 1995/04/02

`Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/defpattern.sty Package: defpattern 1994/10/12 \actioncount=\count198 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-basic.sty Package: fp-basic 1996/05/13 \FP@xs=\count199 \FP@xia=\count266 \FP@xib=\count267 \FP@xfa=\count268 \FP@xfb=\count269 \FP@rega=\count270 \FP@regb=\count271 \FP@regs=\count272 \FP@times=\count273 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-addons.sty Package: fp-addons 1995/03/15 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-snap.sty Package: fp-snap 1995/04/05 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-exp.sty Package: fp-exp 1995/04/03 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-trigo.sty Package: fp-trigo 1995/04/14 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-pas.sty Package: fp-pas 1994/08/29 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-random.sty Package: fp-random 1995/02/23 \FPseed=\count274 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-eqn.sty Package: fp-eqn 1995/04/03 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-upn.sty Package: fp-upn 1996/10/21 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/fp/fp-eval.sty Package: fp-eval 1995/04/03 ))) @dtl@toks=\toks29 @dtl@tmpcount=\count275 \dtl@tmplength=\skip55 \dtl@sortresult=\count276 @dtl@numgrpsepcount=\count277 @dtl@datatype=\count278 \dtl@codeA=\count279 \dtl@codeB=\count280 @dtl@foreach@level=\count281 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/base/glossaries-co mpatible-307.sty Package: glossaries-compatible-307 2020/03/19 v4.46 (NLCT) ) \gls@level=\count282 @gls@tmpb=\toks30 \gls@tmplen=\skip56 \glskeylisttok=\toks31 \glslabeltok=\toks32 \glsshorttok=\toks33 \glslongtok=\toks34

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-hy pernav.sty Package: glossary-hypernav 2020/03/19 v4.46 (NLCT) ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-li st.sty Package: glossary-list 2020/03/19 v4.46 (NLCT) \glslistdottedwidth=\skip57 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-lo ng.sty Package: glossary-long 2020/03/19 v4.46 (NLCT) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/tools/longtable.sty Package: longtable 2020/01/07 v4.13 Multi-page Table package (DPC) \LTleft=\skip58 \LTright=\skip59 \LTpre=\skip60 \LTpost=\skip61 \LTchunksize=\count283 \LTcapwidth=\dimen143 \LT@head=\box62 \LT@firsthead=\box63 \LT@foot=\box64 \LT@lastfoot=\box65 \LT@cols=\count284 \LT@rows=\count285 \c@LT@tables=\count286 \c@LT@chunks=\count287 \LT@p@ftn=\toks35 ) \glsdescwidth=\skip62 \glspagelistwidth=\skip63 ) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-su per.sty Package: glossary-super 2020/03/19 v4.46 (NLCT)

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/supertabular/supertabular.sty Package: supertabular 2020/02/02 v4.1g the supertabular environment \c@tracingst=\count288 \ST@wd=\dimen144 \ST@rightskip=\skip64 \ST@leftskip=\skip65 \ST@parfillskip=\skip66 \ST@pageleft=\dimen145 \ST@headht=\dimen146 \ST@tailht=\dimen147 \ST@pagesofar=\dimen148 \ST@pboxht=\dimen149 \ST@lineht=\dimen150 \ST@prevht=\dimen151 \ST@toadd=\dimen152 \ST@dimen=\dimen153 \ST@pbox=\box66 )) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries/styles/glossary-tr ee.sty Package: glossary-tree 2020/03/19 v4.46 (NLCT) \glstreeindent=\skip67 )) (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/glossaries-extra/glossaries-e xtra-bib2gls.sty Package: glossaries-extra-bib2gls 2020/03/23 v1.44 (NLCT) ) @glsxtr@leveloffset=\count289 \glsxtrresourcecount=\count290 @glsxtrnewgls@inner=\count291 \glsshortpltok=\toks36 \glslongpltok=\toks37 ) runsystem(bib2gls aipsamp-test)...executed.

Package glossaries-extra Warning: No file `aipsamp-test.glstex' on input line 3 3.

Package glossaries-extra Warning: No file `aipsamp-test-1.glstex' on input line 39.

Class revtex4-2 Info: Unrecognized LaTeX tabular. Please update this document c lass! (Proceeding with fingers crossed.) on input line 41. Class revtex4-2 Info: Patching unrecognized longtable package. (Proceeding with fingers crossed) on input line 41. Class revtex4-2 Info: cite was not loaded (OK!) on input line 41. Class revtex4-2 Info: mcite was not loaded (OK!) on input line 41. Class revtex4-2 Info: multicol was not loaded (OK!) on input line 41.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.d ef File: l3backend-pdfmode.def 2020-03-12 L3 backend support: PDF mode \l__kernel_color_stack_int=\count292 \l__pdf_internal_box=\box67 ) (./aipsamp-test.aux) \openout1 = `aipsamp-test.aux'.

LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 41. LaTeX Font Info: ... okay on input line 41. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 41. LaTeX Font Info: ... okay on input line 41. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 41. LaTeX Font Info: ... okay on input line 41. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 41. LaTeX Font Info: ... okay on input line 41. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 41. LaTeX Font Info: ... okay on input line 41. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 41. LaTeX Font Info: ... okay on input line 41. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 41. LaTeX Font Info: ... okay on input line 41. \openout3 = `aipsamp-testNotes.bib'.

Class revtex4-2 Warning: Assuming \noaffiliation for authors.

LaTeX Font Info: Trying to load font information for T1+cmss on input line 4 8. (/Applis/TexLive/texlive2020/texmf-dist/tex/latex/base/t1cmss.fd File: t1cmss.fd 2019/12/16 v2.5j Standard LaTeX font definitions ) LaTeX Font Info: Trying to load font information for U+msa on input line 52.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsfonts/umsa.fd File: umsa.fd 2013/01/14 v3.01 AMS symbols A ) LaTeX Font Info: Trying to load font information for U+msb on input line 52.

(/Applis/TexLive/texlive2020/texmf-dist/tex/latex/amsfonts/umsb.fd File: umsb.fd 2013/01/14 v3.01 AMS symbols B )

Package glossaries-extra Warning: Glossary entry `dens' has not been defined on input line 52.

Package glossaries-extra Warning: Glossary entry `fem' has not been defined on input line 52.

Package glossaries-extra Warning: No entries defined in glossary `acronym' on i nput line 54.

Package glossaries-extra Warning: No entries defined in glossary `symbol' on in put line 55.

No file aipsamp-test.bbl. No file aipsamp-test.bbl. [1{/Applis/TexLive/texlive2020/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./aipsamp-test.aux) ) Here is how much of TeX's memory you used: 9602 strings out of 480608 149647 string characters out of 5901651 505453 words of memory out of 5000000 25383 multiletter control sequences out of 15000+600000 540170 words of font info for 40 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 59i,4n,41p,1053b,329s stack positions out of 5000i,500n,10000p,200000b,80000s {/Applis/TexLive/texlive2020/texmf-dist/fonts/enc/dvips/c m-super/cm-super-t1.enc}</Applis/TexLive/texlive2020/texmf-dist/fonts/type1/pub lic/amsfonts/cm/cmr10.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts/type1/p ublic/cm-super/sfrm0900.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts/type1 /public/cm-super/sfrm1000.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts/typ e1/public/cm-super/sfss1000.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts/t ype1/public/cm-super/sfsx0900.pfb></Applis/TexLive/texlive2020/texmf-dist/fonts /type1/public/cm-super/sfsx1440.pfb> Output written on aipsamp-test.pdf (1 page, 75208 bytes). PDF statistics: 33 PDF objects out of 1000 (max. 8388607) 23 compressed objects within 1 object stream 0 named destinations out of 1000 (max. 500000) 1 words of extra memory for PDF output out of 10000 (max. 10000000)

I continued the investigations and it seems that the problem comes from the option reprint in the \documentclass: by commenting this option, the compilation returns no error and the document looks like expected. However, the layout is completely different without this option. I also notice the same problem with the option twocolumn. But the question about why these options generate troubles remains ?

R. N
  • 1,076
  • I can't reproduce the issue. – egreg Sep 16 '20 at 07:55
  • @egreg Did you uncomment the reprint option ? – R. N Sep 16 '20 at 08:25
  • Yes, I did. The only thing I changed was the name of the .bib file (so I don't risk clobbering my files). – egreg Sep 16 '20 at 10:37
  • @egreg Humm, interesting ! Because, I tried many times and this problem persist, on my computer. So, could it be version dependent ? I am using pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019) – R. N Sep 16 '20 at 10:43
  • @egreg, I updated my TexLive with the 2020 version, but the problem remains. I also edit my question by adding some precisions about how detect the problem. Hoping you will be able to reproduce the issue. – R. N Sep 17 '20 at 13:19
  • I cannot reproduce either, please provide the full log from a compilation via texlive 2020. We mostly need it to see if you have old package versions interferring. I get several warnings, but no compilation errors. Also note that you can include the data file into the example using the filecontents env – daleif Sep 17 '20 at 13:29
  • @daleif, I edit my question to include the log file. I think that people will prefer to have the logfile in the question rather than in a separated download. I agree about the filecontents environment, but I wanted to be as close as possible to my real usage. However, I can use the filecontents if you think it would be better. – R. N Sep 17 '20 at 13:50
  • When ever possible we nevr want stuff on external URLs as they tend to rot over time. – daleif Sep 17 '20 at 13:56
  • Pleae provide the log and MWE that gives that error. I also wonder about those Class revtex4-1 Info: Unrecognized LaTeX tabular. Please update this document c lass! lines, I don't seem to get those with a fully up to date TL2020. – daleif Sep 17 '20 at 14:01
  • @daleif, I edited my post. If I use revtex4-2, which is the latest version, the problem remains. In my post both the log and MWE are those which gives the error, but as I added, the error is not stopping the compilation and not visible in the log. So I think the error message comes from the internal runsystem. And as result after 2 pdflatex compilation there is nomenclature nor acronym section. – R. N Sep 17 '20 at 16:17
  • Is there still nobody that can reproduce this issue? – R. N Sep 26 '20 at 10:19

1 Answers1

1

The problem is essentially that

\documentclass[twocolumn]{revtex4-2}
\makeatletter
\protected@write\@auxout{}{\gdef\string\foo{bar}}
\makeatother

\begin{document} \maketitle A \end{document}

does not write out \gdef \foo{bar} to the aux file. I don't know why, it works when twocolumn is not active, it also works if \maketitle is omitted, it works if some text is typeset before \maketitle, but if \maketitle is the first thing typeset in twocolumn certain calls to \@auxout don't show up.

I'd thought this might relate to the new latex hooks which revtex now uses with sufficiently recent versions of latex, but testing on Overleaf I seem to be able to replicate this back to TL 2014 (as far as Overleaf goes) with revtex4 and revtex4-1.

While most of the aux file comes out correctly, the \glsxtr@resource that \GlsXtrLoadResources should've written doesn't, under the hood it uses \protected@write\@auxout to generate it. With a couple of patches to \GlsXtrLoadResources and \glsxtrresourcefile we can delay writing out to the aux file until \end{document} where they are written out successfully.

% arara: pdflatex: { synctex: yes, shell: yes, interaction: batchmode }
% arara: pdflatex: { synctex: yes, shell: yes, interaction: batchmode }

\begin{filecontents}{SymbolsAcronymsTest.bib} @acronym{fem,short= {FEM}, long= {Finite Element Method}}

@symbol{dens, name={\ensuremath{ \rho }}, description={mass density}, } \end{filecontents}

\documentclass[twocolumn]{revtex4-2} \usepackage[record,automake]{glossaries-extra} \newglossary{acronym}{Abbreviations} \newglossary{symbol}{Nomenclature}

\makeatletter % patch some recent changes to the \GlsXtrLoadResources and % \glsxtrresourcefile macros so the redefinitions below should % also work with earlier versions of glossaries-extra \providecommand{\glsindexingsetting}{} \providecommand{\glsxtr@save@mfu}{}

\renewcommand*{\GlsXtrLoadResources}[1][]{% \ifnum\glsxtrresourcecount=0\relax \glsxtrresourcefile[#1]{\jobname}% \else \edef\glsxtrresourcefilename{\jobname-\the\glsxtrresourcecount}% <--- ADDED \glsxtrresourcefile[#1]{\glsxtrresourcefilename}% <--- MODIFIED \fi \advance\glsxtrresourcecount by 1\relax }

\renewcommand*{\glsxtrresourcefile}[2][]{% @glsxtr@if@record@only {\renewcommand{\glsindexingsetting}{bib2gls}}% {\edef\glsindexingsetting{bib2gls-\ifglsxindy xindy\else makeindex\fi}}% \disable@keys{glossaries-extra.sty}{record}% \glsxtr@writefields \glsxtr@save@mfu \ifdefempty\GlsXtrDefaultResourceOptions {% \AtEndDocument{% <--- ADDED \protected@write@auxout{\glsxtrresourceinit}% {\string\glsxtr@resource{#1}{#2}}% }% <--- ADDED }% {% \AtEndDocument{% <--- ADDED \protected@write@auxout{\glsxtrresourceinit}% {\string\glsxtr@resource{\GlsXtrDefaultResourceOptions,#1}{#2}}% }% <--- ADDED }% \let@glsxtr@org@see@noindex@gls@see@noindex \let@gls@see@noindex\relax \IfFileExists{#2.glstex}% {% \edef@bibgls@restoreat{\noexpand\catcode\noexpand\noexpand\@=\number\catcode@}% \makeatletter @input{#2.glstex}% @bibgls@restoreat @glsxtr@check@bibgls@nameref }% {% \GlossariesExtraWarning{No file `#2.glstex'}% }% \let@gls@see@noindex@glsxtr@org@see@noindex } \makeatother

\GlsXtrLoadResources[ src={./SymbolsAcronymsTest}, type={acronym}, match={entrytype=acronym}, ]

\GlsXtrLoadResources[ src={./SymbolsAcronymsTest}, type={symbol}, match={entrytype=symbol}, ]

\begin{document} \maketitle \gls{dens}, \gls{fem}

\printunsrtglossary[type=acronym] \printunsrtglossary[type=symbol] \end{document}

Compiled document showing both glossaries working

Rather than messing with the internals of glossaries-extra, typesetting anything before \maketitle will also avert the problem, so

\documentclass[twocolumn]{revtex4-2}
\makeatletter
\protected@write\@auxout{}{\gdef\string\foo{bar}}
\makeatother

\begin{document} \rule{0pt}{0pt} \maketitle A \end{document}

gives an accurate aux file, but this does noticeably push any title matter down, inspite of the rule itself being zero size.

The dodgy aux file only seems to affect external calls (makeglossaries/bib2gls), so (as suggested in this answer) it is probably sufficient to switch to onecolumn and compile once before making those external calls and then reverting to twocolumn afterwards. This will need to be repeated whenever you want to update a glossary.

Dai Bowen
  • 6,117
  • I tried your answer on my system, and I got the following error: ! LaTeX Error: Command \glsindexingsetting undefined. ! Undefined control sequence. \\glsxtrresourcefile ...tefields \glsxtr@save@mfu \ifdefempty \GlsXtrDefault... l.70 ]. So which TeX compiler are you using and which version ? – R. N Apr 12 '23 at 20:58
  • This was based on v1.50 of glossaries-extra, internals must've changed. Which version do you have? I'll see if I can rewrite more flexibly to use \patchcmd or work out how to adapt it otherwise. – Dai Bowen Apr 12 '23 at 21:06
  • I am using pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) – R. N Apr 12 '23 at 21:23
  • @R.N I've updated the example to work with earlier versions of glossaries-extra, this compiles for me across TL 2020–2023. Let me know if you have any further problems. – Dai Bowen Apr 13 '23 at 18:50
  • I checked your 2 solutions, and they are both working fine. Of course the second is quicker. – R. N Apr 13 '23 at 21:38
  • 1
    Yes, much simpler, but unfortunately I can't find anything that will trigger the aux writes without adding additional vertical space before the title (while the \rule itself is zero-height and not visible, its presence noticeably displaces the title). – Dai Bowen Apr 13 '23 at 22:07