Smile for the Camera: a new cybercrime short story ebook.

Gallery: Adjusting Parenthetical Style

image of sample document with bacteria referenced in text and listed in a glossary.
This example uses the glossaries-extra package, which extends the glossaries package and provides better abbreviation handling. You’ll need at least version 1.04 of glossaries-extra.sty (you’ll also need a fairly up-to-date version of glossaries.sty as well).

This example adjusts the long-short-user style so that the parenthetical part is omitted and both the long and short forms are emphasized.



This means that on first use only the long form (emphasized) is displayed and on subsequent use only the short form (emphasized) is displayed. Note that this modification also affects \glsxtrfull so that it will only display the long form.

As from version 1.17, the glossaries-extra package now provides the style long-only-short-only, which only displays the long form on first use and only displays the short form on subsequent use, but shows both long and short forms with \glsxtrfull. (An example follows at the bottom of this page.)

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

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






\newabbreviation{cbot}{C.~botulinum}{Clostridium botulinum}
\newabbreviation{putida}{P.~putida}{Pseudomonas putida}


First use: \gls{cbot}, \gls{putida}.

Next use: \gls{cbot}, \gls{putida}.

Inline full form: \glsxtrfull{cbot}, \glsxtrfull{putida}.


If you don’t use arara, you need to run the following commands:

pdflatex sample-bacteria
makeglossaries sample-bacteria
pdflatex sample-bacteria

(See Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.)

Download: PDF (42.49K), source code (610B).

example image

The alternative approach that uses the new long-only-short-only just needs to modify the style’s font commands:



The result is almost the same as before except for the inline full form (\glsxtrfull) which shows the long form followed by the short form in parentheses. (Remember that \glsxtrfull doesn’t always replicate the format displayed by the first use of \gls.)

Download: PDF (42.83K), source code (575B).