# How to display math operators not in italic?

I'm trying to write the following equation:

\rho = \max \left\{ \frac{|\mathbf{w} \cdot \mathbf{x^{(i)}} + b|}{\|\mathbf{w}\|} \right\}


but the PDF output renders the math operator \max in italic instead of upright. I've tried the same with \log and \cos, and they behave just the same. What am I doing wrong here?

Document class: memoir

Packages: pgf, fontspec, graphicx, microtype, unicode-math, amsmath

The following code reproduces the problem in different systems:

\documentclass{memoir}
\usepackage{unicode-math}
\usepackage{amsmath}
\begin{document}
Yay, a dual problem:
$$\max_{\mathbf{\alpha}} \left\{ \sum_{i=1}^m \alpha{(i)} \right\}$$
\end{document}

• welcome to tex.sx. i'm afraid we don't have enough information to guess what the problem is, since the code you show looks correct. please provide a small compilable example that produces the unwanted result, starting with \documentclass and ending with \end{document} so that we can test it. – barbara beeton Oct 18 '16 at 16:25
• Probably it is effect of document class you are using. – Sigur Oct 18 '16 at 16:32
• Please tell us which document class you use, and do tell us if you load any math-related packages. – Mico Oct 18 '16 at 16:49
• Sorry for that, I've added some info to the post. – soldeace Oct 18 '16 at 17:01
• stop making everyone guess! it is impossible to help as you have shown no code that could account for the described behaviour. Make a small 5 or 6 line document, complete from \documentclass to \end{document} that has the problem, then people can easily reproduce and debug it. – David Carlisle Oct 18 '16 at 17:46

The solution: Load the amsmath package before the unicode-math package. (I think this is mentioned in the user guide of the unicode-math package...)