About
Shop
LaTeX
Free Software
Books
News
Contact
Blog
News (2017-09-10): New application bib2gls for use with glossaries-extra.sty.

Gallery (glossaries): Long Descriptions Sample

Image of long descriptions sample
This example uses the "list" glossary style, which is available by default. 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 just to iterate over all the defined entries for this example. In practice, you would typically just use \gls{label}. 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 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
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.

I've used 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, sample glossary definitions.


Last modified: 2017-02-07.

The free resources on this site are funded by book sales, not by adverts. If you would like to help keep this site free of annoying third-party ads, please consider buying a book.

© 2015 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 Site Map FAQs