[Tex/LaTex] Change font size of math sans serif font only

fontsfontsizemath-mode

I'm using the Arev font for math sans serif. However, the font produces slightly larger letters compared to my roman math font:

\documentclass[a4paper, 10pt]{scrartcl}

\usepackage[T1]{fontenc}

\DeclareMathAlphabet{\mathsf}{OML}{zavm}{m}{n}

\begin{document}

Font sizes of different math alphabets  $\mathrm{x} \mathsf{x} \quad
\mathrm{y} \mathsf{y} \quad \mathrm{z} \mathsf{z}$

\end{document}

enter image description here

How can I change the font size of the sans serif font by a factor to match the roman font?

Best Answer

The Arev font family has no standard way of scaling fonts, so we have to avoid loading the font description files; I just copied the contents of omlzavm.fd and modified it, adding a scaling factor. The computation of the scaling factor could be made automatic, but the .78 factor seems to be good.

\documentclass[a4paper, 10pt]{scrartcl}

\usepackage[T1]{fontenc}

\DeclareFontFamily{OML}{zavm}{\skewchar\font=127 }
\DeclareFontShape{OML}{zavm}{m}{it}{<-> s*[.78] zavmri7m}{}
\DeclareFontShape{OML}{zavm}{b}{it}{<-> s*[.78] zavmbi7m}{}
\DeclareFontShape{OML}{zavm}{m}{sl}{<->ssub * zavm/m/it}{}
\DeclareFontShape{OML}{zavm}{bx}{it}{<->ssub * zavm/b/it}{}
\DeclareFontShape{OML}{zavm}{b}{sl}{<->ssub * zavm/b/it}{}
\DeclareFontShape{OML}{zavm}{bx}{sl}{<->ssub * zavm/b/sl}{}
\DeclareMathAlphabet{\mathsf}{OML}{zavm}{m}{it} % not `n'

\begin{document}

Font sizes of different math alphabets  $\mathrm{x} \mathsf{x} \quad
\mathrm{y} \mathsf{y} \quad \mathrm{z} \mathsf{z}$

\end{document}

enter image description here