How does one set the font for text inside a math environment? If I use \setmathsfont(Latin){FontName}, I can change the font for individual letters in the math environment, but not for functions such as \sin. (These aren't controlled by the set "Symbols" either.)
Here's a MWE:
\documentclass[a4paper,12pt]{article}
\usepackage[MnSymbol]{mathspec}
\usepackage[no-sscript]{xltxtra}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Times}
\setmathsfont(Digits){Times}
\setmathsfont(Latin){Times}
%\setmathsfont(Symbols){Times}
\begin{document}
Some text digits 1, 2, 3 and some math digits $1, 2, 3$.
Some italic text \textit{text}, and some math text $text$.
But, we have \textit{sin x} and $\sin x$. Or, \textit{arctan x} and $\arctan x$.
\end{document}
Best Answer
You have to do
\setmathrm
; here I use TeX Gyre Termes, but what font you're using is irrelevant.If you have a recent and updated TeX Live, you can also use the new TG Termes Math font with
unicode-math
:This is actually much better than
mathspec
, because the math font has the right parameters for being used in formulas.