3

I would like to use small caps for short text sections in a beamer presentation. In a normal article, the following produces small caps in the TeX Gyre Heros font, as shown in this question:

\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Tex Gyre Heros}
\begin{document}
\textsc{Test text} Test text
\end{document}

while the following beamer document produces a warning and serif small caps:

\documentclass{beamer}
\usefonttheme{professionalfonts}
\usepackage{unicode-math}
\setmainfont{Tex Gyre Heros}
\begin{document}
\begin{frame}
\textsc{Test text} Test text
\end{frame}
\end{document}

with the warning:

LaTeX Font Warning: Font shape `EU2/lmss/m/sc' in size <10.95> not available
(Font)              Font shape `EU2/lmr/m/sc' tried instead on input line 9.

How can I use small caps with unicode-math/fontspec in beamer?

1 Answer 1

5

beamer uses the Sans Serif font as default.

So setting

\setsansfont{TeX Gyre Heros}

instead of

\setmainfont{TeX Gyre Heros}

works for me.

MWE

\documentclass{beamer}
\usefonttheme{professionalfonts}
\usepackage{unicode-math}
\setsansfont{TeX Gyre Heros}
\begin{document}
\begin{frame}
\textsc{Test text} \textsf{Test text}
\end{frame}
\end{document} 

enter image description here

4
  • Thanks! +1 Can you explain how setmainfont interacts with beamer to produce sans-serif font for everything except small caps?
    – darthbith
    Commented Jan 12, 2015 at 19:02
  • @darthbith I'm afraid not... Commented Jan 12, 2015 at 19:04
  • OK guess I have to do some research! Thanks again :-)
    – darthbith
    Commented Jan 12, 2015 at 19:05
  • @darthbith You're welcome. Commented Jan 12, 2015 at 19:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .