I use LuaLaTeX
, fontspec
and XITS
maths font. Additionally, I had a problem with theorem environment and long headers so I based my solution on this. My problem is that I now get a different font for the \mathcal{S}
when I use optional name. Any ideas why?
\documentclass{article}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage[math-style=ISO]{unicode-math}
\setmathfont{XITS Math}
\setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{XITS Math}
\usepackage[thmmarks,amsmath,amsthm,hyperref]{ntheorem}
\makeatletter
\newtheoremstyle{Myplain}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2.\theorem@separator]}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2]\theorem@headerfont (##3).\theorem@separator\normalfont\itshape}
\newtheoremstyle{nonumberMyplain}%
{\item[\theorem@headerfont\hskip\labelsep ##1\theorem@separator]}%
{\item[\theorem@headerfont\hskip \labelsep ##1]\theorem@headerfont (##3).\theorem@separator\newline\normalfont\itshape}
\makeatother
\theoremstyle{Myplain}
\usepackage{thmtools}
\declaretheorem[numberwithin=section]{theorem}
\begin{document}
\section{Title}
\begin{theorem}[A a a very very very very long long name theorem theorem name name]
A named theorem $\mathcal{S}$.
\end{theorem}
\begin{theorem}
Unnamed theorem $\mathcal{S}$.
\end{theorem}
\end{document}