如何单独使用“Noto Math”字母?

如何单独使用“Noto Math”字母?

在此处输入图片描述

\uppi其中有像“Noto Math”中的直立希腊字母。

我想使用它,但不是通过newtxmath

我找不到有关“Noto Sans Math RM”的 vf 文件,只找到“Noto Sans Math MI”(斜体数学)。

如何找到“RM”并直接使用?也就是说,在MWE之后,字体NotoSans-TLF应该替换为Noto Sans Math RM,这个问题就解决了。谢谢!

\documentclass[12pt]{beamer}

\usefonttheme{professionalfonts}
\usepackage[T1]{fontenc}

% \usepackage[notosans]{newtxmath} % not through it

\DeclareSymbolFont{letters}{OML}{notosansmi}{m}{it}
\SetSymbolFont{letters}{bold}{OML}{notosansmi}{b}{it}
\DeclareMathAlphabet{\mathbold}{OML}{notosansmi}{b}{it}

\DeclareSymbolFont{operators}{OT1}{NotoSans-TLF}{m}{n}
\SetSymbolFont{operators}{bold}{OT1}{NotoSans-TLF}{bx}{n}
\DeclareMathAlphabet{\mathbf}{OT1}{NotoSans-TLF}{bx}{n}
\DeclareMathAlphabet{\mathit}{OT1}{NotoSans-TLF}{m}{it}
\SetMathAlphabet\mathit{bold}{OT1}{NotoSans-TLF}{bx}{it}

\begin{document}
\frame{
\Huge
\[ \lim_{n\to\infty}\frac{n!}{\Big(\dfrac{n}{\mathrm e}\Big)^n\sqrt{2\uppi n}} =1 \]
vs
\[ \lim_{n\to\infty}\frac{n!}{\Big(\dfrac{n}{\mathrm e}\Big)^n\sqrt{2\pi n}} =1 \]
}
\end{document}

答案1

在 Unicode 中更容易,具有包range=选项unicode-math(使用 xelatex\lualatex 进行编译)。

π

平均能量损失

\documentclass[12pt]{beamer}
\usepackage{xcolor}
\usefonttheme{professionalfonts}
\usepackage{unicode-math}
\setmainfont{Noto Serif}
\setmathfont{TexGyrePagellaMath}[Colour=blue]
\setmathfont{Noto Sans Math}[range={"03C0,"1D70B},Colour=red]

\begin{document}
\frame{
\Huge
\[ \lim_{n\to\infty}\frac{n!}{\Big(\dfrac{n}{\symup{e}}\Big)^n\sqrt{2\uppi n}} =1 \]
vs
\[ \lim_{n\to\infty}\frac{n!}{\Big(\dfrac{n}{\mathrm e}\Big)^n\sqrt{2\pi n}} =1 \]
}
\end{document}

\uppi确实可以工作并产生直立的 pi,但是Noto Sans Math就 Open Type 字体功能而言,字体不是数学字体。

一种解决方案是加载占位符字体(这里任意为 TeX Gyre Pagella Math)并从 Noto Sans Math 加载一个范围。

或者:从 Noto Sans Math 加载所有内容:

所有 pi

平均能量损失

\documentclass[12pt]{beamer}
\usepackage{xcolor}
\usefonttheme{professionalfonts}
\usepackage{unicode-math}
\setmainfont{Noto Serif}
\setsansfont{Noto Sans}
\setmathfont{TeXGyrePagellaMath}[Colour=blue]
\setmathfont{Noto Sans Math}[range={it/{num,latin}->sfup,
it/{greek}->up,
up/{greek},
up/{num,latin}->sfup,
},
Colour=red]

\begin{document}
\frame{
\Huge
\[ \lim_{n\to\infty}\frac{n!}{\Big(\dfrac{n}{\symup{e}}\Big)^n\sqrt{2\uppi n}} =1 \]
vs
\[ \lim_{n\to\infty}\frac{n!}{\Big(\dfrac{n}{\mathrm e}\Big)^n\sqrt{2\pi n}} =1 \]
}
\end{document}

或者根据需要任意组合范围/字体。

相关内容