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)]?