I would like to know what the difference is between \mathit
and setting [math-style = TeX]
regarding italics in math mode.
There's a huge difference between (a) loading the unicode-math
package and selecting a math-style
(e.g., "TeX" or "ISO") that employs italics for lowercase Latin and Greek letters and (b) using \mathit
. (Aside: For more information on the math styles provided by the unicode-math
package, see section 5.1 of the package's user guide.)
Using \mathit
operates quite independently of the chosen math style. Using \mathit
can generate outcomes which may be unexpected -- at least at first. This is because the \mathit
directive accesses its letters from the text font, not from the math font. This is by design. According to David Carlisle's comment (see below), \mathit
should be used for multi-letter identifiers, such as the names of variables. For variable names, it's better to use italics from the text font, rather than "true" math-mode italics.
Consider the table below, which shows the four available math styles (ISO, TeX, french, and upright), with lowercase and uppercase Latin and Greek letters. The math font is set to Stix Two Text
, while the text font is set to Calibri
. I chose a sans-serif text font to make the difference between text and math fonts glaringly obvious.
Confirming what I asserted above, observe that the \mathit
output, shown in the final column, does not employ letters from the math font family. Instead, it quite evidently employs letters from the text font family.

\documentclass{article}
\usepackage{array}
\newcommand\myarray[1]{\par\noindent%
% Structure of table:
%col. 1: math style
%col. 2: math mode, lowercase Latin letters
%col. 3: math mode, uppercase Latin letters
%col. 4: math mode, lowercase Greek letters
%col. 5: math mode, uppercase Greek letters
%=col. 6: output of \mathit
$\begin{array}{@{}p{1.2cm} >{$}p{1cm}<{$} *{3}{>{$}p{0.6cm}<{$}} l }
#1 & abcffi & XYZ & \alpha\beta\gamma & \Phi\Psi\Omega
& \mathit{abcffi} \\ % <-- final column uses "\mathit{...}"
\end{array}$}
\usepackage{unicode-math}
\setmainfont{Calibri}[ItalicFont="Calibri Italic"] % sans-serif text font
%% or: \setmainfont{Stix Two Text}
\begin{document}
\setmathfont{Stix Two Math}[math-style = ISO]
\myarray{ISO}
\setmathfont{Stix Two Math}[math-style = TeX]
\myarray{TeX}
\setmathfont{Stix Two Math}[math-style = french]
\myarray{french}
\setmathfont{Stix Two Math}[math-style = upright]
\myarray{upright}
\end{document}
\symit{\rho}
However, it is already the same as\rho
– user2478 Feb 4 '18 at 8:04unicode-math
package provides the directives\symit
("symbol italic") and\symup
("symbol upright"). These directives may be used to override the defaults set by the math style (TeX
,ISO
,french
, orupright
) that's in effect. (The default math style isTeX
.) – Mico Feb 4 '18 at 11:12\symit
not show italic numbers? – Suppboi Feb 5 '18 at 14:55