[Tex/LaTex] Setting up a Sans Serif Document Including Math (in 2017, using pdftex)

fontsmath-modepdftexsans-serif

I try to set up an entire document using sans serif fonts including math. At the moment I would like to use pdftex.

I searched the relevant questions and answers — this is what I found:

kpfonts Package

This is an edit from 2017-06-09. I found kpfonts by accident and they seem to be promising.

\documentclass[preview]{standalone}

% https://www.ctan.org/pkg/kpfonts
% Complex package -- read the documentation!
\usepackage[sfmath]{kpfonts}
\usepackage{mathtools}
\renewcommand\familydefault{\sfdefault}

\begin{document}
Text
$\displaystyle
abc+\sum_{k=1}^{n}\int_{0}^{k}\sqrt{2}f(x)\,\text{d}x
$
Text
\end{document}

enter image description here

cmbright Package

\documentclass[preview]{standalone}

\usepackage{cmbright}
\SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}

\usepackage{mathtools}
\begin{document}
Text
$\displaystyle
abc+\sum_{k=1}^{n}\int_{0}^{k}\sqrt{2}f(x)\,\text{d}x
$
Text
\end{document}

enter image description here

arevtext and arevmath (or simply arev) Package

\documentclass[preview]{standalone}

\usepackage{arev}
% Suggested from Mico
\SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}

\usepackage{mathtools}
\begin{document}
Text
$\displaystyle
abc+\sum_{k=1}^{n}\int_{0}^{k}\sqrt{2}f(x)\,\text{d}x
$
Text
\end{document}

Without \SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}
enter image description here

With \SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n}
enter image description here

sansmathfonts and helvet Package

\documentclass[preview]{standalone}

\usepackage{sansmathfonts}
\usepackage[scaled=0.95]{helvet}
\renewcommand{\rmdefault}{\sfdefault}

\usepackage{mathtools}
\begin{document}
Text
$\displaystyle
abc+\sum_{k=1}^{n}\int_{0}^{k}\sqrt{2}f(x)\,\text{d}x
$
Text
\end{document}

enter image description here

newtxsf Package

The following code is taken from the newtxsf documentation and adjusted to the code examples above.

\documentclass[preview]{standalone}

\usepackage[sfdefault,scaled=.85]{FiraSans}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[varqu,varl]{zi4}% inconsolata typewriter
\usepackage{amsmath,amsthm}
\usepackage[cmintegrals]{newtxsf}

\usepackage{mathtools}
\begin{document}
Text
$\displaystyle
abc+\sum_{k=1}^{n}\int_{0}^{k}\sqrt{2}f(x)\,\text{d}x
$
Text
\end{document}

I have trouble running the code since I get an error in the file miktex-makemf.log. I already refreshed the FNDB (MiKTeX). The error is not part of the question though.

Maybe someone can add the output of the code for me.

enter image description here

2017-03-21 02:02:13,987+0100 FATAL miktex-makemf – The txsys source
file could not be found.

After following the comment of Ulrike Fischer (running upmap on the command window of Windows), the error is gone!

enter image description here

sansmath and helvet Package

sansmath doesn't seem to be an active package (this is an assumption — nothing more). I only found 2003-08-13, version 1.0 on CTAN.

\documentclass[preview]{standalone}

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

\usepackage{mathtools}
\begin{document}
Text
$\displaystyle
abc+\sum_{k=1}^{n}\int_{0}^{k}\sqrt{2}f(x)\,\text{d}x
$
Text
\end{document}

enter image description here

More Packages That Seem Related

  • stix (v1.1.2-latex from 2015/04/17)

Other Related Information

Actual Questions

  1. What is the nowadays recommended way to set up a complete sans serif document? I aim for a solution that is considered state-of-the-art with a (if possible) complete set of symbols and font versions (Small Caps and do on).
  2. What do font packages like sansmathfonts do? Do they "just" make already existing fonts (or single characters / symbols) available in a convenient package (so it's "luck" if everything fits together) or did the authors create new fonts?

Background — Why Do I Want This

I one of the comments (Mico) I was asked to explain what I want do to with the sans serif fonts.

  • I help a friend which just started to be a teacher.
  • If we create documents that are used on any kind of projectors, then the serif fonts sometimes cause readability problems.
  • With documents I mean, e. g. beamer presentations or standalone diagrams.
  • I attached one of the standalone diagrams below. The pictures have the same resolution.
  • So it's not for a book, article or paper.

Standard Solution with Serif Fonts (no font package loaded — I assume Computer Modern then)
enter image description here


Sans Serif Version — Using the avec Package Approach from Above and Recommended by Mico
enter image description here

Best Answer

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, and

  • load the arev package, which loads the arevtext and arevmath 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:

enter image description here

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