[Tex/LaTex] Glossaries package a complete simple example

glossaries

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}

\begin{equation}
 \gls{hate} = \frac{2}{0}
\end{equation}

 \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.

Better to start with reading the beginner's manual here http://ctan.org/pkg/glossaries

It will save you time.

Best Answer

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

\usepackage[counter=equation]{glossaries}

then define a suitable style:

\newglossarystyle{mylong3col}{%
  \setglossarystyle{long3colheader}%
  \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}{%
  \setglossarystyle{long3colheader}%
  \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}
\begin{equation}
 \gls{hate} = \frac{2}{0}
\end{equation}
\newpage

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

Output:

enter image description here