summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/samples/sample-entrycount.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/glossaries-extra/samples/sample-entrycount.tex')
-rw-r--r--macros/latex/contrib/glossaries-extra/samples/sample-entrycount.tex44
1 files changed, 44 insertions, 0 deletions
diff --git a/macros/latex/contrib/glossaries-extra/samples/sample-entrycount.tex b/macros/latex/contrib/glossaries-extra/samples/sample-entrycount.tex
new file mode 100644
index 0000000000..739cf1061e
--- /dev/null
+++ b/macros/latex/contrib/glossaries-extra/samples/sample-entrycount.tex
@@ -0,0 +1,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}