Beamer 和 Polyglossa 字体命令兼容性?

Beamer 和 Polyglossa 字体命令兼容性?

使用文档类时,以下文档可以正常工作article

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[variant=british]{english}
\setotherlanguage{hebrew}
\setotherlanguage{greek}
\newfontfamily\hebrewfont{SBL Hebrew}
\newfontfamily\greekfont{SBL Greek}
\begin{document}

\section{First}
A greek word \textgreek{αταραξία} and a hebrew word \texthebrew{קֹהֶלֶת}

\end{document}

但是当我切换到 Beamer 时,它似乎开始忽略字体(我们最终得到的是空白字符,而不是希腊语或希伯来语):

\documentclass{beamer}
\usepackage{polyglossia}
\setmainlanguage[variant=british]{english}
\setotherlanguage{hebrew}
\setotherlanguage{greek}
\newfontfamily\hebrewfont{SBL Hebrew}
\newfontfamily\greekfont{SBL Greek}
\begin{document}

\begin{frame}{First}
A greek word \textgreek{αταραξία} and a hebrew word \texthebrew{קֹהֶלֶת}
\end{frame}

\end{document}

输出: 在此处输入图片描述

请注意,我们可以添加\setsansfont{Arial}到 beamer 示例中,它似乎全局地告诉 beamer 使用该Arial字体,而不是已指定的希伯来语/希腊语字体:

在此处输入图片描述

答案1

\documentclass{beamer}
\usepackage{polyglossia}

\setmainlanguage[variant=british]{english}
\setotherlanguage{hebrew}
\setotherlanguage{greek}

\newfontfamily{\hebrewfontsf}{SBL Hebrew}
\newfontfamily{\greekfontsf}{SBL Greek}
\begin{document}

\begin{frame}{First}

A greek word \textgreek{αταραξία} and a hebrew word \texthebrew{קֹהֶלֶת}

\end{frame}

\end{document}

在此处输入图片描述

相关内容