latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
239 stars 28 forks source link

How to use NewCMMath-Regular font in our project #605

Open libinxu01 opened 1 year ago

libinxu01 commented 1 year ago

Description

Our project uses TimesNewRomanPS-ItalicMT and TeXGyreTermes-Regular in main font, now we want to use NewCMMath-Regular font for formula ${\mathit v} _x={\mathit v} _0$. Like this: 企业微信20221116-110523 But now is: 企业微信20221116-111257

I wonder how to achieve it ?

Add info or delete as appropriate:

Minimal example demonstrating the issue

\documentclass{article}

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

\everymath{\displaystyle}

\setmainfont[ItalicFont=TimesNewRomanPS-ItalicMT]{TeXGyreTermes-Regular}
\setsansfont{NotoSans}

\setmathfont{TeX Gyre Termes Math}
\setmathfont[range={"221A, "221B, "221C}]{STIX Two Math}
\setmathfont[range={"03C0}]{Times New Roman}
\setmathfont{XITSMath-Regular.otf}
[
BoldFont = XITSMath-Bold,
range={"1D70B, "2605, "2ACB, "2AFD, "23DC, "2A00-"2AFF}
]
%\setmathfont[range="76]{NewCMMath-Regular.otf} % does't work

\DeclareSymbolFont{AMSa}{U}{msa}{m}{n}
\DeclareSymbolFont{AMSb}{U}{msb}{m}{n}
\DeclareSymbolFontAlphabet{\mathbb}{AMSb}
\let\Bbb=\mathbb

\DeclareMathSymbol{\varpropto} {\mathrel}{AMSa}{"5F}
\DeclareMathSymbol{\thicksim}  {\mathrel}{AMSb}{"73}
\DeclareMathSymbol{\thickapprox}    {\mathrel}{AMSb}{"74}
\DeclareSymbolFont{rmlargesymbols}{U}{euex}{m}{n}
\DeclareMathSymbol{\rmintop}{\mathop}{rmlargesymbols}{82}
\newcommand{\rmint}{\displaystyle\rmintop\nolimits}

\begin{document}

${\mathit v} _x={\mathit v} _0$,$x={\mathit v} _0t$

\end{document}
davidcarlisle commented 1 year ago

{\mathit v} _x is very weird markup, \mathit takes an argument so it is equivalent to {\mathit{v}}_x with spurious extra brace group but normally you would use the math italic font so just v_x

Your intention here is not at all clear, why load uncode-math Then use legacy 8-bit fonts such as AMSa and AMSb??

Note this is a bug report tracker not a support forum, you should probably ask at a site such as https://tex.stackexchange.com not here

libinxu01 commented 1 year ago

{\mathit v} _x is very weird markup, \mathit takes an argument so it is equivalent to {\mathit{v}}_x with spurious extra brace group but normally you would use the math italic font so just v_x

Your intention here is not at all clear, why load uncode-math Then use legacy 8-bit fonts such as AMSa and AMSb??

Note this is a bug report tracker not a support forum, you should probably ask at a site such as https://tex.stackexchange.com not here

Thanks, I've asked it in stackexchange and solved.

khaledhosny commented 3 months ago

No unicode-math issue here.