[Tex/LaTex] LuaLaTeX | Beamer | fontspec | Define a Sans Serif Math Font

beamerfontsfontspecluatexsans-serif

Community, this question does not hold up to my standard research
quality. Please excuse if there is an obvious answer. It's a bit of a
deadline situation with a late change in requirements.

I have a beamer document that is compiled with LuaTeX. I have to use a system font (ttf). In the MWE below I use Consolas font as a replacement for my actual font (it is commercial).

I want to use a "normal" sans serif math font (via \usepackage{}) together with the ttf font. I use \usepackage{isomath} in my MWE.

The document compiles but the math is not all sans serif (numbers, sin, alpha, \infty are serif). I want everything to be sans serif.

\documentclass{beamer}
\usepackage{fontspec}
\usepackage{mathtools}
%\setsansfont{PorscheNextTT}
\setsansfont{Consolas} % Should be available on a Windows system
\usepackage{isomath}

\begin{document}

\begin{frame}
Testtext. Testtext. \textbf{Testtext.} Testtext. \textcolor{red}{Testtext.}

\begin{align}
1 + 2 &= x\\
y(t) &= \int_0^\infty \sin(\alpha) d\text{t}
\end{align}

Testtext. Testtext. \textbf{Testtext.} Testtext. \textcolor{red}{Testtext.}
\end{frame}

\end{document}

MWE with #Consolas# font

enter image description here

MWE with my #actual# font

enter image description here



Final Solution After Reading the Answers

\documentclass{beamer}
\usefonttheme{professionalfonts}

% Nice sans serif font
% Loads arevtext and arevmath which is not necessary in this case (arevmath would be enough)
\usepackage{arev}

% Here the magic happens
\usepackage[no-math]{fontspec}

% Never without...
\usepackage{mathtools}

% My system font for the main text
%\setsansfont{PorscheNextTT}
\setsansfont{Consolas}

% Should be the Last Font package
% Uses letters and numbers from the main font for math --> very useful
\usepackage[italic]{mathastext}

\begin{document}

\begin{frame}
Testtext. Testtext. \textbf{Testtext.} Testtext. \textcolor{red}{Testtext.}

\begin{align}
1 + 2 &= x\\
y(t) &= \int_0^\infty \sin(\alpha) \mathrm{d}t
\end{align}

Testtext. Testtext. \textbf{Testtext.} Testtext. \textcolor{red}{Testtext.}
\end{frame}

\end{document}

enter image description here

With my Actual Font
enter image description here

Best Answer

I think your best bet is mathastext.

\documentclass{beamer}
\usepackage[no-math]{fontspec}
\setsansfont[Scale=0.9]{DejaVu Sans Mono} % no MS Windows, sorry
\usepackage[italic]{mathastext}
\usepackage{mathtools}
\usepackage{isomath}
\newcommand*\diff{\mathop{}\!\mathrm{d}}

\begin{document}

\begin{frame}
  Testtext. Testtext. \textbf{Testtext.} Testtext. \textcolor{red}{Testtext.}

  \begin{align}
    1 + 2 &= x\\
    y(t) &= \int_0^\infty \sin(\alpha) \diff t
  \end{align}

  Testtext. Testtext. \textbf{Testtext.} Testtext. \textcolor{red}{Testtext.}
\end{frame}

\end{document}

enter image description here

Related Question