定理环境中的字体问题

定理环境中的字体问题

我使用和LuaLaTeX数学字体。此外,我遇到了定理环境和长标题的问题,因此我的解决方案基于fontspecXITS。我的问题是,当我使用可选名称时,现在会得到不同的字体\mathcal{S}。有什么想法吗?

\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}

答案1

似乎向首领ntheorem发出了命令,你不要用团体来保护。如果你在定理的主体中说,这一点是显而易见的。\mathversion{bold}$\mathcal{S}=a+b$

使用时只需在样式定义中添加括号即可\theorem@headerfont

\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

\usepackage{thmtools}

\declaretheorem[
  style=Myplain,
  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}=a+b$.
\end{theorem}

\begin{theorem}
Unnamed theorem $\mathcal{S}$.
\end{theorem}

\end{document}

在此处输入图片描述

相关内容