4

I noticed that the math operators have the wrong font if LuaLaTeX is used.

enter image description here

If I apply the fix from @egreg the accents are wrong:

enter image description here

The MWE is the following:

% !TeX program = lualatex
% !TeX encoding = UTF-8
\documentclass[]{article}

\usepackage{amsmath}   
\usepackage{ebgaramond}
\usepackage[euler-digits,small,OT1]{eulervm}

% fix the font used for operators and \mathrm
\usepackage{fontspec}
\DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n}

\begin{document}
\begin{equation*}
    \sin \hat{x} \tilde{x} \quad \text{sin}
\end{equation*}
\end{document}

2 Answers 2

2

You can use legacy fonts for the operators:

\documentclass[]{article}

\usepackage{amsmath}   
\usepackage{ebgaramond}
\usepackage[euler-digits,small,OT1]{eulervm}

\usepackage{fontspec}
\DeclareSymbolFont{operators}{OT1}{EBGaramond-TLF}{m}{n}

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

\end{document}

enter image description here

Alternatively, use the legacy font only for the accents.

\documentclass[]{article}

\usepackage{ebgaramond}
\usepackage[euler-digits,small,OT1]{eulervm}
\usepackage{fontspec}

\DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n}
\DeclareSymbolFont{accents}{OT1}{EBGaramond-TLF}{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}

\usepackage{amsmath}

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

\end{document}
1
  • Thx. I own you a drink if we ever meet. You already helped me a dozen times. Nov 30, 2020 at 18:25
0

You can use Neo Euler in unicode-math.

You must log in to answer this question.

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