0

I am trying to find a way, how to manipulate with dual entry display in altlistgroup style glossary. I am using glossaries-extra and bib2gls.

In my document, I am having list of abrreviations, main glossary and index. All of the entries are also displayed in index. Some of them are abbreviations, that require also description. For that I have chosen to create dual entries for them. In fact, they are tercial entries (being also in index), but I hope that is not problem.

The default behaviour of this setting (as far as I was able to see) is, that the dualabbreviationentry displays in main glossary (altlistgroupstyle) its "long form" (instead of "name") and "description."

How can I change that? Ideally to display gain "name," bacause in that way I could manipulate with that field to display any text I would need. Alternatively, if this couldnt be done, the "short" field would be for me more suitable than "long" field.

MWE:


% arara: lualatex: { shell: true }
% arara: bib2gls: { group: true }
% arara:  lualatex: { synctex: true, shell: true }
% arara: bib2gls: { group: true }
% arara:  lualatex: { synctex: true, shell: true }

\documentclass[12pt,twoside]{book}

\usepackage [czech] {babel}
\usepackage[T1]{fontenc}
\usepackage{fontspec}

\usepackage{filecontents}   

%Entries

\begin{filecontents}{entries.bib}
@entry{singleentry,
  name = {Single entry},
  description = {entry description
}
}
\end{filecontents}{entries.bib}

%Abbreviations

\begin{filecontents}{abbrvs.bib}
% Encoding: UTF-8
@abbreviation{aa,
  short = {AA},
  long = {Absolute assignment}
}
\end{filecontents}{abbrvs.bib}

%Duals

\begin{filecontents}{duals.bib}
% Encoding: UTF-8
@dualabbreviationentry{dual,
  long = {As Low As Reasonably Achievable},
  short = {ALARA},
  name = {ALARA},
  description = {{Dual entry description}
}
}
\end{filecontents}{duals.bib}

\usepackage{array}
\usepackage{booktabs}
\usepackage{longtable}

\usepackage[record, nopostdot, automake, abbreviations,
        index,%
                    nostyles, stylemods={all},
                    ]{glossaries-extra}

\setglossarystyle{long-booktabs}

\setabbreviationstyle[acronym]{long-short-user}
\renewcommand*{\entryname}{Zkratka}
\renewcommand*{\descriptionname}{Popis}

\GlsXtrLoadResources[selection={all},%
            src={entries,abbrvs,duals},%
             entry-type-aliases={
                abbreviation=dualindexabbreviation,
                entry=dualindexentry,
                dualabbreviationentry=tertiaryindexabbreviationentry},
            type={index},
            label-prefix={idx.},
            dual-prefix={},
            cs-label-prefix={},
            sort={en},
            sort-field={name},
            dual-sort={en},
            charset=UTF-8,%
            combine-dual-locations={primary},
            cs-label-prefix={},
            ]

\begin{document}
\renewcommand{\glsextrapostnamehook}[1]{\glsadd[format=hyperbf]{#1}}
\printunsrtglossary[type={abbreviations}, title=Abbreviations]

\cleardoublepage

\setglossarystyle{altlistgroup}
\printunsrtglossary[type={main}, title=Slovníček pojmů, toctitle=Slovníček pojmů]

\renewcommand{\glsextrapostnamehook}[1]{}
\printunsrtglossary[type=index,style=bookindex]

\cleardoublepage

\end{document}

Your Answer

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

Browse other questions tagged or ask your own question.