How can I get a less-curly \mathcal{T} with xelatex?

I'm compiling the following document with pandoc:

$\mathcal{T}$


using this command line:

pandoc -s --from markdown --to latex -o foo.pdf <(echo 'foo: $\mathcal{T}$')


If I use xelatex (--pdf-engine xelatex), the result looks like this:

but with pdflatex (the default, or --pdf-engine pdflatex), it looks like this:

I'd like to be using xelatex if I can, but I prefer the result from pdflatex here – what's causing the difference, and is there a way to make xelatex output mathcal letters that are more like those produced by pdflatex?

• Welcome to TeX.SX! If you want to stick with the classical Computer Modern \mathcal while using XeLaTeX, you can try \let\mathcal\relax\usepackage[cal=cm]{mathalfa}. Oct 16, 2018 at 18:46
• Your issue would appear to be related more to pandoc than to xelatex. For sure, the simple program \documentclass{article} \begin{document} $\mathcal{T}$ \end{document} produces the exact same output under pdflatex, xelatex, and lualatex, viz., the non-curly variety of the caligraphic letter.
– Mico
Oct 16, 2018 at 19:23
• xelatex uses unicode-math and so latin modern math. It is a design decision of the font designer to make the mathcal more curly. See tex.stackexchange.com/questions/385489/… Oct 16, 2018 at 20:05

The more curly “T” is from the OpenType version of Latin Modern: Latin Modern Math (OTF), version 1.959. As @UlrikeFischer explained in this answer, this was a design choice.

Assuming the following is what happened with you current situation:

% !TeX program = XeLaTeX
\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$\mathcal{T}$ % <- This produces the more curly calligraphic script
\end{document}


To get the classical Computer Modern calligraphic script back, without the need to search the font name and to learn about font declaration, you may consider using the mathalfa package:

% !TeX program = XeLaTeX
\documentclass{article}
\usepackage{unicode-math}
\let\mathcal\relax % <- Just in case (This is usually unnecessary).
\usepackage[cal=cm]{mathalfa}
\begin{document}
$\mathcal{T}$ % <- Classical Computer Modern calligraphic script
\end{document}