14

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.

  1. how to write it in the text?
  2. how to print it?
  3. what to execute on which position?
dmckee --- ex-moderator kitten
  • 98,632
  • 24
  • 142
  • 234
Sven Klouem
  • 141
  • 1
  • 1
  • 4
  • a kind of index, a subject index on things like WWW -> World Wide Web.. – Sven Klouem Mar 11 '10 at 16:54
  • On editing, I see that you may already have found my suggestion. It would help if you said *what* you tried, and why it didn't work for you. – dmckee --- ex-moderator kitten Mar 11 '10 at 17:21
  • I agree completely, is there no simple step by step example. I have read the documentation including the beginners.pdf, and I can only see the Table of Contents entry in my file, but it points to my very first page, and does not create a glossary page at all, anywhere in the document.. –  Mar 08 '11 at 19:10
  • see my answer and the links in it. – Matthew Leingang Mar 08 '11 at 20:41

2 Answers2

8

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.

Community
  • 1
  • 1
dmckee --- ex-moderator kitten
  • 98,632
  • 24
  • 142
  • 234
8

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}
SparkAndShine
  • 17,001
  • 22
  • 90
  • 134
  • 1
    Nice Blog recommendation. – loved.by.Jesus Jan 13 '19 at 21:04
  • After removing the compilation error `**\makeglossaries**` to `\makeglossaries`, it still does not compile: **``Package glossaries Error: Glossary type `acronym' has not been defined.``** [Errors when using glossaries package](https://tex.stackexchange.com/questions/152851/errors-when-using-glossaries-package). You have to change `\usepackage{glossaries}` to `\usepackage[acronym]{glossaries}`. See the question [\printnoidxglossaries vs \printglossaries](https://tex.stackexchange.com/questions/426010/printnoidxglossaries-vs-printglossaries) for a complete usage tutorial about latex glossaries. – Evandro Coan Nov 17 '19 at 20:59