# How to use OpenType Latin Modern Roman in \mathrm?

Running the following MWE

\documentclass{article}
\begin{document}
Test $\mathrm{VARfi}$
\end{document}


using XeLaTeX or LuaLaTeX, I observed that Test was rendered in OpenType Latin Modern Roman while VAR was rendered in TFM-based Computer Modern Roman. Is it possible to change \mathrm to use OpenType Latin Modern Roman?

\usepackage{fontspec}

• Hmm… No. I’ll admit that this is a trick question: The kerning between V and A and the fi ligature will both disappear, and therefore the result is not the full OpenType Latin Modern Roman. – Ruixi Zhang Oct 22 at 4:00
• @RuixiZhang - In addition to loading the fontspec package, one also needs to execute \setmainfont{Latin Modern Roman} to get your desired outcome, viz., kerning between V and A and the fi ligature. – Mico Oct 22 at 4:45