# problem with math font and LuaLaTeX

The following code works fine if compiled in pdflatex:

\documentclass{beamer}
\usepackage{quattrocento}
\begin{document}
\begin{frame}
Quattrocento $30\cdot40$
\end{frame}
\end{document}


As is explained by egreg in my previous question (Getting Quattrocento as math font in article class) beamer automatically uses the text font for letters and numbers in mathmode.

Now I need to compile my presentation with LuaLaTeX, so I changed the code to:

\documentclass{beamer}
\usepackage{fontspec}
\usepackage{unicode-math}
\setsansfont{Quattrocento}
\setmathfont{Quattrocento}
\begin{document}
\begin{frame}
Quattrocento ${30\cdot40}$
\end{frame}
\end{document}


However in this way the \cdot is not printed (I'm assuming because the symbol is not in the Quattrocento font, and now the font is used for all math symbols, not only letters-numbers).

How can I restore beamer behavior with pdflatex when using lualatex?

• Quattrocento doesn't qualify as a math font. Don't load unicode-math, add the option no-math to fontspec and load mathastext as in the other case. – egreg Nov 12 '13 at 23:01

Quattrocento doesn't qualify as a math font for \setmathfont; fonts for this purpose should be specially tailored for math, with hundreds of symbols and some internal tables.

You can, for limited purposes, use mathastext, but you have also to load fontspec with the no-math option:

\documentclass{beamer}
\usefonttheme{professionalfonts}

\usepackage[no-math]{fontspec}
\usepackage[sfdefault]{quattrocento}
\usepackage[italic]{mathastext}

\begin{document}
\begin{frame}
Quattrocento $30\cdot40+ab-c$
\end{frame}
\end{document}


Note that ${30\cdot 40}$ is not necessary; adding braces could even be dangerous if not done properly: better remove them.

• yes, sorry, the braces are the result of some experiments I was doing before posting, I'll remove them from the question. Thank you. – Gargoyle Nov 13 '13 at 0:34