# How to combine another sans-serif math font with helvet for text?

The existing question Typeset WHOLE document in sans-serif, Including Math Mode uses the sansmath package to use helvet glyphs also in math-mode. But being not designed for use in math mode, the results don't look convincing.

According to this survey of free math fonts, it seems to be possible to use another font (mentioned are cmbright and lxfonts as similar) for math-mode in combination with helvet for text-mode. However, I cannot find pointers on how to setup the document appropriately. (How) can it be done?

The obligatory MWE:

\documentclass{article}

\usepackage{helvet} % for text-mode
\renewcommand{\familydefault}{\sfdefault}

% \usepackage{cmbright} % one of these for...
% \usepackage{lxfonts}  % math-mode only

\usepackage[math]{blindtext}
\begin{document}
\blindmathpaper
\end{document}


## Update, use sansmathfonts instead of sansmath

A year later, I finally found a combination of text and math font for a helvet-based document. Source: Egreg's answer to my question about arev's strange placement of subscripts.

### New code

\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage{sansmathfonts}
%\usepackage[scaled=0.86]{beramono} % for code listings
\usepackage[scaled=0.95]{helvet}
\renewcommand{\rmdefault}{\sfdefault}

\usepackage[T1]{fontenc}
\usepackage[math]{blindtext}
\begin{document}
\blindmathpaper
\end{document}


## Old (helvet + arev)

I should have read the survey link I provided more carefully. The author was so nice to not only provide the comparison as pdf, but also as tex for each font combination. He explains how to combine the math font of Arev with text font of Heros, which is a Helvetica clone. So with a slight change from tgheros to helvet, my working example becomes:

\documentclass{article}

\usepackage{arev} % sans-serif math font
\usepackage{helvet} % sans-serif text font
\renewcommand{\rmdefault}{\sfdefault}

\usepackage[math]{blindtext}
\begin{document}
\blindmathpaper
\end{document}

• it is similar, but your "1" does not look like rendered using Helvetica or Liberation Sans font in either implementation. – 2xMax Nov 23 at 11:10

The manual of sansmath states the following:

The actual sans fonts are OT1 encodings of those indicated by the meaning of \sfdefault WHEN THE PACKAGE WAS LOADED, not the meaning at each maths environment!

We can exploit this fact by first loading the desired math font, then sansmath, and finally helvet for the text font. This is straightforward when cmbright is used for maths:

\documentclass{article}
\usepackage{cmbright}
\usepackage{sansmath}
\sansmath
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[math]{blindtext}
\begin{document}
\blindmathpaper
\end{document}


Some other technique would be needed for lxfonts which acts at the end of the preamble, overriding earlier font settings (helvet).