2

As the title says, I want to use both mathpazo and eulervm in a Beamer presentation. I've tried to replicate what seems to work for the article document class, which is to write

\usepackage{mathpazo}
\usepackage{eulervm} 

and then adding

\usefonttheme{serif}

Concretely, here's my code:

\documentclass[11pt]{beamer} 
\usefonttheme{serif}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage{euler}


\title{Test Title}

\begin{document}
\begin{frame}[plain]
    \maketitle
    This is rendered in mathpazo. However, what follows is not eulervm.
    \begin{theorem} If $V$ and $W$ are two finite dimensional $\mathbb{K}$-vector spaces and $f : V \to W$ is a linear transformation, then
    \[
    \dim V = \dim \ker f + \dim \operatorname{im} f.
    \]  
    \end{theorem}
\end{frame}
\end{document}

However, this fails to implement eulervm in math mode (which, by the way, works just fine if I ommit including mathpazo) as the image shows,

enter image description here

In this an expected behaviour or am I missing something? And in case it is the former, are there any workarounds available?

Any help is greatly appreciated.

1
  • @Davislor your comments are very interesting and of great help. Would you mind making them into an answer?
    – qualcuno
    Aug 1, 2019 at 14:18

2 Answers 2

1

Guido’s self-answer already solves the technical problem he was having. As he requested, though, I’ll move my comments into a supplementary answer.

There are modern alternatives to mathpazo + eulervm that provide a more comprehensive and cohesive repertoire of symbols, and are compatible with a wider variety of packages.

With Legacy Fonts

One that is compatible with PDFTeX and Type 1 fonts is the eulerpx package. This combines AMS Euler with newpxmath and is still being maintained.

\documentclass[11pt]{beamer} 
\usepackage[T1]{fontenc}
\usefonttheme{serif}
\usefonttheme{professionalfonts}
\usepackage{amsmath, tgpagella, eulerpx, eucal, eufrak}

\title{Test Title}

\begin{document}
\begin{frame}[plain]
    \maketitle
    This is rendered in newpx, with math from eulerpx.
    \begin{theorem} If $V$ and $W$ are two finite dimensional $\mathbb{K}$-vector spaces and $f : V \to W$ is a linear transformation, then
    \[
    \dim V = \dim \ker f + \dim \operatorname{im} f.
    \] 
    Also, \(\mathcal{C}\) and \(\mathfrak{F}\). 
    \end{theorem}
\end{frame}
\end{document}

Pagella + eulerpx sample

You can load additional fonts if you need them. That example loaded Euler Script and Euler Fraktur as \mathcal and \mathfrak. You could instead set up your math alphabets with mathalpha. If you want to also use a sans-serif font, such as for titles, Hermann Zapf’s Optima is a great companion for his Palatino and Euler. A clone of it, URW Classico, is available gratis through the classico package. A good monospace font for code listings is Inconsolata, whose humanist style harmonizes well.

I took the liberty of removing amsthm and amssymb because beamer loads them automatically. You would need to pass it the noamssymb or noamsthm options to turn them off.

With Modern Fonts

All of those fonts also have OpenType clones. Both Windows 10 and MacOS ship with Palatino, or you can use TeX Gyre Pagella. Khaled Hosny released an abandoned, but still usable, OpenType version of Euler. Asana Math is based on Young Ryu’s mathpazo fonts.

\documentclass[11pt]{beamer} 
\usefonttheme{serif}
\usefonttheme{professionalfonts}
\usepackage[math-style=upright]{unicode-math}

\defaultfontfeatures{ Scale=MatchLowercase }
\setmainfont{TeX Gyre Pagella}[Scale = 1.0]
\setmathfont{Asana Math}
\setmathfont{Neo Euler}[
  range={up/{Latin, latin, Greek, greek},
         bfup/{Latin, latin, Greek, greek},
         cal, bfcal,
         frak, bffrak
        },
  script-features={},
  sscript-features={} ]

\title{Test Title}

\begin{document}
\begin{frame}[plain]
    \maketitle
    This is rendered in Pagella, with math symbols from Asana Math and math letters from Neo Euler.
    \begin{theorem} If $V$ and $W$ are two finite dimensional $\mathbb{K}$-vector spaces and $f : V \to W$ is a linear transformation, then
    \[
    \dim V = \dim \ker f + \dim \operatorname{im} f.
    \] 
    Also, \(\mathcal{C}\) and \(\mathfrak{F}\). 
    \end{theorem}
\end{frame}
\end{document}

Pagella + Asana + Neo Euler sample

Neo Euler has a few quirks that we need to work around. As an upright font, it will only be selected if you write \symup or pass the math-style=upright option to unicode-math. The spacing of its subscripts and superscripts looks off to me, despite being intentional, so I suppress its script style. Finally, it has fewer math symbols than other OpenType fonts (nor is the great Hermann Zapf still with us to draw any more), so it is best loaded with the range= option over a fallback font. Thankfully, this is what you wanted anyway.

Since both Asana Math and TeX Gyre Pagella are forks of Adobe’s version of Palatino, their digits are identical, and all we have to do is not touch them for 1 to look the same as $1$. You can select additional symbols from Neo Euler, such as the plus sign, by adding them to the range= list.

2

As referenced by a user which deleted their answer, this can be fixed by using both the professionalfonts and serif font themes.

Concretely, the code

\documentclass[11pt]{beamer} 
\usefonttheme{serif}
\usefonttheme{professionalfonts}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage{euler}


\title{Test Title}

\begin{document}
\begin{frame}[plain]
    \maketitle
    This is rendered in mathpazo and what follows is eulervm.
    \begin{theorem} If $V$ and $W$ are two finite dimensional $\mathbb{K}$-vector spaces and $f : V \to W$ is a linear transformation, then
    \[
    \dim V = \dim \ker f + \dim \operatorname{im} f.
    \]  
    \end{theorem}
\end{frame}
\end{document}

produces

enter image description here

as desired.

You must log in to answer this question.

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