在 中beamer
,默认字体是无衬线字体。但gb4e
将覆盖此默认字体,并为要注释的行(用 引入\gll
)和注释选择衬线字体。只有翻译行将是无衬线字体。我如何控制 选择的字体系列,gb4e
以便在每一行中都获得无衬线字体?
\documentclass{beamer}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono}
\usepackage{gb4e}
\begin{document}
\begin{frame}
\begin{exe}
\ex
\gll f g f g\\ % this appears as serif
f g f g\\ % this appears as serif
\trans f g f g. % this appears as sans serif
\end{exe}
\end{frame}
\end{document}
(我敢打赌,以前也曾有人问过类似的问题,但我没能找到重复的问题)。
答案1
\documentclass{beamer}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono}
\usepackage{gb4e}
\let\eachwordone=\sffamily %or \normalfont
\let\eachwordtwo=\sffamily
\begin{document}
\begin{frame}
\begin{exe}
\ex
\gll f g f g\\ % this appears as serif
f g f g\\ % this appears as serif
\trans f g f g. % this appears as sans serif
\end{exe}
\end{frame}
\end{document}