glossaries, fancyhdr: acronym not replaced properly

In the following example the acronym is not replaced properly in the header and look like in this screenshot:

\documentclass{book}
\usepackage{fancyhdr}
\usepackage[toc,nonumberlist]{glossaries}
\pagestyle{fancy}
\newacronym{VOIP}{VoIP}{Voice over IP}
\makeglossaries
\renewcommand{\glossarymark}[1]{}
\begin{document}
\chapter{Sample Chapter \gls{VOIP}}
text \gls{VOIP}
\printglossaries
\end{document}


Can anybody help?

-
Welcome to TeX.sx! You don't have to sign with your name since it automatically appears in the lower right corner of your post. –  Werner Aug 2 '12 at 6:49

Beside using the optional argument you can also use commands like \glsentrydesc (described the in documentation as "commands without links"):

   \documentclass{book}
\usepackage{fancyhdr}
\usepackage[toc,nonumberlist]{glossaries}
\pagestyle{fancy}
\newacronym{VOIP}{VoIP}{Voice over IP}
\makeglossaries
\renewcommand{\glossarymark}[1]{}
\begin{document}
\tableofcontents
\chapter{Sample Chapter \glsentrydesc{VOIP} (\glsentrytext{VOIP})}
text \gls{VOIP}
\printglossaries
\end{document}

-
thanks you safed my day :-) –  gregor2005 Aug 3 '12 at 7:08
The problem with this is it does not work with the smallcaps option with glossaries since \glsentrytext gives \textsc{Voip} as a string. Any work arounds? –  Mobius Pizza Oct 26 '12 at 10:37

I would suggest using the "short/ToC title" of the \chapter command to obtain a more appropriate header: \chapter[Sample Chapter VOIP]{Sample Chapter \gls{VOIP}}

-