summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries-extra/sample-postdot.tex
blob: c54e3dcede71f859de3b009b44de5eefb9ee1463 (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
45
46
47
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}

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

\makeglossaries

% Sample entry in the "general" category:

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

\setabbreviationstyle[initialism]{short}

% Set the attribute "insertdots" set to "true" to automatically
% insert periods between the letters in initialism:
\glssetcategoryattribute{initialism}{insertdots}{true}

% This can cause a problem if any of the initialisms occur at the
% end of a sentence so set the attribute "discardperiod" set to "true":
\glssetcategoryattribute{initialism}{discardperiod}{true}

\newabbreviation
 [category=initialism,description={for example}]
 {eg}{eg}{exempli gratia}

% Now for an abbreviation without dots. This is strictly speaking
% also an initialism, but it's going to be assigned the standard
% "abbreviation" category:
\newabbreviation{html}{HTML}{hypertext markup language}
% (This will use the style currently set for the "abbreviation"
% category, which is the short-long style by default.)

\begin{document}

Entry occurs at the end of a sentence: \gls{eg}.
Entry occurs at the end of a sentence: \gls{sample}.
Entry occurs at the end of a sentence: \gls{html}.

Entry \gls{eg} occurs in the middle of a sentence.
Entry \gls{sample} occurs in the middle of a sentence.
Entry \gls{html} occurs in the middle of a sentence.

\printglossaries
\end{document}