12

The reigning answer for the Simplest way to typeset entire document in sans serif (Helvetica) completely disregards math-mode. This might be preferred when all math equations are set display style, but a matching font is a must for in-line equations.

My current MWE (based on the one given here) only gives the text-mode items in sans, but any math remains in serif style (in-line, numerical-only equations look particularly hideous).

How can I set math in sans-serif as well?

example

\documentclass[]{article}

\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}

\usepackage[math]{blindtext}

\begin{document}

Text looks particularly bad when you have $123,400$ number-only equations in-line.

\blindmathpaper

\end{document}
  • Related/duplicate: How to typeset some text including math content in sans serif – Werner Apr 28 '14 at 16:44
  • @Werner And as prompted by the answer there, is there a way to do this without a package? Any equivalent of \renewcommand{\rmdefault}{phv} for math mode? – cslstr Apr 28 '14 at 16:46
  • @cslstr: No there is no one-liner to get sans serif math. Math is complicated, it involves a lot of fonts. – Ulrike Fischer Apr 28 '14 at 17:01
19

The answer, as I have pieced together, appears here on one page, for posterity.

The package sansmath ...

...is designed to offer sans-serif mathematics in the absence of proper sans maths fonts. After \usepackage{sansmath}, a new “math version” sans is defined, together with a command \sansmath, which behaves as \boldmath does. -from the documentation

So the MWE becomes:

\documentclass[]{article}

\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{sansmath} % Enables turning on sans-serif math mode, and using other environments
\sansmath % Enable sans-serif math for rest of document

\usepackage[math]{blindtext}

\begin{document}

Text looks particularly bad when you have $123,400$ number-only equations in-line.

\blindmathpaper

\end{document}

Which results in:

example sans math

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.