There are situations where the sans-serif font is required for documents. It can be, for example, a requirement by the university or institute. It may even be a design decision, for example, presentation slides often use sans serif. It's the default behavior of the LaTeX beamer
class.
You can switch to sans serif for the default text font family using this command:
\renewcommand{\familydefault}{\sfdefault}
In such a case, it's desirable to print math formulas in sans serif as well to get a consistent design. The beamer
class already does this.
In this recipe, we will do that for an arbitrary class. We will change all math formulas to have a sans serif font.
We will use the sfmath
package. Follow these steps to get sans serif math formulae:
Load the
sfmath
package. Do it after loading the font packages or commands that change the\sfdefault
command:\usepackage{sfmath}
If you use the default font, that is, Computer Modern, additionally load
sansmathaccent...