File: glossaries-extra-manual-example143.tex

package info (click to toggle)
texlive-extra 2022.20230122-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,466,588 kB
  • sloc: perl: 398,710; xml: 35,871; python: 29,125; cs: 25,850; sh: 17,610; makefile: 17,304; ansic: 15,490; java: 12,811; javascript: 9,898; lisp: 1,755; csh: 1,129; ruby: 1,072; awk: 151; tcl: 142; pascal: 138; cpp: 41; sed: 36; haskell: 5
file content (36 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download
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
% This file is embedded in glossaries-extra-manual.pdf
% Example 143 Nested glossaries
% 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}