数学模式下的符号命令已禁用

数学模式下的符号命令已禁用

1.我已定位到该问题是由\rm命令引起的;

2.运行时有warning日志背页

Package fontspec Warning: Font "Times New Roman" does not contain requested Script "Math".

 
‪./name.tex‬
Package fontspec Warning: OpenType feature 'Style=MathScript' (ssty) not available for font 'Times New Roman' with script '' and language 'Default'.

 
‪./name.tex‬
Package fontspec Warning: OpenType feature 'Style=MathScriptScript' (ssty) not available for font 'Times New Roman' with script '' and language 'Default'.

3.示例:

\usepackage[no-math]{fontspec}
\showoutput
\setmainfont{Times New Roman}


\RequirePackage[bold-style=ISO, mathbf=sym]{unicode-math}
\setmathfont{TeX Gyre Termes Math}
\setmathfont{XITSMath-Regular}[range={"1D70B, "2605, "2ACB, "2AFD, "23DC}]
\setmathfont{STIX Two Math}[range={"221A, "221B, "221C}]
\setmathfont{Times New Roman}[range={"03C0}]
\setmathfont{XITSMath-Regular}[range={"2A00-"2AFF}]
\DeclareMathAlphabet{\mathit}{TU}{lmr}{m}{it}
\begin{document}

$(\alpha \in  \rm\mathbf Q\ and \  \alpha != 0)$\par

\end{document}

答案1

该命令\rm以及类似的双字母字体命令已被弃用约 30 年。

您的输入在语义上也是错误的:您有一个由两个通过“and”连接起来的公式组成的括号条件。

\documentclass{article}

\usepackage[no-math]{fontspec}
\usepackage[bold-style=ISO, mathbf=sym]{unicode-math}

\setmainfont{Times New Roman}
\setmathfont{TeX Gyre Termes Math}
\setmathfont{XITSMath-Regular}[range={"1D70B, "2605, "2ACB, "2AFD, "23DC}]
\setmathfont{STIX Two Math}[range={"221A, "221B, "221C}]
%\setmathfont{Times New Roman}[range={"03C0}] % <--- Why?
\setmathfont{XITSMath-Regular}[range={"2A00-"2AFF}]

%\DeclareMathAlphabet{\mathit}{TU}{lmr}{m}{it} % <--- Why?

\begin{document}

($\alpha \in  \symbf{Q}$ and $\alpha \neq 0$)

\end{document}

在此处输入图片描述

相关内容