[Tex/LaTex] Replace several letters in math font

fontsmath-modesans-serifsourcesanspro

I need to typeset a whole document sans serif with sourcesanspro, including formulas. I know that there are a lot of arguments against doing this, but in this particular case it makes sense.

My problem is (as often asked at several places of the web), that I don't find a proper sans serif math font. I searched the web for hours and tested a lot of possibilities (arec. cmbright, iwona …) but ended up using sansmath.

As far as I understood sansmath, it uses the default sans serif family for typesetting formulas. The problem is, that sourcesanspro doesn't include greek letters or symbols like blackboard fonts.

Is it possible to replace several symbols of the math font, e. g. greek letters, by the greek letters of other fonts manually?

That's my MWE, so far:

\documentclass{scrartcl}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{amsmath, amssymb}

\usepackage[default]{sourcesanspro}

\usepackage{sansmath}
\sansmath

\begin{document}


\noindent
ABCDEFGHIJKLMNOPQRSTUVWXYZ \\
abcdefghijklmnopqrstuvwxyz \\
$abcdefghijklmnopqrstuvwxyz$ \\
$ABCDEFGHIJKLMNOPQRSTUVWXYZ$ \\
$\alpha\beta\gamma\delta\epsilon\varepsilon\zeta\eta\theta\vartheta\iota\kappa\varkappa\lambda\mu\nu\xi o\pi\varpi\rho\varrho\sigma\varsigma\tau\upsilon\phi\varphi\chi\psi\omega$ \\
$\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega$ \\
$\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
\[
  \frac{1}{2\pi i}\int_\gamma f = \sum_{k=1}^m n(\gamma;a_k) \cdot \text{Res}(f;a_k).
\]

\end{document}

Sans serif document

Best Answer

This uses Iwona for Greek, change the font family in \DeclareSymbolFont if you want a different font.

\documentclass{scrartcl}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{amsmath, amssymb}

\usepackage[default]{sourcesanspro}

\usepackage{sansmath}
\sansmath

\DeclareSymbolFont{Greekletters}{OT1}{iwona}{m}{n}
\DeclareSymbolFont{greekletters}{OML}{iwona}{m}{it}
\DeclareMathSymbol{\Delta}{\mathord}{Greekletters}{"01}
\DeclareMathSymbol{\Theta}{\mathord}{Greekletters}{"02}
\DeclareMathSymbol{\Lambda}{\mathord}{Greekletters}{"03}
\DeclareMathSymbol{\Xi}{\mathord}{Greekletters}{"04}
\DeclareMathSymbol{\Pi}{\mathord}{Greekletters}{"05}
\DeclareMathSymbol{\Sigma}{\mathord}{Greekletters}{"06}
\DeclareMathSymbol{\Upsilon}{\mathord}{Greekletters}{"07}
\DeclareMathSymbol{\Phi}{\mathord}{Greekletters}{"08}
\DeclareMathSymbol{\Psi}{\mathord}{Greekletters}{"09}
\DeclareMathSymbol{\Omega}{\mathord}{Greekletters}{"0A}

\DeclareMathSymbol{\alpha}{\mathord}{greekletters}{"0B}
\DeclareMathSymbol{\beta}{\mathord}{greekletters}{"0C}
\DeclareMathSymbol{\gamma}{\mathord}{greekletters}{"0D}
\DeclareMathSymbol{\delta}{\mathord}{greekletters}{"0E}
\DeclareMathSymbol{\epsilon}{\mathord}{greekletters}{"0F}
\DeclareMathSymbol{\zeta}{\mathord}{greekletters}{"10}
\DeclareMathSymbol{\eta}{\mathord}{greekletters}{"11}
\DeclareMathSymbol{\theta}{\mathord}{greekletters}{"12}
\DeclareMathSymbol{\iota}{\mathord}{greekletters}{"13}
\DeclareMathSymbol{\kappa}{\mathord}{greekletters}{"14}
\DeclareMathSymbol{\lambda}{\mathord}{greekletters}{"15}
\DeclareMathSymbol{\mu}{\mathord}{greekletters}{"16}
\DeclareMathSymbol{\nu}{\mathord}{greekletters}{"17}
\DeclareMathSymbol{\xi}{\mathord}{greekletters}{"18}
\DeclareMathSymbol{\pi}{\mathord}{greekletters}{"19}
\DeclareMathSymbol{\rho}{\mathord}{greekletters}{"1A}
\DeclareMathSymbol{\sigma}{\mathord}{greekletters}{"1B}
\DeclareMathSymbol{\tau}{\mathord}{greekletters}{"1C}
\DeclareMathSymbol{\upsilon}{\mathord}{greekletters}{"1D}
\DeclareMathSymbol{\phi}{\mathord}{greekletters}{"1E}
\DeclareMathSymbol{\chi}{\mathord}{greekletters}{"1F}
\DeclareMathSymbol{\psi}{\mathord}{greekletters}{"20}
\DeclareMathSymbol{\omega}{\mathord}{greekletters}{"21}
\DeclareMathSymbol{\varepsilon}{\mathord}{greekletters}{"22}
\DeclareMathSymbol{\vartheta}{\mathord}{greekletters}{"23}
\DeclareMathSymbol{\varpi}{\mathord}{greekletters}{"24}
\DeclareMathSymbol{\varrho}{\mathord}{greekletters}{"25}
\DeclareMathSymbol{\varsigma}{\mathord}{greekletters}{"26}
\DeclareMathSymbol{\varphi}{\mathord}{greekletters}{"27}


\begin{document}


\noindent
ABCDEFGHIJKLMNOPQRSTUVWXYZ \\
abcdefghijklmnopqrstuvwxyz \\
$abcdefghijklmnopqrstuvwxyz$ \\
$ABCDEFGHIJKLMNOPQRSTUVWXYZ$ \\
$a\alpha\beta\gamma\delta\epsilon\varepsilon\zeta\eta\theta\vartheta\iota\kappa\varkappa\lambda\mu\nu\xi o\pi\varpi\rho\varrho\sigma\varsigma\tau\upsilon\phi\varphi\chi\psi\omega$ \\
$\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega$ \\
$\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
\[
  \frac{1}{2\pi i}\int_\gamma f = \sum_{k=1}^m n(\gamma;a_k) \cdot \text{Res}(f;a_k).
\]
\end{document}

enter image description here

Personal opinion Sans serif math can be justified only in a presentation.