3

I use the euler font for math and compile with LuaLaTeX. To solve a problem with the accent \bar, I load unicode-math which resets the mathfont: standard math font:

Why does unicode-math overwrite eulervm and how can I get back to the correct font?

Here is my MWE:

% !TeX program = lualatex

\documentclass{scrartcl}

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

\begin{document}

\begin{align}
    E &= mc^2\\
    \bar{y}
\end{align}

\end{document}
3
  • And what is your problem with the \bar accent?
    – AboAmmar
    Feb 8 '17 at 14:37
  • 2
    the euler font is an 8bit font in a traditional weird 7bit TeX encoding, unicode-math resets the entire math typesetting logic to use OpenType math fonts rather than traditional TeX fonts using tfm parameters. It's possible to mix these things with care for specific symbols, but it can't work to use unicode-math and expect the main font not to be a Unicode font. Feb 8 '17 at 14:43
  • @AboAmmar Try the MWE without unicode-math. @DavidCarlisle Thanks for this information. Would you change the math font via \setmathfont? Which one would you load?
    – Dirk
    Feb 8 '17 at 16:03
4

You surely don't want to load unicode-math in order to solve the problem with \bar not being defined. Just pass the correct option to euler-vm, which cannot cope with TU (or EU2).

\documentclass{scrartcl}

\usepackage{amsmath}
\usepackage[no-math]{fontspec}
\usepackage[OT1,euler-digits]{eulervm}

\begin{document}

\begin{align}
    E &= mc^2\\
    \bar{y}
\end{align}

\end{document}

enter image description here

2
  • ,@egreg - Without unicode-math, the OP's MWE gives me the same result as yours, I also tried in ShareLaTeX. Am I missing some thing? Please correct me if I'm wrong.
    – AboAmmar
    Feb 8 '17 at 16:25
  • @AboAmmar I get warnings about unknown encodings and \bar undefined
    – egreg
    Feb 8 '17 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.