# Glossaries package a complete simple example

I want to give a list of all the math symbols I have used after the table of contents. Can some one please give a complete example using the glossaries package? I want something like this

Symbol    Description        equation number

x         x is a variable     (1.1)


After googling for hours I can not find a complete example which shows how to change the headings. For example, instead of equation number I would like to change to page number as heading.

I keep getting something this printed

Notation    Description        Page
List

x           x is a variable     ]equation1.1


Here is a template if you have time to answer.

\documentclass{article}

\usepackage{glossaries}
\newglossaryentry{hate}{name=\ensuremath{x}, description={x is a variable, just kidding}, sort=x}
\makeglossaries
\printglosarries
\begin{document}

$$\gls{hate} = \frac{2}{0}$$

\printglossaries

\end{document}


O.k I will provide a proper answer later on. But for now here is the deal. unlike other latex packages going \usapackage{glossaries} is not it, this is the catch. You have to further do something like this.

Compile latex as normal once then you need to produce a .gls file. For that do makeindex -s myfile.ist -o myfile.gls myfile.glo then latex again.

It will save you time.

• I recommend a more specific title to your question, as well. – Will Robertson May 22 '14 at 4:20

You can use the option counter=equation when loading glossaries:

\usepackage[counter=equation]{glossaries}


then define a suitable style:

\newglossarystyle{mylong3col}{%
\renewcommand\entryname{Symbol}
\renewcommand{\pagelistname}{Equation Number}
\renewenvironment{theglossary}%
{\begin{longtable}[l]{@{}lp{0.5\hsize}p{0.3\hsize}}}%
{\end{longtable}}%
}


and use it when it comes to printing the glossary:

\printglossary[style=mylong3col,type=main]


MWE:

\documentclass{article}

\usepackage[counter=equation]{glossaries}

\newglossarystyle{mylong3col}{%
\renewcommand\entryname{Symbol}
\renewcommand{\pagelistname}{Equation Number}
\renewenvironment{theglossary}%
{\begin{longtable}[l]{@{}lp{0.5\hsize}p{0.3\hsize}}}%
{\end{longtable}}%
}

\numberwithin{equation}{section}

\newglossaryentry{hate}{name=\ensuremath{x}, description={$x$ is a variable, just kidding}, sort=x}
\makeglossaries

\begin{document}

\section{Test}
$$\gls{hate} = \frac{2}{0}$$
\newpage

\printglossary[style=mylong3col,type=main]
\end{document}


Output:

The first step is to look in the glossaries manual and choose a glossaries style that is closest to what you want. In my case the "longtable ragged series" seemed best.

To change the text of the columns, see page 31 of the glossaries manual. I'm not sure whether you can have a reference to an equation number rather than the page number, however.

\documentclass{article}
\usepackage{glossaries}
\usepackage{glossary-longragged}
\newglossaryentry{hate}{name=\ensuremath{x}, description={x is a variable, just kidding}, sort=x}
$$\gls{hate} = \frac{2}{0}$$