Give me my fancy math from mathptmx back!

The author of newtxmath also wrote (and actively maintains) the package mathalpha, to easily declare calligraphic, script, fraktur, and blackboard bold math alphabets. With mathalpha, you can get your script X with the following example.

\documentclass{article}
\usepackage{newtxmath}
\usepackage[cal=rsfs]{mathalpha}
\begin{document}
Let \(\mathcal{X}=\{X_1,\ldots,X_n\}\).
\end{document}

By using scr instead of cal, the X will be obtained from the command \mathscr instead of the command \mathcal.


You can get the desired X by loading the mathrsfs ("Ralph Smith's Formal Script") font package and writing \mathscr{X}.

enter image description here

\documentclass{article}
\usepackage{newtxtext,newtxmath}
\usepackage{mathrsfs}
\begin{document}
Let \(\mathscr{X}=\{X_1,\ldots,X_n\}\).
\end{document}

mathptmx uses this font here:

\documentclass{article}
\pagestyle{empty}
\usepackage{newtxmath}
\DeclareMathAlphabet{\mathcal}{OMS}{ztmcm}{m}{n}

\begin{document}
Let \(\mathcal{X}=\{X_1,\ldots,X_n\}\).
\end{document}

enter image description here