Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

Output file

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

share|improve this question
    
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

1 Answer 1

up vote 2 down vote accepted

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

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

Alternatively, you could try:

\section[\glsentryshort{MIMO} and \glsentryshort{SISO}]{\acs*{MIMO} and \acs*{SISO}}
share|improve this answer
    
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
    
@user16720: I’ve added an alternative solution. –  mhp Jul 25 '12 at 19:02
    
The alternative solution is ok. Thanks. –  cacamailg Jul 26 '12 at 2:32
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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