0

1.I have located the problem is caused by \rm command;

2.There is warnning log when run in Overleaf:

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.Example:

\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}
7
  • 2
    The command \rm has been deprecated for about 30 years.
    – egreg
    Dec 1, 2022 at 14:09
  • you should not use \rm in latex Dec 1, 2022 at 14:10
  • So is there any substitute for it?@DavidCarlisle@egreg Dec 1, 2022 at 14:13
  • The parentheses aren't part of the formula and there are two of them: ($\alpha\in\symbf{Q}$ and $\alpha\neq0$)
    – egreg
    Dec 1, 2022 at 14:22
  • 1
    \mathrm (\rm isn't even mentioned in the latex manual) Dec 1, 2022 at 14:23

1 Answer 1

2

The command \rm, together with the similar two-letter font commands have been deprecated for about 30 years.

Your input is also semantically wrong: you have a parenthetical condition that consists of two formulas connected by “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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .