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.

1
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.