[Tex/LaTex] everymath and set font for math

math-mode

I’m trying to have all the math components of my table in \mathsf and \mathbf. I thought I’d use \everymath to set the \scriptscriptstyle, \mathbf and \mathsf, but I’m not able to figure it out.

\boldmath
\everymath{\scriptscriptstyle\mathsf}

Any ideas?

Best Answer

\mathsf takes an argument, it doesn't make the following expression sans serif. You can switch to math sans serif, then get the underlying \mathgroup (\fam) number and then set that for the entire math expression:

\documentclass{article}

\begin{document}
\boldmath
\everymath{\mathsf{\xdef\mysf{\mathgroup\the\mathgroup\relax}}\mysf}

$abc$


\end{document}
Related Question