# LuaLaTeX Unicode-Math Sans Serif Font

Im testing Sans Serif Fonts in a LuaLaTeX scrartcl document. I found out that with

\usepackage{fontspec}
\usepackage[math-style=TeX]{unicode-math}
\usepackage[cm]{sfmath}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont[
Color=grey,
UprightFont={Source Sans Pro Light},
BoldFont={Source Sans Pro Bold},
ItalicFont={Source Sans Pro Italic},
BoldItalicFont={Source Sans Pro SemiBold Italic}
]{Source Sans Pro}
\setmonofont{Inconsolata}[Scale=MatchLowercase]
\setmathfont{Source Sans Pro}[math-style=TeX]


I get the best results. But still all variables inside a \sqrt{xy} are black. Like black rectangles. Im testing now about 2h and didn't found another Sans Serif Font that works anyhow better...

Does anybody have me an advice how to make all work?

Probably you are looking for a package like mathastext.

\documentclass{article}

\usepackage[no-math]{fontspec}
\setmainfont[
UprightFont={* Light},
BoldFont={* Bold},
ItalicFont={* Italic},
BoldItalicFont={* Semibold Italic}
]{Source Sans Pro}

\usepackage[italic]{mathastext}

\begin{document}

$\sqrt{xy}$

\end{document}


• Yes. I still had the problem that with that package it made the math serif. I then copied it below the \setmainfont and then it worked. So it seams that it has to be executed after defining the font. Somehow that makes sense... - Thanks. – novski Dec 8 '16 at 14:04