I have a document using MinionPro as serif and MyriadPro as sans-serif font families. Math is set by default with the serif font but for captions I like to switch to the sans-serif font. A minimal working example would be:
\documentclass[11pt]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{MinionPro}
\usepackage{MyriadPro}
\usepackage[onlysansmath]{mdsymbol}
\usepackage{sansmath}
\begin{document}
{\sffamily
This should be sans-serif, but the math isn't: $E=\hbar\omega$}
This should be sans: $E=\hbar\omega$
\end{document}
However, I can get math with MyriadPro if I use the option \usepackage[math]{MyriadPro}
and using the mdsymbol
package. Then however, I have no serif math any more... How can I get it to work properly? I tried also to use sansmath but that didn't work. I also looked at this question but I cannot get it to work with my choice of fonts.