0

How can an italic print of the font helvetica be achieved in the Beamer class?

Here is my MWE:

\documentclass[a4paper,11pt,fleqn]{beamer}
\usepackage[ngerman,english]{babel} % language listed last is default setting
\usepackage{fontspec} % load 'fontspec' when using XeLaTeX or LuaLaTeX

\usepackage{helvet}

\usetheme{Berlin}

\begin{document}

\begin{frame}
\textit{hello} \protect{\textit{hello}} hello 
\end{frame}

\end{document}

No matter what I do, the output is not italic. I have tried adding

\newcommand{\italnum}[1]{\begingroup\fontfamily{phv}\itshape#1\endgroup}

after the definition of the documentclass but this does not seem to work. Any ideas?

5
  • Are you sure that helvet provides other than a sans-serif family font? I always thought it did not.
    – Moriambar
    Nov 4, 2015 at 19:26
  • Don't use helvet together with lualatex or xelatex. Nov 4, 2015 at 19:28
  • Hey Ulrike. Is there any way to fix this that allows me to use both xelatex and helvet? I've tried using \usepackage[applemac]{inputenc} in combination with pdflatex instead and it works, but it completely changes the appearance of the font :/ Nov 4, 2015 at 19:40
  • @ilFuria: italic helvetica definitely works in the scrbook class (I believe all other classes as well) even in combination with xelatex, so I don't see why it shouldn't also work in beamer? Nov 4, 2015 at 19:43
  • @Sebastian_92 I tried with the article class and pdfLaTeX, and only when I use sans serif the text gets printed in other than Computer Modern. Maybe I'm missing something.
    – Moriambar
    Nov 4, 2015 at 19:45

1 Answer 1

2

Don't use helvet with xelatex and lualatex, use e.g. the tex gyre heros font:

\documentclass[a4paper,11pt,fleqn]{beamer}
\usepackage[ngerman,english]{babel} % language listed last is default setting
\usepackage{fontspec} % load 'fontspec' when using XeLaTeX or LuaLaTeX

\setsansfont{TeX Gyre Heros}

\usetheme{Berlin}

\begin{document}

\begin{frame}
\textit{hello} \protect{\textit{hello}} hello
\end{frame}

\end{document}

enter image description here

3
  • I get an error saying the font cannot be found: ! fontspec error: "font-not-found" ! ! The font "TeX Gyre Heros" cannot be found. ! ! See the fontspec documentation for further information. Nov 4, 2015 at 19:45
  • 1
    Would you care to explain why helvetica can be used in combination with xelatex in the scrbook class, but not in beamer?? I don't really get why this is an issue. Nov 4, 2015 at 19:47
  • 1
    helvet is not suited for xelatex, regardless of the class. I have no idea what you did in the scrbook document to get the impression that it works. The tex gyre font should be part of every current tex system, but perhaps you need to install it. Nov 4, 2015 at 19:59

You must log in to answer this question.

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