| 1 |
% This file is embedded in glossaries-extra-manual.pdf |
| 2 |
% Example 123 Entry unit counting (per section) according to category |
| 3 |
% Label: "ex:catunitentrycount" |
| 4 |
% arara: pdflatex |
| 5 |
% arara: pdflatex |
| 6 |
% arara: makeglossaries |
| 7 |
% arara: pdflatex |
| 8 |
% arara: pdfcrop |
| 9 |
\documentclass[12pt]{article} |
| 10 |
\pagestyle{empty} |
| 11 |
\usepackage[colorlinks]{hyperref} |
| 12 |
\usepackage{glossaries-extra} |
| 13 |
\GlsXtrEnableEntryUnitCounting{abbreviation}{2}{section} |
| 14 |
\makeglossaries |
| 15 |
% default category=abbreviation: |
| 16 |
\newabbreviation{html}{HTML}{hypertext markup language} |
| 17 |
\newabbreviation{css}{CSS}{cascading style sheet} |
| 18 |
% default category=general: |
| 19 |
\newglossaryentry{sample}{name={sample},description={an example}} |
| 20 |
|
| 21 |
\begin{document} |
| 22 |
\section{Sample} |
| 23 |
|
| 24 |
Used once: \gls{html}. |
| 25 |
|
| 26 |
Used three times: \gls{css} and \gls{css} and \gls{css}. |
| 27 |
|
| 28 |
Used once: \gls{sample}. |
| 29 |
|
| 30 |
\section{Another Sample} |
| 31 |
|
| 32 |
Used once: \gls{css}. |
| 33 |
|
| 34 |
Used twice: \gls{html} and \gls{html}. |
| 35 |
|
| 36 |
\printglossaries |
| 37 |
\end{document} |