5

How could I change the operator font to, let's say, the sans serif style, with the unicode-math package loaded?

The following code only works without that package:

\documentclass{article}
%\usepackage{unicode-math}
\DeclareSymbolFont{sfoperators}{OT1}{cmss}{m}{n}
\SetSymbolFont{sfoperators}{bold}{OT1}{cmss}{b}{n}
\makeatletter
    \renewcommand{\operator@font}{\mathgroup\symsfoperators}
\makeatother

\begin{document}
    $\sin x$
\end{document}
2

I believe that the right way to use a sans serif font for operators with the unicode-math package is the following:

\documentclass{article}

\usepackage{unicode-math}

\ExplSyntaxOn
\makeatletter
\renewcommand{\operator@font}{\um_switchto_mathsf:}
\makeatother
\ExplSyntaxOff

\begin{document}
  $\sin{x}$
\end{document}

This will not work unless you use the unicode-math package. Moreover, you'll have to use xelatex or lualatex.

4

In the next version of unicode-math there'll be an interface for this:

\setmathfontface\mathfoo{texgyrechorus-mediumitalic.otf}
\setoperatorfont\mathfoo

Please speak up if you think there might be a better way to do this :)

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.