\mathit Greek letter will disappear when loading fontspec package

fontspec

I found an answer of \mathit Greek letter: https://tex.stackexchange.com/a/87239/180617

However I found \mathit Greek letter will disappear when loading fontspec package, even if no command like \setmainfont

Here is my mwe:

% compile with xelatex
\documentclass{article}
\usepackage{fontspec}
\begin{document} 
$a +\Sigma + \pi$

$\mathit{a +\Sigma + \pi}$
\end{document}

will output

enter image description here

If I comment \usepackage{fontspec}, it will output

enter image description here

with both xelatex and pdflatex

Why will this happen?

Best Answer

The log will show

Missing character: There is no ^^F (U+0006) in font [lmroman10-italic]:mapping=
tex-text;!

as fontspec sets up \mathit to expect Unicode encoding but \Sigma (unless you load unicode-math) will expect to find Sigma in the legacy 7-bit TeX encoding position.

You can use

\usepackage[no-math]{fontspec}

so that fontspec leaves the math setup untouched, or you could use unicode-math and \symit{\Sigma} to use Unicode fonts throughout.

Related Question