TransWikia.com

glossaries(extra) document available labels

TeX - LaTeX Asked by Daniel Böckenhoff on October 3, 2021

We share our glossaries and symbols in our institute and I want to document what glossaries and symbols are available and what their label is. Hence I use glsaddall{} which works like a charm. As a last step I want to change the appearance of the table to also show the label in front of any entry. How to do that?

One Answer

You can access the label using the glscurrententrylabel command for your personal glossary stlye, i.e.

documentclass{article}  
usepackage{glossaries}
makeglossaries
loadglsentries{example-glossaries-brief}

newglossarystyle{labelStyle}{%
    renewenvironment{theglossary}%
    {begin{longtable}{p{.2textwidth}p{.3textwidth}p{.5textwidth}}}%
        {end{longtable}}%
    renewcommand*{glossaryheader}{%                   setting the table's header
        bfseries  & bfseries Label & bfseries Description
        tabularnewlineendhead}%
    renewcommand*{glsgroupheading}[1]{}%              no heading between groups
    renewcommand*{glossentry}[2]{%                    main entries displayed 
        textbf{glstarget{##1}{glossentryname{##1}}}% name
        & glscurrententrylabel%                        label
        & glossentrydesc{##1}%                         description
        tabularnewline%                                end of row
    }%
    renewcommand*{glsgroupskip}{}%                    no distance between groups
}

begin{document} 
    glsaddall
    printglossary[style=labelStyle]
end{document} 

enter image description here

Correct answer by Venez on October 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP