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 trying to use \acf of the glossaries package in a \section command.

In my TOC I always get displayed the id, not the content. The generated section in the document works fine.

I was trying to use \protect but it doesn't work for me.

Is there no possibility like with a glossary entry \glsentryfirst?

Here my mini example:

\documentclass{scrartcl}

\usepackage[pdfdisplaydoctitle=true,%
                 pdfstartview={Fit},%
                 bookmarksopen,%
                 colorlinks=true,%
                 linkcolor=blue,%
                 urlcolor=red,%
                 citecolor=blue]%
                 {hyperref}

\usepackage[nonumberlist,%
            acronym,%
            shortcuts, %
            toc,
            numberedsection]
            {glossaries}

\makeglossaries
\newacronym{pus}{PUS}{\protect\glsadd{glos:pus}\glshyperlink[Packet Utilisation Standard]{glos:pus}}
\newglossaryentry{glos:pus}{name=PUS,description={\acl{pus} \ldots}}

\begin{document}

\tableofcontents

\section[\glsentrylong{pus}]{\acl{pus}}
text
\ac{pus}

\newpage
\printglossary[type=\acronymtype]

\end{document}
share|improve this question
    
Would you please include a minimal working example? –  egreg Oct 22 '12 at 13:47
    
There is now a working "not-working" example. ;) –  CSchulz Oct 22 '12 at 14:05
    
It's impossible to work with the example as acronym.tex and glossaries.tex are missing. Just extract from them the necessary bits. –  egreg Oct 22 '12 at 14:09
add comment

1 Answer

up vote 6 down vote accepted

Use \glsentrylong in the optional argument of the sectioning command.

\documentclass{scrartcl}

\usepackage[pdfdisplaydoctitle=true,%
                 pdfstartview={Fit},%
                 bookmarksopen,%
                 colorlinks=true,%
                 linkcolor=blue,%
                 urlcolor=red,%
                 citecolor=blue]%
                 {hyperref}

\usepackage[nonumberlist,%
            acronym,%
            shortcuts, %
            toc,
            numberedsection]
            {glossaries}

\makeglossaries

\newacronym{pus}{PUS}{\protect\texorpdfstring{\protect\glsadd{glos:pus}\glshyperlink[Packet
Utilisation Standard]{glos:pus}}{Packet Utilisation Standard}}

\newglossaryentry{glos:pus}{name=PUS,description={\acl{pus} \ldots}}

\begin{document}

\tableofcontents

\section[\glsentrylong{pus}]{\acl{pus}}
text
\ac{pus}

\newpage
\printglossary[type=\acronymtype]

\end{document}
share|improve this answer
    
I found a problem with your solution, perhaps there is a way for get it working. :) –  CSchulz Oct 22 '12 at 16:08
    
@CSchulz What's the problem? –  Nicola Talbot Oct 22 '12 at 16:40
    
I have updated my mini example the use of an acronym linking on a glossary entry. –  CSchulz Oct 22 '12 at 20:16
    
@CSchulz I've updated my answer. –  Nicola Talbot Oct 22 '12 at 20:25
    
Great! Thanks it works. :) So many things I don't know about latex. –  CSchulz Oct 22 '12 at 20:42
add comment

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.