I'm trying to include a simple glossary to my LaTeX document,
I already searched for something like that on google, but never got it running.
I would like to use glossary or glossaries.
You can use this package using the command \usepackage{glossaries} in your document's preamble. Then, you can use the command \makeglossaries prior to adding the first glossary entry. Finally, you can start adding glossary entries using the command \newglossaryentry{YOUR GLOSSARY TERM}.
The command \makeglossaries must be written before the first glossary entry. Each glossary entry is created by the command \newglossaryentry which takes two parameters, then each entry can be referenced later in the document by the command \gls . See the subsection about terms for a more complete description.
The acronym environment allows one to define all the acronyms needed by a document at a single place and is self-documenting, since a table of acronyms is automatically produced. Therefore, use the acronym environment and the \acro command instead of \acrodef if you want to have a list of acronyms .
A glossary is an alphabetical list of words, phrases, and abbreviations with their definitions.
Well, there is a glossaries
package on CTAN. Read the pdf documentation.
Check if you already have it in your installation, if not install it, and put \usepackage{glossaries}
in the preamble of you document and it will be available to you.
It looks like you need \usepackage{glossaries}
and \makeglossaries
in the preamble, and some number of \newglossaryentry
and \newacronym
calls (it is not immediately clear to me if these only go in the premble or can go in the document text). Finally, you will need one or more \printglossary
calls in the text. Use \gsl
to connect glossary entries on the argument with the pages they occur on.
Processing the file will have to include a call to makeglossaries
followed by at least one more invokation of latex.
In addition to the samples mentioned in the documentation there is a Stack Overflow question which includes a minimal file making use of glossaries
. You may be particularly interested in the acronym glossary.
There is a nice blog for beginners: LaTeX glossary and list of acronyms
Here is an example:
\documentclass{article}
% Load the package
\usepackage{glossaries}
% Generate the glossary
**\makeglossaries**
\begin{document}
%Term definitions
\newglossaryentry{utc}{name=UTC, description={Coordinated Universal Time}}
\newglossaryentry{adt}{name=ADT, description={Atlantic Daylight Time}}
\newglossaryentry{est}{name=EST, description={Eastern Standard Time}}
% Use the terms
\gls{utc} is 3 hours behind \gls{adt} and 10 hours ahead of \gls{est}.
%Print the glossary
\printglossaries
\end{document}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With