在我的 中beamer
,我应用了“ \setmainfont{Arial}
”和“ \setsansfont{Arial}
”将主字体设置为 Arial,我想在数学模式中应用相同或类似的字体。我编写了以下 LaTeK 代码,感谢使用 Helvetica 在数学模式下使用波浪符号。
但是即使可以生成pdf文件,运行代码的时候也会出现很多错误。
和\partical
无法显示“ ”。
我应该使用其他字体吗?我只想使用一种看起来像 Arial 的数学字体,并且对希腊字母也有影响,如“ \alpha
”或“ \varepsilon
”。
\documentclass[10 pt]{beamer}
\usepackage{amsmath, amssymb}
\setmainfont{Arial}
\setsansfont{Arial}
\numberwithin{equation}{section}
\usepackage{mathtools}
\usepackage{iftex}
\usepackage[ngerman]{babel}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[scaled=0.92]{helvet}
\usepackage[helvet]{sfmath}
\renewcommand{\familydefault}{\sfdefault}
\else
\usepackage{unicode-math}
\setmainfont{Arial}
\defaultfontfeatures{Scale=MatchUppercase}
\setsansfont{Arial}
%% Change this line to change the math symbols:
\setmathfont{Asana Math}
%% Set various (but not all) Unicode tilde symbols:
\setmathfont[range={"007E,"02DC,"02F7,"0303,"0330,"0334,"033F,"034A,"0360}]{TeX Gyre DejaVu Math}
%% Set the math alphabets:
\setmathfont[range=up]{Arial}
\setmathfont[range=it]{Arial Italic}
\setmathfont[range=bfup]{Arial Bold}
\setmathfont[range=bfit]{Arial Bold Italic}
\newcommand*{\dif}{\mathrm{d}}
\newcommand*{\N}{\mathrm{N}}
\begin{decument}
\begin{frame}
The equations were presented as
\begin{align}
&y_{i} = \beta_{1}x_{i, 1} + \beta_{2}\sin(x_{i, 2}) + \beta_{3}\ln(x_{i, 3}) + \varepsilon_{i} \quad \Phi(x) = 1-\Phi(-x) \\
&\dfrac{\dif y}{\dif x} = e^{x} \quad \dfrac{\partial u}{\partial t}\bigg|_{t=0} = t \quad \oint_{|C|=1} f(z) \dif z = 2\pi i \times \left\lbrace \mathrm{res}[f(z), i] \right\rbrace \\
&x_{n} \iid \N(0, 1) \quad x^{2}_{n} \iid \chi^{2}(1) \quad \sum_{n=1}^{N} x_{n} \iid \chi^{2}(N) \\
&\iint_{R} g(x,y)\dif x\dif y= \int_{0}^{1}\dif x \int_{0}^{1}g(x,y)\dif y \quad \lim\limits_{\rho \to 0}h(\rho) = 0\left( \dfrac{1}{\alpha} \right) \\
& x =\begin{cases}
1, \mathcal{H}_{0}\\
0, \mathcal{H}_{1}
\end{cases}\; (2\pi L(x;\mu,\sigma^{2}) = \sigma^{2})^{-\frac{N}{2}}\exp\left\lbrace -\dfrac{\sum_{n=1}^{N}(x_{n} - \mu)^{2}}{2\sigma^{2}} \right\rbrace
\end{align}
\end{frame}
\end{document}