About 🛈
Shop 🛒Shop 🛒
LaTeX 🖹
Software 💾
Books 📚
Gallery 🖺
News 📢
Contact 📧
Blog 🖋

Gallery (glossaries-extra): Initialisms Sample

Image of
inialisms sample
This example uses the glossaries-extra package, which extends the glossaries package and provides better abbreviation handling.

The initial comment lines below are arara directives. You can remove them if you don't use arara.

% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex



% set up the styles:


% define the entries:

\newabbreviation{html}{html}{hypertext markup language}

\newabbreviation[category=initialism]{eg}{eg}{for example}
\newabbreviation[category=initialism]{si}{SI}{sample initials}


First use: \gls{eg} and \gls{si} (dots inserted) and
\gls{html} (no dots).

Next use: \gls{eg} and \gls{si} (dots) and \gls{html} (no dots).

End of sentence: \gls{eg}. (Trailing period has been discarded.)

End of sentence: \gls{si}. (Spacefactor has also been adjusted.)


If you don't use arara, you need to run the following commands:
pdflatex sample-initialisms
makeglossaries sample-initialisms
pdflatex sample-initialisms
These commands can be run from a terminal or command prompt or you might be able to run them by clicking on a button in your text editor.

This example uses the long-short style for abbreviations that have been assigned to the initialisms category (the eg and si entries).

General abbreviations (the html entry) use the long-short-sc style.
The initialisms have full stops (periods) automatically inserted by setting the insertdots attribute for entries assigned to the initialism category.
If this attribute is set, it's generally a good idea to set the discardperiod attribute, which will discard a period that follows commands like \gls:

The glossaries-extra package automatically implements the toc option (to add the glossary to the table of contents) and the nopostdot option (to remove the terminating full stop that is placed by default after the description). The entries all have a "1" after the description. This is the page number on which the entry was referenced. In this sample document all the entries were referenced on page 1.

Download: PDF, document source.

© 2016 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs