5

I'm trying to change the font of math operators (\sin, \limsup, etc.) to Adobe Garamond Pro, which I'm loading via fontspec for use with LuaTeX. I've tried modifying this code by egreg as follows:

\documentclass[letter]{article}
\usepackage{fontspec}
\setmainfont{Adobe Garamond Pro}

% egreg code \DeclareSymbolFont{garamondOperators}{OT1}{"Adobe Garamond Pro"}{m}{n} \SetSymbolFont{garamondOperators}{bold}{OT1}{"Adobe Garamond Pro"}{b}{n}

\makeatletter \renewcommand{\operator@font}{\mathgroup\symgaramondOperators} \makeatother

% Test code \begin{document} $\sup$

sup \end{document}

The math operators display in Computer Modern even when I enclose the font name with quotation marks. Do I need to import Adobe Garamond Pro and assign it its own name within the preamble in order for it to be recognizable by \DeclareSymbolFont?

EDIT: It turns out that the problem was caused by my use of lmodern in conjunction with fontspec. Without lmodern, everything works flawlessly.

Rations
  • 153
  • 6

1 Answers1

3

You need no special code:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Futura} % a very distinctive one

\begin{document}

Math: $\sup$

Text: sup

\end{document}

I changed the font because I don't have Adobe Garamond Pro, but it's the same.

enter image description here

egreg
  • 1,121,712
  • You're right. It turns out that my problem was caused by the lmodern package, which I had loaded at the top of the preamble. Do you know why this might be? – Rations Nov 26 '16 at 16:09
  • @Rations The lmodern package should not be loaded along with fontspec. – egreg Nov 26 '16 at 16:11