文章和投影机中的方程格式之间的差异

文章和投影机中的方程格式之间的差异

我想在文章中复制以下 beamer 文档的数学样式。但是,当我切换文档类别时,公式的格式(使用的字体)会发生变化。我想将 Pagella 字体的某些方面(如和和积分等符号)与 Liberation Serif 结合起来(如第一张图片所示),但在文章类别(第二张图片)中,字母(例如 p)似乎是用 Pagella 而不是 Liberation Serif 排版的。我该如何修复此问题以在文章中复制 beamer 格式?在此处输入图片描述 在此处输入图片描述

\documentclass[serif]{beamer}
\usepackage[utopia]{mathdesign}
\usepackage[no-math]{fontspec}
\setmainfont{Liberation Serif}
\usepackage{unicode-math}
\setmathfont[Ligatures=TeX]{texgyrepagella-math.otf}
\begin{document}
\begin{frame}
\frametitle{Bernoulli Distribution}
\begin{itemize}
 \item Probability mass function
       \[ p_X(x) = p^{x}(1-p)^{\! 1-x}, \qquad x \in \lbrace 0,1\rbrace, \qquad 0 \leq p \leq 1 \]
\end{itemize}
\end{frame}
\end{document}

答案1

默认情况下,beamer 将使用文本字体中的字母进行数学运算。您可以使用主题关闭此替换professionalfonts

% !TeX TS-program = lualatex

\documentclass{beamer}
\usefonttheme{serif}
\usefonttheme{professionalfonts}
\usepackage[utopia]{mathdesign}
\usepackage[no-math]{fontspec}
\setmainfont{Liberation Serif}
\usepackage{unicode-math}
\setmathfont[Ligatures=TeX]{texgyrepagella-math.otf}
\begin{document}
\begin{frame}
\frametitle{Bernoulli Distribution}
\begin{itemize}
 \item Probability mass function
       \[ p_X(x) = p^{x}(1-p)^{\! 1-x}, \qquad x \in \lbrace 0,1\rbrace, \qquad 0 \leq p \leq 1 \]
\end{itemize}
\end{frame}
\end{document}

在此处输入图片描述

相关内容