# Problem with the \mathbf command

In this MWE, I want to obtain bold letter for the letter "H" (compare the two "H") :

\documentclass[10 pt]{beamer}
\usetheme{default}
\usepackage{lmodern} % load a font with all the characters
\usepackage{fontspec}
\usepackage{cmbright}
\SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}
\usepackage{amsmath}%loads amsmath that should go before unicode-math
\usefonttheme{professionalfonts}
\defaultfontfeatures{Mapping=tex-text}  % This seems to be important for mapping glyphs properly

\begin{document}
\begin{frame}
$\mbox{First bold H : }\|x\|_{\mathbf{H}},\; \mbox{Second bold H : }\mathbf{H}$
\end{frame}
\end{document}


but I don't know how doing it. THe "H" produced by this MWE is tiny but no bold effect. If I use

\SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}

I obtain bold tiny "H" but the font used still not the same.

-
Just how is this minimal? It is far from that. – Svend Tveskæg Mar 19 '14 at 11:54
question edited. – SAKLY Mar 19 '14 at 12:16

For sizes below 10pt the cmbright package is subsetting bold fonts (which don't exists) and uses the normal weight instead. You can change this by adding this code behind cmbright:

\usepackage{cmbright}
\DeclareFontShape{OT1}{cmbr}{bx}{n}{% change bx definition
<->cmbrbx10%
}{}
\normalfont % back to normalfont

-
All works fine now. Thank you very much! – SAKLY Mar 19 '14 at 13:56

You can simply load unicode-math

MWE:

\documentclass[10 pt]{beamer}
\usetheme{default}
\usepackage{lmodern} % load a font with all the characters
\usepackage{fontspec}
\usepackage{amsmath}%loads amsmath that should go before unicode-math
\usepackage{unicode-math}
\usepackage{cmbright}
\SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}
\usefonttheme{professionalfonts}
\defaultfontfeatures{Mapping=tex-text}  % This seems to be important for mapping glyphs properly

\begin{document}
\begin{frame}
$\|x\|_{\mathbf{H}}$
\end{frame}
\end{document}


-
\usepackage{amsmath}%loads amsmath that should go before unicode-math ... and then you load it after. :) – Svend Tveskæg Mar 19 '14 at 12:49
@SvendTveskæg Yes, thank you. ;-) – karlkoeller Mar 19 '14 at 13:12
The math font I used is loaded by the cmbright package. I want to keep this font and obtain a bold letter "H" in math mode when writing for example $x_{\mathbf{H}}$ (I edited my MWE to see the difference between two bold "H"). – SAKLY Mar 19 '14 at 13:22