[Tex/LaTex] Why might \sin and \cos be italicized in the output

amsmathitalicmath-modeunicode-math

Introduction

I know that \sin and \cos are supposed to produce non-italicized (operator) output when in math mode.

Oddly, these macros are producing italicized output, as if I had typed sin or cos—that is, without the backslash.

My Question

The unicode-math package seems to be at fault here. What's going on, and why would it override the trig commands?

Minimum Working Example (MWE)

I've got a rather large document, so my MWE includes a few packages that may seem unusual for this MWE. I've stripped it down quite a bit to get what is given below.

Here's the preamble:

\documentclass[10pt,letterpaper,notitlepage,final]{report}
%%##$#% !BIB TS-program = biber
% The above line is REQUIRED -- see http://tex.stackexchange.com/questions/38348/in-texshop-is-there-a-directive-to-select-biber-or-bibtex-on-a-per-document-bas

\usepackage[T1]{fontenc}
\usepackage{lmodern} % better font -- REQUIRED for special unicode characters
\usepackage{unicode-math}  % for \oiint command (also loads fontspec)
\usepackage{amsmath}  % conflicts with \oiint
\usepackage[arrow]{hhtensor}  % for vector and tensor notation
\usepackage{graphicx}   % Allows me to include figures


\begin{document}

Here's an equation:
\begin{equation}
    1 = \cos^2 \theta + \sin^2 \theta
\end{equation}

\end{document}

Best Answer

unicode-math should be loaded after all font-packages (well, packages, that load fonts as well, like amsmath etc.) are loaded, to provide the corresponding changes.

The unicode-math package states (see section 3 Getting started):

Load unicode-math as a regular LATEX package. It should be loaded after any other maths or font-related package in case it needs to overwrite their definitions

\documentclass[10pt,letterpaper,notitlepage,final]{report}
%%##$#% !BIB TS-program = biber
% The above line is REQUIRED -- see http://tex.stackexchange.com/questions/38348/in-texshop-is-there-a-directive-to-select-biber-or-bibtex-on-a-per-document-bas


\usepackage{amsmath}  % conflicts with \oiint
\usepackage[arrow]{hhtensor}  % for vector and tensor notation
\usepackage{graphicx}   % Allows me to include figures
\usepackage{unicode-math}  % for \oiint command (also loads fontspec)

\begin{document}
Here's an equation:
\begin{equation}
    1 = \cos^2 \theta + \sin^2 \theta
\end{equation}

\end{document}

enter image description here

Related Question