Package glossaries: Create a glossary, a list of symbols, acronyms and abbreviations

Submitted by Erik Wegner on
Body

With the help of the package glossaries one can easily create a glossary and/or lists of symbols, acronyms and abbreviations. The package utilizies the makeindex command that is already included in any latex environment. The glossaries package is the successor to the package glossary from the same author. If you need to translate any name to a different language, you can load the translator package.

LaTeX file

\documentclass{article}
\usepackage[utf8]{inputenc} %File encoding
\usepackage[T1]{fontenc} % Use EC fonts
\usepackage{ae} % Fonts for PDF files
\usepackage{textcomp} % Text-Companion-Symbols (e. g. \texteuro)
\usepackage[english]{babel} % Language selection
\usepackage{lmodern} % Latin Modern

\usepackage[english]{translator}
%Load the package
\usepackage[
nonumberlist, %do not show page numbers
acronym,      %generate acronym listing
toc,          %show listings as entries in table of contents
section]      %use section level for toc entries
{glossaries}


\usepackage{hyperref}

%Generate a list of symboles
\newglossary[slg]{symbolslist}{syi}{syg}{List of symbols}

%Remove the dot at the end of glossary descriptions
\renewcommand*{\glspostdescription}{}

%Activate glossary commands
\makeglossaries

%These commands sort the lists
%makeindex -s filename.ist -t filename.alg -o filename.acr filename.acn
%makeindex -s filename.ist -t filename.glg -o filename.gls filename.glo
%makeindex -s filename.ist -t filename.slg -o filename.syi filename.syg

%Some entries for the list of symbols
\newglossaryentry{symb:Pi}{
name=$\pi$,
description={A mathematical constant whose value is the ratio of any circle's circumference to its diameter.},
sort=symbolpi, type=symbolslist
}
\newglossaryentry{symb:Phi}{
name=$\varphi$,
description={An angle.},
sort=symbolphi, type=symbolslist
}
\newglossaryentry{symb:Lambda}{
name=$\lambda$,
description={Lambda indictes an eigenvalue in the mathematics  of linear algebra.},
sort=symbollambda, type=symbolslist
}

%Some acronyms
\newacronym{MS}{MS}{Microsoft}
\newacronym{CD}{CD}{Compact Disc}
%An acronym with a glossary entry
\newacronym{AD}{AD}{Active Directory\protect\glsadd{glos:AD}}

%Some glossary terms
\newglossaryentry{glos:AD}{
name=Active Directory,
description={Active Directory is the directory service for 
Windows based networks, that allows central organization and 
administration of any network resource.
It allows a single-sign-on concept independent from network 
topologies or network protocols. As a prerequisite you need 
a Windows Server acting as Domain Controller. This computer 
stores all necessary data, e.\,g.~usernames and corresponding 
passwords.}
}
\newglossaryentry{glos:RespF}{name={response file}, description={A file 
that allows unattended software installation.}}


\begin{document}
\tableofcontents{}

\section{General information}
Our network uses \gls{AD}. By using \gls{AD} with \gls{MS} bases clients that
have been installed using a \gls{glos:RespF} from \gls{CD}, we can expect a 
high level of standardization.

\section{Some Greek symbols}
If you calculate with \gls{symb:Pi} you always get an irrational result, because 
\gls{symb:Pi} itself is irrational. As a matter of fact, there are \gls{symb:Phi} 
and \gls{symb:Lambda}, too.

\cleardoublepage{}

%Print the glossary
\printglossary[style=altlist,title=Glossary]

%Print list of acronyms
%\deftranslation[to=German]{Acronyms}{Abkürzungsverzeichnis}
\printglossary[type=\acronymtype,style=long]

%Print list of symbols
\printglossary[type=symbolslist,style=long]

\end{document}

Process the file

pdflatex filename
makeindex -s filename.ist -t filename.alg -o filename.acr filename.acn
makeindex -s filename.ist -t filename.glg -o filename.gls filename.glo
makeindex -s filename.ist -t filename.slg -o filename.syi filename.syg
pdflatex filename

The result can be found here: example_glossaries.pdf

Remarks:

  • It is advisable to use separate files for glossary entries and acronyms.
  • All entries for the list of symbols should have a sort key, all sort keys should start with the same letter to avoid spacing between letter groups.
Files
Attachment Size
example_glossaries.pdf 87.82 KB
filename.tex 3.06 KB