I'm using glossaries-extra with the bib2gls option on a big document (I tried to use the standard method, with \makeglossaries, but I got the insufficient write buffers error).
My problem is this: when using makeglossaries, the abbreviation styles withdesc and withoutdesc are correctly applied, thus on first use, the short and long forms are printed. But that's not the case when using bib2gls: only the short form is printed.
MWE (I took this one since the document I'm creating is for real big):
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{spanish}
\usepackage[svgnames]{xcolor}
\usepackage{filecontents}
\usepackage[spanish]{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\hypersetup{
colorlinks=true,
citecolor=Crimson,
linkcolor=Crimson,
urlcolor=Crimson
}
\usepackage[record,acronym,postdot]{glossaries-extra}
\begin{filecontents}{terms.bib}
% Encoding: UTF-8
@entry{duck,
name = {duck},
category = {withdesc},
description = {a waterbird with webbed feet}
}
@entry{parrot,
name = {parrot},
category = {withdesc},
description = {mainly tropical bird with bright plumage}
}
\end{filecontents}
\GlsXtrLoadResources[src={terms}]
\begin{filecontents}{acros.bib}
% Encoding: UTF-8
@acronym{GNU,
user1 = {{\textit{GNU No es Unix}\, en español}},
plural = {{GNUs}},
short = {{GNU}},
category = {{withoutdesc}},
long = {{GNU is Not Unix}}
}
@acronym{TTL,
plural = {TTLs},
short = {TTL},
category = {withdesc},
long = {{Time To Live}},
description = {{Some value}}
}
\end{filecontents}
\GlsXtrLoadResources[src={acros}]
\setabbreviationstyle[withdesc]{long-short-user-desc}
\setabbreviationstyle[withoutdesc]{long-short-user}
\newglossarystyle{customAbbrevList}{%
\setglossarystyle{listhypergroup}%
\renewcommand*{\glossentry}[2]{%
\item[\glsentryitem{##1}%
\glstarget{##1}{\glossentryname{##1}}]%
\glsifcategory{##1}{withoutdesc}{%
--- \glsentrylong{##1}\ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}{ (\!\glscurrentfieldvalue)}{}%
}{%
\mbox{}\par\nobreak\csuse{@afterheading}%
\glossentrydesc{##1}%
}%
\glspostdescription\space ##2%
}%
}
\newglossarystyle{customGloList}{%
\setglossarystyle{listhypergroup}%
\renewcommand*{\glossentry}[2]{%
\item[\glsentryitem{##1}%
\glstarget{##1}{\glossentryname{##1}}]%
\glsifcategory{##1}{withoutdesc}%
{ ---}%
{%
{\mbox{}\par\nobreak\csuse{@afterheading}%
\glossentrydesc{##1}}\glspostdescription%
}%
\space ##2%
}%
}
\addto\captionsspanish{%
\renewcommand*{\acronymname}{Abreviaturas}
\renewcommand*{\glossaryname}{Glosario}
}
\begin{document}
A \gls{duck} and a \gls{parrot}. Lots of \glspl{duck}. Also, this is \gls{GNU}.
Again: a \gls{duck}, and a \gls{parrot} are part of \gls{GNU}.
We have some \gls{TTL}; again, \gls{TTL}.
\printunsrtglossary[type=main,style=customGloList]
\printunsrtglossary[type=acronym,style=customAbbrevList]
\end{document}
The output of compiling the above document with:
xelatex doc.tex
bib2gls doc
xelatex doc.tex
is this:
What should I do to get the long and short form of the terms printed correctly on first use [example: Time To Live (TTL)]?


=)It works in the example. Unfortunately, I made the change in my big document, and in fact it worked to an extent: the first use is set correctly, but the glossaries won't show the long name version of the entries. Could the cause of this be the glossary stylescustomAbbrevListandcustomGloList? (Themakeindexapproach worked just fine before the change). – Nov 08 '17 at 14:38.latexmkrcfile. Is runningbib2glsnecessary each time after runningxelatex, or just one time? Thanks a lot for your patience! – Nov 08 '17 at 14:49pluralinstead ofshortplural, which may confuse the style. Regarding your second comment,bib2glsneeds to be run afterxelatexwhenever the definitions change (for example, if you modify the.bibfile, add new instances of\glsetc, or if the page numbers change). – Nicola Talbot Nov 08 '17 at 14:52pluralforshortplural, to no avail. I'll send you a link via chat with the important files (the preamble); of course it won't compile, but I tought the same about seeing the code=(Thank you so much! – Nov 08 '17 at 15:24.glstexfile to make sure all the fields are present in the\bibglsnewacronymcommands; try adding some of the debugging commands to the glossary to check the fields are assigned correctly. These are commands like\showglodescdescribed in the documented code (texdoc glossaries-code). For example\showglodesc{##1}inside\glossentrywill interrupt the build and show the description field in the transcript. You can show the category with\showglofield{##1}{category}. – Nicola Talbot Nov 08 '17 at 16:06makeglossaries, with themorewritespackage to allow more\writeslots, as stated here. Thank you so much for your patience and time @nicola-talbot!=)– Nov 09 '17 at 02:26bib2glson a new document rather than modifying a big existing one. – Nicola Talbot Nov 09 '17 at 11:19