summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/glossaries-extra-manual-examples/glossaries-extra-manual-example143.tex
blob: 8a76bbdf470750be66acbe7f6427d695a87db465 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
% This file is embedded in glossaries-extra-manual.pdf
% Example 143 Nested glossaries
% Label: "ex:nested"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{fontawesome}
\usepackage[style=tree]{glossaries-extra}
\newglossaryentry{pictograph}{name={pictograph},
 description={picture or symbol representing a word or phrase}}
\newglossaryentry{mathgreek}{name={Greek symbol},
 description={mathematical constants or functions}}
\newignoredglossary*{pictograph}
\newignoredglossary*{mathgreek}
\newglossaryentry{cut}{type={pictograph},
 name={\faCut},
 description={cut}}
\newglossaryentry{paste}{type={pictograph},
 name={\faPaste}, description={paste}}
\newglossaryentry{alpha}{type={mathgreek},
 name={\ensuremath{\alpha}},
 description={alpha}}
\newglossaryentry{beta}{type={mathgreek},
 name={\ensuremath{\beta}},
 description={beta}} 
\begin{document}
\newcommand{\nestedhandler}[1]{%
 \glsxtrunsrtdo{#1}%
 \ifglossaryexists*{#1}%
 {%
 \printunsrtinnerglossary[type={#1},leveloffset={++1},groups=false]{}{}%
 }%
 {}%
}
\printunsrtglossary*{\let\printunsrtglossaryhandler\nestedhandler} 
\end{document}