# Glossaries with numberlist also counts TOC, LOF, LOT

I am using glossaries to maintain a list of acronyms.

I want it to display the page number where it appears.

I usually use \acs{} or \acl{} in sectioning title or in caption.

However I noticed that glossaries also displays the page of TOC, LOF or LOT if I use \acs{} or \acl{} inside \section{} or \caption (as this entries will appear in TOC, LOF, or LOT).

How can I disable this behavior of glossaries and only consider what is really the text, there is, not consider what is written in TOC, LOF, or LOT?

\documentclass{report}

\usepackage[section,xindy,nomain,acronym,toc,shortcuts]{glossaries}

\newcommand{\acro}[2]{\newacronym{#1}{#1}{#2}}

\acro{MIMO}{Multiple Input Multiple Output}
\acro{SISO}{Single Input Single Output}

\makeglossaries

\newcommand{\acroname}{Acronym}

\begin{document}

\tableofcontents

\printglossary[type=\acronymtype,style=tree,title=\acroname,toctitle=\acroname]

\newpage

\section{\acs*{MIMO} and \acs*{SISO}}

bla

\end{document}


If I take the previous code and do:

pdflatex test
makeglossaries test
pdflatex test
makeglossaries test
pdflatex test


The output is in the attached file. Note that the second makeglossaries runs automatically because I also have biber. If the second makeglossaries does not run, everything is ok.

Is there a way to prevent this and allow the run of second \makeglossaries?

-
I would like to help, but don't have xindy. Can you make an example without it? Maybe this already helps you: try \texorpdfstring. –  canaaerus Jul 24 '12 at 20:13
To use the previous example without xindy just remove it from the glossaries options: \usepackage[section,nomain,acronym,toc,shortcuts]{glossaries} I also used \texorpdfstring but it only takes care of bookmarks and not the text itself. –  cacamailg Jul 25 '12 at 11:54

The glossaries package provides \glsentry<field> commands that do nothing but expand to the <field> value. Thus, try:

\section{\glsentryshort{MIMO} and \glsentryshort{SISO}}

\section[\glsentryshort{MIMO} and \glsentryshort{SISO}]{\acs*{MIMO} and \acs*{SISO}}

This does the trick. At least part of it. However I am also trying to keep some compatibility with acronym package in a way that with the same list of acronyms I can use either packages. Thus if I have a flag=true I will use glossaries else I will use acronym. Therefore I need to build two new commands (for short and long versions) for each of the packages that display the acronym in the table but does not hyperlink it. These commands will only be used inside \caption{} or \section{}. Example: \newcommand{\acsnh}[1]{\glsentryshort{#1}\glsadd{#1}}. But I don't now about acronym. –  cacamailg Jul 25 '12 at 13:19
@user16720: If you use \acsnh in the argument of \section you’ll have the same problem as before. –  mhp Jul 25 '12 at 13:43
I tried to use \caption{This section is about \glslink*{MIMO}{\glsentryshort{MIMO}} with no luck. It seems that there is no way instead of using \glsadd{} outside \caption{} or \caption[]{}. –  cacamailg Jul 26 '12 at 14:45