1

This is a follow up to: Accents with eulervm and LuaLaTeX

I am using lualatex with beamer and get and undefined control sequence error when using \dot or \ddot

Specifying the option OT1 works, but the math font is then serif if used with \usefonttheme{professionalfonts} or I don't get euler font for e.g. the x if used without \usefonttheme{professionalfonts}

% !TeX program = lualatex
% !TeX encoding = UTF-8
% !TeX spellcheck = en_US
% !BIB program = biber
\documentclass[lualatex, aspectratio=169, 10pt, english]{beamer}
\usetheme[subsectionpage=simple]{metropolis} 
\usefonttheme{professionalfonts}
\usepackage[OT1,euler-digits]{eulervm}

\begin{document}
    \begin{frame}
Text
\begin{align}
E &= \sin(x)\\
\dot{y}
\end{align}

    \end{frame}
\end{document}

How can I fix this?

2 Answers 2

2

I had the same problem and found an answer using this question Eulervm and LuaLaTeX results in wrong front for math operators. This is not very elegant, but it does work for Windows fonts as well (I'm using Corbel here).

My solution:

\documentclass[12pt,t]{beamer}

\usepackage{amsmath}   
\usepackage{eulervm}
\usepackage[no-math]{fontspec}

\usetheme{default}

\usefonttheme{professionalfonts}
\usefonttheme[onlymath]{serif}
\setsansfont{Corbel}

% this simply redefines all the accents and keeps the operators in Corbel font
\DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n}
\DeclareSymbolFont{accents}{OT1}{eur}{m}{n}

\DeclareMathAccent{\acute}{\mathalpha}{accents}{"13}
\DeclareMathAccent{\grave}{\mathalpha}{accents}{"12}
\DeclareMathAccent{\ddot}{\mathalpha}{accents}{"7F}
\DeclareMathAccent{\tilde}{\mathalpha}{accents}{"7E}
\DeclareMathAccent{\bar}{\mathalpha}{accents}{"16}
\DeclareMathAccent{\breve}{\mathalpha}{accents}{"15}
\DeclareMathAccent{\check}{\mathalpha}{accents}{"14}
\DeclareMathAccent{\hat}{\mathalpha}{accents}{"5E}
\DeclareMathAccent{\dot}{\mathalpha}{accents}{"5F}
\DeclareMathAccent{\mathring}{\mathalpha}{accents}{"17}

\DeclareMathOperator{\foo}{foo}

\begin{document}

\begin{frame}
\begin{equation*}
  1+ \hat{\sin} \hat{x} \tilde{x} \foo \quad \text{sin}
\end{equation*}
\end{frame}

\end{document}

Hope this helps either you or the next person who wants to use both eulervm and luatex (and maybe even Windows fonts).

2

Compiling your example on a TeXLive (linux), I get Fira Sans (Light weight) fonts for text and indeed CM (serif) fonts for maths.

You can choose the matching Fira maths fonts (sans serif only available in Regular weight ) rather than 8-bits fonts by adding

\usepackage{unicode-math}
\setmainfont{Fira Sans} % for math operators
\setsansfont{Fira Sans} % for text (instead of the light version)
\setmathfont{Fira Math}

Output: enter image description here or if you prefer Euler fonts (no math italics), you could try

\usepackage[math-style=upright]{unicode-math}
\setmainfont{Fira Sans Light}[Scale=0.88] % for math operators
\setmathfont{euler.otf}

Output: enter image description here The latter (euler.otf) is not included in TeXLive, it is available github.com/khaledhosny/euler-otf but the project looks like abandoned, sigh…

You must log in to answer this question.

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