| 1 |
% arara: pdflatex |
| 2 |
% arara: makeglossaries |
| 3 |
% arara: pdflatex |
| 4 |
\documentclass{article} |
| 5 |
|
| 6 |
\usepackage[colorlinks]{hyperref} |
| 7 |
\usepackage{glossaries-extra} |
| 8 |
|
| 9 |
\makeglossaries |
| 10 |
|
| 11 |
% Sample entry in the "general" category: |
| 12 |
|
| 13 |
\newglossaryentry{sample}{name={sample},description={an example}} |
| 14 |
|
| 15 |
\setabbreviationstyle[initialism]{short} |
| 16 |
|
| 17 |
% Set the attribute "insertdots" set to "true" to automatically |
| 18 |
% insert periods between the letters in initialism: |
| 19 |
\glssetcategoryattribute{initialism}{insertdots}{true} |
| 20 |
|
| 21 |
% This can cause a problem if any of the initialisms occur at the |
| 22 |
% end of a sentence so set the attribute "discardperiod" set to "true": |
| 23 |
\glssetcategoryattribute{initialism}{discardperiod}{true} |
| 24 |
|
| 25 |
\newabbreviation |
| 26 |
[category=initialism,description={for example}] |
| 27 |
{eg}{eg}{exempli gratia} |
| 28 |
|
| 29 |
% Now for an abbreviation without dots. This is strictly speaking |
| 30 |
% also an initialism, but it's going to be assigned the standard |
| 31 |
% "abbreviation" category: |
| 32 |
\newabbreviation{html}{HTML}{hypertext markup language} |
| 33 |
% (This will use the style currently set for the "abbreviation" |
| 34 |
% category, which is the short-long style by default.) |
| 35 |
|
| 36 |
\begin{document} |
| 37 |
|
| 38 |
Entry occurs at the end of a sentence: \gls{eg}. |
| 39 |
Entry occurs at the end of a sentence: \gls{sample}. |
| 40 |
Entry occurs at the end of a sentence: \gls{html}. |
| 41 |
|
| 42 |
Entry \gls{eg} occurs in the middle of a sentence. |
| 43 |
Entry \gls{sample} occurs in the middle of a sentence. |
| 44 |
Entry \gls{html} occurs in the middle of a sentence. |
| 45 |
|
| 46 |
\printglossaries |
| 47 |
\end{document} |