summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries-extra/sample-entrycount.tex
blob: 739cf1061ee3da28b3fe58a8e5d9510688498fc4 (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
38
39
40
41
42
43
44
% arara: pdflatex
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}

\usepackage[colorlinks]{hyperref}
\usepackage{glossaries-extra}

\makeglossaries

\GlsXtrEnableEntryCounting
 {abbreviation}% list of categories to use entry counting
 {2}% trigger value

\newabbreviation{html}{HTML}{hypertext markup language}
\newabbreviation{xml}{XML}{extensible markup language}
\newabbreviation{css}{CSS}{cascading style sheet}

\newglossaryentry{sample}{name={sample},description={sample}}

\begin{document}
This is a sample document that uses entry counting. The entry counting
has been enabled on the \texttt{abbreviation} category.
This means that abbreviations will only be added to the glossary 
if they have been used more than $n$ times, where in this 
document $n$ has been set to
\glsgetcategoryattribute{abbreviation}{entrycount}.
Entries in other categories behave as normal.


Used once: \gls{html}.

Used twice: \gls{xml} and \gls{xml}.

Used three times: \gls{css} and \gls{css} and \gls{css}.

Used once but this entry is in the ``general'' category
which doesn't have the ``entrycount'' attribute set:
\gls{sample}.

\printglossaries

\end{document}