1

enter image description here

There is the upright greek letter like \uppi in "Noto Math".

I want use it, but not through newtxmath package

I can't find the vf file about "Noto Sans Math RM", just find "Noto Sans Math MI" (italic math).

How to find "RM" and use it directly? In other word, at MWE after, font NotoSans-TLF should be replaced by Noto Sans Math RM, this question will be done. Thank you!

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

poorich
  • 613

1 Answers1

1

Easier in Unicode, with the range= option of unicode-math package (compile with xelatex\lualatex).

pi

MWE

\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 certainly works and produces an upright pi, but Noto Sans Math font is not a math font in terms of Open Type font features.

One solution is to load a placeholder font (here, arbitrarily, TeX Gyre Pagella Math) and load a range from Noto Sans Math.

Or: load everything from Noto Sans Math:

all pi

MWE

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

Or any combination of ranges/fonts as desired.

Cicada
  • 10,129
  • ok, it's a good way. I found the font include \uppi, its name is NotoSansMathRM, can we directly to use \uppi? Also not through unicode-math, using some command like \DeclareSymbolFont, \DeclareMathSymbol? – poorich Mar 13 '22 at 11:04