3

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.

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

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

1

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}
\glossarystyle{longragged3colheader}
\renewcommand\entryname{Symbol}
\makeglossaries
\begin{document}
\section{First page}
\newpage
Equation 1 on page 2.
\begin{equation}
 \gls{hate} = \frac{2}{0}
\end{equation}
\newpage
\printglossaries
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.