# DeclareMathOperator not displayed in math font with Beamer

I am writing a Beamer presentation using pdfLaTeX for the backend. I want to use Lato for the text and eulervm for the math font. However my operator Re is not displayed with the math font in the equations:

I don't think this is a duplicate of that question since I am not using XeTeX. Regardless, is that expected since I didn't pick a math font that blends beautifully with the text font? Otherwise, how can I sort this problem? I tried using \usefonttheme{professionalfonts} without effect.

MWE:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[UKenglish]{babel}
\usepackage[default]{lato}
\usepackage{eulervm}

\usefonttheme[onlymath]{serif}

\DeclareMathOperator{\Rey}{Re}

\begin{document}

\begin{frame}
\begin{block}{In block}
\begin{equation*}
x + y = z
\end{equation*}
\begin{equation*}
\Rey = 1
\end{equation*}
In text $$\Rey = 1$$
\end{block}
\end{frame}

\end{document}

• Math operators are done in the roman style, whereas euler is an italic style. – Steven B. Segletes Apr 7 '20 at 11:44
• @StevenBSegletes eulervm also have upright parts normally. The beamer math setup is imo incomplete. Try a normal beamer doc with no extea font setup, explain why mathrm is not set to mathsf by default. Mathrm gives serifs in a setup where both text and math is sans serif. I've started using the sansserifmath package (I think that is the name and I think it gives a better default math setup for beamer, including setting mathrm to mathsf by default) – daleif Apr 7 '20 at 12:01
• As Mico mentioned in their deleted answer you probably need the professionalfonts setup when you change the fonts used by beamer. – daleif Apr 7 '20 at 12:03
• I mentioned I tried \usefonttheme{professionalfonts} @daleif unless you mean something else? – circuitbreaker Apr 7 '20 at 12:12

Since \Rey is supposed to represent the Reynolds number, what about something like \mathinner{\mathnormal{R\mkern -1mu e}}? The \mkern -1mu ensures this doesn't look like a product between R and e. Maybe there is a better way to achieve this, but since these glyphs come from a math font, I'm not sure. The \mathinner ensures there is some space around the whole, as happens when one uses \left and \right.

\documentclass{beamer}
\usepackage[default]{lato}
\usepackage{eulervm}

\usefonttheme[onlymath]{serif}

\newcommand*{\Rey}{\mathinner{\mathnormal{R\mkern -1mu e}}}

\begin{document}

\begin{frame}
\begin{block}{In block}
\begin{equation*}
x + y = z
\end{equation*}
\begin{equation*}
\Rey = 1
\end{equation*}
\begin{equation*}
x\Rey y = 2
\end{equation*}
In text: $$\Rey = 1$$, $x\Rey y = 2$.
\end{block}
\end{frame}

\end{document}


Although the workaround solution of @frougon answers the issue, it seems there was another post mentioning that issue there, which reported a 'more consistent' solution which avoids mingling with the kerning using \DeclareSymbolFont:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[UKenglish]{babel}

\usepackage[default]{lato}
\usepackage{eulervm}

\usefonttheme[onlymath]{serif}

\DeclareMathOperator{\Rey}{Re}

\DeclareSymbolFont{sfoperators}{U}{zeur}{m}{n}
\makeatletter
\renewcommand{\operator@font}{\mathgroup\symsfoperators}
\makeatother

\begin{document}

\begin{frame}
\begin{block}{In block}
\begin{equation*}
x + y = z R e
\end{equation*}
\begin{equation*}
\Rey = 1
\end{equation*}
In text $$\Rey = 1$$
\end{block}
\end{frame}

\end{document}


• No, this would also modify how \sin or \log appear. – egreg Apr 7 '20 at 16:32
• True! I've just checked on my minimal example. – circuitbreaker Apr 7 '20 at 17:17