[Tex/LaTex] Upright sans serif greek in math mode

fontsmath-mode

Consider the following MWE, which typesets some sans serif math that I'm using in a presentation:

\documentclass{article}
\usepackage{sansmath}
\usepackage{amsmath}
\begin{document}
\sansmath
\[
w\Delta z = \operatorname{cov}(w,z) + \operatorname{E}(w\Delta z),
\]
\end{document}

The result looks like this:

enter image description here

I think it would look a lot better if the Delta characters were upright instead of italic. How can I achieve that? (I like the w and z being italic, just not the deltas.)

If the solution involves using a different package than sansmath, or a different font than the one shown, I'm fine with that – I'm just looking for a quick easy way to make sans serif math that looks good.

Although I already mentioned it in both the title and the body of the question, and demonstrated it with an MWE, I apparently have to edit this to point out that I am looking to do this in a sans serif font, which is what makes this different from the linked question.

Best Answer

Instead of sansmath use the sansmathfonts package. It automatically switches the math font to sans serif throughout the whole document (no need for \sansmath). If you want to use a font other than CM, you might run into trouble with upright uppercase greek letters as other fonts might not have them (or not have them in the correct slot). A possible rectification has been proposed by [egreg (2016)].

\documentclass{article}
\usepackage{sansmathfonts}
\usepackage{amsmath}
\begin{document}
\[
w\Delta z = \operatorname{cov}(w,z) + \operatorname{E}(w\Delta z),
\]
\end{document}

enter image description here


Alternatively, you can use a sans serif font with built-in math support, such as cmbright. This might actually be your best bet, as you get correct adjustment and kerning out of the box. You can find a review of several math font (no limited to sans-serif) in S. Hartke, “A Survey of Free Math Fonts for TeX and LaTeX”, The PracTeX Journal 01, (2006).

\documentclass{article}
\usepackage{cmbright}
\usepackage{amsmath}
\begin{document}
\[
w\Delta z = \operatorname{cov}(w,z) + \operatorname{E}(w\Delta z),
\]
\end{document}

enter image description here