3

In beamer, the default font is sans serif. But gb4e will override this default and select a serif font for both the line to be glossed (introduced with \gll) and the glosses. Only the translation line will be sans serif. How can I control the font families chosen by gb4e so that I can get sans serif in every line?

\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}

enter image description here

(My bet is that something like this has been asked before, but I haven't been able to find a duplicate).

3
\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}

enter image description here

5
  • Sorry to interrupt, but how do you change font size for gb4e examples? It doesn't seem to react to what you write in \documentclass.
    – oopcode
    May 15 '17 at 0:28
  • This solution does not allow small caps in the gloss line.
    – Eline
    Sep 22 '21 at 8:58
  • @Eline Latin Modern Sans doesn't have small caps, you will have to use another font. Sep 22 '21 at 9:08
  • @UlrikeFischer, can you suggest a sans serif font with small caps (and preferably IPA)? I see other people have asked (e.g. in comments here) but I haven't seen an answer.
    – Eline
    Sep 23 '21 at 11:47
  • no, sorry. Call (assuming that you have a current texsystem) on a command line albatross 0x025D (or other unicode code point numbers from IPA) , this should give a list of fonts on your system supporting the symbol, and then check the font. Sep 23 '21 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.