The two letter font commands are deprecated, and have been replaced. Your second attempt was on the right track but you needed to use \bfseries
instead of \bf
. But also the syntax of TeX \let
only allows a single token after the =
; to do what you want you should use the LaTeX \renewcommand
instead.
Furthermore, if you want to change the font of the translation line also, you will need to use a different method, since gb4e
provides no built-in hook for that. In the example below I've used the \pretocmd
from the etoolbox
package to modify the \glt
macro (whose synonym is \trans
).
\documentclass{beamer}
\usepackage{gb4e}
\usepackage{etoolbox}
\renewcommand{\eachwordone}{\rmfamily\bfseries}
\pretocmd{\glt}{\rmfamily}{}{}
\begin{document}
\begin{frame}
\begin{exe}
\ex{
\gll This is the first line\\
This is the second line\\
\glt This is the translation
}
\label{ex}
\end{exe}
\end{frame}
\end{document}
Personally, however, I would not mix serif and sans serif fonts in a beamer
presentation, so a simpler way would be just to use \usefonttheme{serif}
and then define just \eachwordone
to be \bfseries
:
\documentclass{beamer}
\usefonttheme{serif}
\usepackage{gb4e}
\renewcommand{\eachwordone}{\bfseries}
\begin{document}
\begin{frame}
\begin{exe}
\ex{
\gll This is the first line\\
This is the second line\\
\glt This is the translation
}
\label{ex}
\end{exe}
\end{frame}
\end{document}
If you would prefer all the text to be in the sans serif font to match the default beamer
fonts, you will need to change each of the macros that determine the font for the gloss lines. These are \eachwordone
, \eachwordtwo
and \eachwordthree
. So to get all gloss lines in sans serif you add
\renewcommand{\eachwordone}{\sffamily}
\renewcommand{\eachwordtwo}{\sffamily}
\renewcommand{\eachwordthree}{\sffamily}