我想XCharter
在 beamer 环境中使用字体包,但只有书写是用这种字体,数学环境我无法更改。
对于代码,
\documentclass{beamer}
\usepackage{XCharter}
\begin{document}
\begin{frame}
\frametitle{Sample frame title}
This is some text in the first frame. This is some text in the first frame. This is some text in the first frame.
Math: $f:X \to X$, $\{f^n\}_{n=0}^{\infty}$
\end{frame}
\end{document}
输出为
但在正常文档中,数学环境应该如下图所示。
答案1
\documentclass{beamer}
\usepackage{XCharter}
\usefonttheme{professionalfonts}
\begin{document}
\begin{frame}
\frametitle{Sample frame title}
This is some text in the first frame. This is some text in the first frame. This is some text in the first frame.
Math: $f:X \to X$, $\{f^n\}_{n=0}^{\infty}$
\end{frame}
\end{document}
答案2
如果您使用 lualatex 进行编译,则可以使用该xcharter-otf
包,它还会加载相应的 xcharter 数学字体。这比将 xcharter 文本与计算机现代数学相结合会产生更均匀的结果。
% !TeX TS-program = lualatex
\documentclass{beamer}
\usefonttheme{serif}
\usefonttheme{professionalfonts}
\usepackage{xcharter-otf}
\begin{document}
\begin{frame}
\frametitle{Sample frame title}
This is some text in the first frame. This is some text in the first frame. This is some text in the first frame.
Math: $f:X \to X$, $\{f^n\}_{n=0}^{\infty}$
\end{frame}
\end{document}
如果您更喜欢 pdflatex,您可以使用该mathdesign
包:
\documentclass{beamer}
\usefonttheme{serif}
\usefonttheme{professionalfonts}
\usepackage[bitstream-charter]{mathdesign}
\begin{document}
\begin{frame}
\frametitle{Sample frame title}
This is some text in the first frame. This is some text in the first frame. This is some text in the first frame.
Math: $f:X \to X$, $\{f^n\}_{n=0}^{\infty}$
\end{frame}
\end{document}