1

Why doesn't serif fonts work when using beamer with xelatex and fontspec? (I my case!)

When I use standard LaTeX fonts with pdflatex I get the desired result: a presentation with serif fonts only (mwe 1)

When I use xelatex (fontspec, Minion Pro font, danish) I get titles and some parts serif, most of the text ends up as sans serif?

Two minimal examples: 1. compile with pdflatex Two minimal examples:

\documentclass{beamer}

\usetheme[red]{Verona}
\usefonttheme{serif}
\usefonttheme{professionalfonts}

\title{Test af Serif}
\subtitle{sammen med Verona}
\author{Soeren Christensen}
\institute{Oerum sogn}
\date{1. januar 2018}

%\mode<presentation>

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

%\section*{Program}
%\begin{frame}
%  \frametitle{Program}
%  \tableofcontents%[pausesections]
%\end{frame}

\section{Rammen}

\begin{frame}
        \frametitle{Titel paa slide}
        \framesubtitle{undertitel}

        \begin{quotation}[Joh 3,16]
            For saaledes elskede Gud verden, at han gav sin enbaarne
            soen, for at enhver, der tror paa ham, ikke skal fortabes
            med have evigt liv.
        \end{quotation}

\end{frame}
\end{document}

example 2 (compile with xelatex):

\documentclass{beamer}
\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage{danish}

\usetheme[red]{Verona}
\usefonttheme{serif}
\usefonttheme{professionalfonts}

\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\setromanfont[Numbers=Lowercase]{Minion Pro}
\setsansfont[Numbers=Lowercase]{Myriad Pro}
\setmonofont{Menlo}

\title{Test af Serif}
\subtitle{sammen med Verona}
\author{Soeren Christensen}
\institute{Oerum sogn}
\date{1. januar 2018}

%\mode<presentation>

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\section{Rammen}

\begin{frame}
        \frametitle{Titel paa slide}
        \framesubtitle{undertitel}

        \begin{quotation}[Joh 3,16]
            For saaledes elskede Gud verden, at han gav sin enbaarne
            soen, for at enhver, der tror paa ham, ikke skal fortabes
            med have evigt liv.
        \end{quotation}

\end{frame}
\end{document}
1

You can force beamer to use serif fonts with \AtBeginDocument{\rmfamily}.

% !TeX TS-program = xelatex

\documentclass{beamer}
\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage{danish}

\usetheme[red]{Verona}
\usefonttheme{serif}
\usefonttheme{professionalfonts}

\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
\setromanfont[Numbers=Lowercase]{Minion Pro}
\setsansfont[Numbers=Lowercase]{Myriad Pro}
\setmonofont{Menlo}


\title{Test af Serif}
\subtitle{sammen med Verona}
\author{Soeren Christensen}
\institute{Oerum sogn}
\date{1. januar 2018}

%\mode<presentation>

\AtBeginDocument{\rmfamily}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\section{Rammen}

\begin{frame}
        \frametitle{Titel paa slide}
        \framesubtitle{undertitel}

        \begin{quotation}[Joh 3,16]
            For saaledes elskede Gud verden, at han gav sin enbaarne
            soen, for at enhver, der tror paa ham, ikke skal fortabes
            med have evigt liv.
        \end{quotation}

\end{frame}
\end{document}

enter image description here

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.