5

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}
3
  • Would you please include a minimal working example?
    – egreg
    Commented Oct 22, 2012 at 13:47
  • There is now a working "not-working" example. ;)
    – CSchulz
    Commented Oct 22, 2012 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
    Commented Oct 22, 2012 at 14:09

1 Answer 1

7

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}
5
  • I found a problem with your solution, perhaps there is a way for get it working. :)
    – CSchulz
    Commented Oct 22, 2012 at 16:08
  • @CSchulz What's the problem? Commented Oct 22, 2012 at 16:40
  • I have updated my mini example the use of an acronym linking on a glossary entry.
    – CSchulz
    Commented Oct 22, 2012 at 20:16
  • @CSchulz I've updated my answer. Commented Oct 22, 2012 at 20:25
  • Great! Thanks it works. :) So many things I don't know about latex.
    – CSchulz
    Commented Oct 22, 2012 at 20:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .