使用文档类时,以下文档可以正常工作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}