Setting up a Sans Serif Document Including Math (in 2017, using pdftex)
If the document is going to take the form of a beamer
presentation, I recommend you -- or the colleague you're helping to get started -- do two things:
issue the instruction
\usefonttheme{professionalfonts}
in the preamble, andload the
arev
package, which loads thearevtext
andarevmath
packages.
In my experience, the arev
text and math fonts are both a bit darker and more widely spaced than the corresponding CM Sans fonts. I consider both of these features to be significant pluses for the purpose of writing a beamer
-based presentation. For beginners in the business of giving presentations, a perennial and near-fatal tempatation is to try to cram too much material into any given slide. A font that's slightly more generously spaced and therefore makes it more difficult to cram too much material into a slide is highly advantageous in this regard. :-)
Another thing I like about the arev
math fonts -- however, this is clearly just a personal preference -- is that quite a few of the math-mode alphabetic glyphs actually look "italic" rather than just "slanted". This is quite apparent if one compares \textit{x}
(purely slanted) with $x$
(more "italic", not just slanted). Other glyphs that have this distinctly "italic" look in math mode are a
, f
, i
, l
, u
, v
, and w
. To repeat what I stated before, though: This is clearly just a personal preference; your preferences may very well be rather different.
A full MWE:
\documentclass{beamer}
\usefonttheme{professionalfonts}
\usepackage{arev}
\begin{document}
\begin{frame}
$\displaystyle abc + \sum_{k=1}^n \int_0^k \sqrt{2} f(x)\,\text{d}x$
\medskip\noindent
\begin{tabular}{@{}lll}
text-mode: & \emph{bcdeghjkmnopqrstyz} & \emph{afiluvwx} \\
math-mode: & $bcdeghjkmnopqrstyz$ & $afiluvwx$
\end{tabular}
\end{frame}
\end{document}
As stated in the comments: This is just for reference and not a real solution for the pdflatex
-specific question. The following solution is xelatex
-only, because it uses mathspec
, which lets you use any system-wide installed font and adjust many aspects of the math font (including specific fonts for \mathbb
, \mathcal
, \mathfrak
etc. and the selection according to character groups "Latin", "Greek", "Digits").
This is a very simple way to get a sans-only document, since you can use multiple fonts to cover the whole unicode area as needed (most sans fonts miss the calligraphic or fraktur characters). In the following example I use the "Linux Biolinum" font.
\documentclass{article}
\usepackage{mathspec}
\setallmainfonts{Linux Biolinum G}
\setallsansfonts{Linux Biolinum G}
\setallmonofonts{Linux Biolinum G}
\setmathsfont(Digits,Latin,Greek)[ItalicFont=Linux Biolinum G Italic,%
BoldFont=Linux Biolinum G Bold]{Linux Biolinum G}%
\begin{document}
This is a test.
Text
\(\displaystyle
abc+\sum_{k=1}^{n}\int_{0}^{k}\sqrt{2} f(x)\,\mathrm{d}x
\)
Text\\
\(\alpha + \mathcal{X}\)
\end{document}