Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.

Gallery: Long Descriptions

image of glossary with running descriptions that span multiple lines
In contrast to Brief Descriptions, this example has longer descriptions so a less compact style is used, in this case the list glossary style, which is available by default. (For even longer descriptions that contain paragraph breaks, see Multi-Paragraph Descriptions.)

The list style uses the description environment. If you are using a class or package that modifies that environment in a way that’s incompatible with this style, then try one of the tree styles instead.

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

% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{report}

\usepackage[colorlinks]{hyperref}
\usepackage[nopostdot]{glossaries}

\makeglossaries

\loadglsentries{example-glossaries-long}

\begin{document}

\chapter{Sample}

\forglsentries{\thislabel}{\gls{\thislabel}. }

\printglossary[style=list]

\end{document}

This document loads the hyperref package, which creates hyperlinks from the entries in the document (referenced using commands like \gls) to their definition in the glossary. These hyperlinks are displayed in red text. I’ve used \forglsentries for this example to iterate over all the defined entries. In practice, you would typically just use commands like \gls{label} in the text. For example:

Here is a reference to the term \gls{loremipsum}.

The entries have all been defined in the file example-glossaries-long.tex, which you should find installed in the same location as the glossaries package (or in a sub-directory called test-entries). The file can be input using either \loadglsentries or \input (but not \include). The entry definitions look like this:

\newglossaryentry{loremipsum}{name={lorem ipsum},
description={dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.}}

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

pdflatex long-descriptions
makeglossaries long-descriptions
pdflatex long-descriptions

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

I’ve used the nopostdot option to remove the terminating full stop that is placed by default after the descriptions (since the descriptions already include it). 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. If you don’t want these numbers to appear, use the nonumberlist option.

Download PDF (43.49K), source code (340B), sample glossary definitions (2.76K).