1

When I use the package \usepackage{euler} with the package \usepackage{unicode-math} then the Euler font is not used but the default math font is used instead. If I remove the unicode-math package then the Euler font is used as it should.

So what is the problem with using both euler and unicode-math? Moreover I can only assume that this will happen with other math fonts too, so I have to guess it is an issue of unicode-math package and thus I have to ask, what is happening?

Adam
  • 4,684
  • If you usepackage{euler}, you load legacy 8-bit math fonts, which unicode-math overrides. There is an OpenType version of Euler, Neo Euler, which is compatible with unicode-math. See my answer to the above. – Davislor Feb 25 '21 at 02:53
  • @Davislor The question you referenced does not help, but this comment does. I wasn't aware unicode-math was overriding them, so if I understand correctly these two packages are incompatible and that is why this behaviour exist? If yes then post this as an answer, along with the Neo Euler part. :) – Adam Feb 25 '21 at 03:20
  • The accepted answer is irrelevant to you, but scroll down. Okay, I can write a duplicate. – Davislor Feb 25 '21 at 04:06

1 Answers1

2

The unicode-math package selects an OpenType math font, and overrides all legacy math fonts. This is so that loading legacy font packages will not break unicode-math.

There is an OpenType version of Euler compatible with unicode-math. See this answer for more details on how to use it. In many documents, a simple \setmathfont{Neo Euler}[Scale=MatchLowercase] will suffice, once you download the font to a directory where TeX can find it, but I gave a more robust answer there in case you need any of the glyphs it does not contain. (Unfortunately, Hermann Zapf is no longer with us to draw any more.)

You can use a legacy math font together with OpenType text fonts by loading fontspec without unicode-math. The mathastext package has a simple way to set the letters in math mode to the main text font. Alternatively, you could use mathfont to combine the letters from an OpenType or TrueType font with the symbols from a legacy math font.

If you want to use unicode-math except for a few symbols from a legacy font, you can redefine them the old-fashioned way with \AtBeginDocument{\DeclareMathSymbol ...}. You need the \AtBeginDocument hook so that your definition takes effect after the one in unicode-math and supersedes it.

Davislor
  • 44,045