diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries/samples/sample-dot-abbr.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/glossaries/samples/sample-dot-abbr.tex | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries/samples/sample-dot-abbr.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sample-dot-abbr.tex new file mode 100644 index 00000000000..886f950d590 --- /dev/null +++ b/Master/texmf-dist/doc/latex/glossaries/samples/sample-dot-abbr.tex @@ -0,0 +1,86 @@ + % arara: pdflatex + % arara: makeglossaries + % arara: pdflatex +\documentclass{article} + +\usepackage{glossaries} + +\makeglossaries + +\glsaddstoragekey{abbrtype}{word}{\abbrtype} + +\setacronymstyle{long-short} + +\newcommand*{\newabbr}[1][]{% + \newacronym[abbrtype=initials,#1]} + +\newabbr{eg}{e.g.}{exempli gratia} +\newabbr{ie}{i.e.}{id est} +\newabbr{bsc}{B.Sc.}{Bachelor of Science} +\newabbr{ba}{B.A.}{Bachelor of Arts} +\newabbr{agm}{A.G.M.}{annual general meeting} + +\newacronym{laser}{laser}{light amplification by stimulated +emission of radiation} + +\makeatletter +\renewcommand{\glspostlinkhook}{% + \ifglsfieldeq{\glslabel}{abbrtype}{initials}% + {\new@ifnextchar.\doendsentence\doendword} + {}% +} +\makeatother + +\newcommand{\doendsentence}[1]{\spacefactor=10000{}} +\newcommand{\doendword}{\spacefactor=1000{}} + +\begin{document} +This is a sample document that illustrates abbreviations with +full stops (periods) and abbreviations that are words (i.e.\ +acronyms). The examples switch to a typewriter font to make it +easier to see the inter-word and inter-sentence spaces. + +First use: \gls{laser} \gls{eg} \gls{ie} \gls{bsc} \gls{ba} \gls{agm} end of +sentence. + +End of sentence use: + +\ttfamily + +\gls{laser}. \gls{eg}. \gls{ie}. \gls{bsc}. \gls{ba}. \gls{agm}. +Done. + +laser. e.g. i.e. B.Sc. B.A\@. A.G.M\@. Done. + +\rmfamily + +Mid-sentence use: + +\ttfamily + +\gls{laser} \gls{eg} \gls{ie} \gls{bsc} \gls{ba} \gls{agm} Done. + +laser e.g.\ i.e.\ B.Sc.\ B.A. A.G.M. Done. + +\rmfamily + +Check other sentence terminators: + +\ttfamily + +\gls{laser}? \gls{eg}? \gls{ie}? \gls{bsc}! \gls{ba}! \gls{agm}? Done. + +laser? e.g.? i.e.? B.Sc.! B.A.! A.G.M.? Done. + +\rmfamily + +\glsresetall Reset. End of sentence use: + +\ttfamily + +\gls{laser}. \gls{eg}. \gls{ie}. \gls{bsc}. \gls{ba}. \gls{agm}. +Done. + +\rmfamily +\printglossaries +\end{document} |