-1

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?

  • Are you sure that helvet provides other than a sans-serif family font? I always thought it did not. – Moriambar Nov 4 '15 at 19:26
  • Don't use helvet together with lualatex or xelatex. – Ulrike Fischer Nov 4 '15 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 :/ – Sebastian_92 Nov 4 '15 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? – Sebastian_92 Nov 4 '15 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 '15 at 19:45
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

  • 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. – Sebastian_92 Nov 4 '15 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. – Sebastian_92 Nov 4 '15 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. – Ulrike Fischer Nov 4 '15 at 19:59

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.