# Change font size of math sans serif font only?

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}


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

• Can you please add code for a minimal document showing the problem? It will be easier for us to find a way to solve your issue. – egreg May 30 '14 at 9:45

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}
`