As default font, I want to have a serif font (MinionPro in my case). But for figure and table captions I like to use a sans-serif font (MyriadPro in my case). If I want to give a mass in electron masses in the caption using siunitx
, I encountered that it does not work. I am using the detect-all
option for siunitx
to let it recognize the font.
(M)WE:
\documentclass[11pt]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[minionint]{MinionPro}
\usepackage[sansmath]{MyriadPro}
\usepackage{array}
\usepackage{siunitx}
\sisetup{detect-all}
\DeclareSIUnit{\Electronmass}{\text{\ensuremath{m_{\text{0}}}}} % My own definition
\setkomafont{captionlabel}{\sffamily\bfseries}
\setkomafont{caption}{\sffamily}
\begin{document}
Normal text in MinionPro.
\begin{table}[b]
\centering\sffamily\mathversion{sans}
\begin{tabular}{ c >{\centering}m{6.0cm} c }
\multicolumn{3}{c}{} \\
Band & Angular Momentum Eigenstate & Basis Set \\
\multicolumn{3}{c}{} \\
\hline
\multicolumn{3}{c}{} \\
a & b & c \\
\end{tabular}
\caption{Captions in MyriadPro. siunitx problem: $E=\SI{2}{\electronvolt}$ (works), $m=\SI{14}{\electronmass}$ (does not work), $m=\SI{14}{\Electronmass}$ (does not work either).}
\end{table}
\end{document}