0
\documentclass[a4paper,12pt]{article}

\usepackage{fontspec}
\setmainfont{Latin Modern Sans}

\begin{document}
$\mathrm{Bluefox}$ Bluefox
\end{document}

Produces two "Bluefox"s that look identical and are in Latin Modern Sans. I basically want to redefine \mathrm, but doing so doesn't seem to work. I've also tried importing a font with \newfontfamily (Latin Modern Roman) and using that in math mode but it only works outside of math mode.

  • Welcome to TeX.SE! Maybe https://tex.stackexchange.com/questions/11058/how-do-i-change-the-math-italic-font-in-xetex-fontspec can give you some pointers? – Marijn Mar 25 '19 at 08:48

1 Answers1

0

You can set \mathrm to another font like this:

\documentclass[a4paper,12pt]{article}

\usepackage{fontspec}
\setmainfont{Latin Modern Sans}
\setmathrm{Latin Modern Roman}
\begin{document}
$\mathrm{Bluefox}$ Bluefox
\end{document}

enter image description here

Ulrike Fischer
  • 327,261