# Two different fonts for math and text

I tried to prepare slides in Linux Biolinum O, but I do not like the maths fonts, and I wanted to use TeX Gyre Pagella, for the maths environments. I tried the following source, which obviously doesn't work.

\documentclass[10pt,fleqn,xcolor=svgnames]{beamer}

\usetheme{Rochester}
\usecolortheme{spruce}
\usefonttheme{serif}

%--- Fonts
\usepackage{mathspec}
\setmathfont(Digits,Latin){TeX Gyre Pagella}
\setmainfont[Ligatures=TeX]{Linux Biolinum O}

%--- Language
\usepackage{polyglossia}
\setmainlanguage[variant=uk]{english}

\begin{document}
\begin{frame}
\frametitle{Starter}

Bla bla bla

$\sin x + \cos x = abc$
\end{frame}

\end{document}


Can you tell me what how I can have a Palatino-like font for maths, with Linux Biolinum O text?

Cheers

Andrea

• Use unicode-math instead of mathspec; the aim of the latter is to have the same font for math and text. – egreg Jan 13 '18 at 20:29
• Hi, thanks for the suggestion. However, even if I use [unicode-math] instead, the x's are in Linux Biolinum O. – Logos Jan 13 '18 at 20:40

You want to use unicode-math rather than mathspec; you also need the professionalfonts theme.

\documentclass[10pt,fleqn,xcolor=svgnames]{beamer}
\usepackage[no-math]{fontspec}
\usepackage{unicode-math}
\usepackage{polyglossia}

\usetheme{Rochester}
\usecolortheme{spruce}
\usefonttheme{serif,professionalfonts}

\setmainfont{Linux Biolinum O}
\setmathfont{TeX Gyre Pagella Math}

\setmainlanguage[variant=uk]{english}

\begin{document}
\begin{frame}
\frametitle{Starter}

Bla bla bla

$\sin x + \cos x = abc$
\end{frame}

\end{document}


If you also want “sin” and “cos” in Pagella, add also

\setmathrm{TeX Gyre Pagella}


after the \setmathfont line.