# Glossaries package has a conflict with \boldsymbol in headings while hyperref is loaded

I have encountered an error while trying to add glossaries to a document where I had used \boldsymbol in a \section command, this error occurs only if the package hyperref is loaded.

I hope the proper example is:

\documentclass[a4paper,12pt,oneside]{report}
%
%
\usepackage[IL2]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[czech,british]{babel}
%
\usepackage{hyperref}
%
\usepackage{amsfonts,amsmath,amssymb}
\usepackage{IEEEtrantools}
%
\usepackage{longtable}
\usepackage[acronym,nomain]{glossaries}
%
\makeglossaries
\begin{document}
%
%
\section{$\boldsymbol{B}$}
%
\printglossary[type=\acronymtype,title=List of Abbreviations]
%
\end{document}


Are there any nice solutions?

Edit

I have also noticed that when I add a contents line for the list (I do not know if I'm doing it how I should) using \addcontentsline{toc}{chapter}{List of Abbreviations} it looks good, but the hyperlink does not work, it jupms to previously created contents line for bibliography, despite the fact, that the list has right page number in contents. Is it also an issue of glossaries together with hyperref

-
With hyperref it's a good idea to wrap math in sections with texorpdfstring like so: \section{\texorpdfstring{$\boldsymbol{B}$}{B}} – Mass Jul 13 '14 at 17:24
You're right, it solves the first problem, thanks. May be you should promote this comment to an answer :) – fales Jul 13 '14 at 17:36
Your are posting two, basically not connected questions in one. While user Mass answered the main question, the other one with wrong hyperlink can most probably cured by using \phantomsection right before \printglossary and then use \addcontentsline... after it, but as far as I can remember, the glossaries package has some option to do this automatically. – Christian Hupfer Jul 13 '14 at 20:13
The toc package option will automatically add the glossary to the table of contents. – Nicola Talbot Jul 14 '14 at 11:28

The mathematics (and also the \boldsymbol macro) can be in headings, like \section, protected by command \texorpdfstring{} which should enclose the math.
Christian contributed with a command \phantomsection which should be before \printglossary command and helps to make the hyperref in table of contents clickable in the right way.
As he suggested, it is possible to make this automatically. It is done through an option toc at loading of the package and you might found useful also a command toctitle as option of \printglossary, which changes the printed contents name.