latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
243 stars 28 forks source link

lualatex underbrace and bars #391

Closed PatrickMassot closed 6 years ago

PatrickMassot commented 7 years ago

This one is really weird. Consider the following tex file:

\documentclass{article}

\usepackage{amsmath}
\usepackage{unicode-math}

\begin{document}
\[
  f = \underbrace{\bar{h} + k}_{\text{test}}
\]

\[
  f = \underbrace{\overline{h} + k}_{\text{test}}
\]
\end{document}

Compiling with LuaTeX, Version 0.95.0 (TeX Live 2016) gives bar with a misplaced underbrace when bar is used but not when overline is used. Removing the unicode-math package solves the problem. Compiling the same file with xelatex XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) solves the problem.

wspr commented 7 years ago

Have you tried with TeX Live 2017? I’m not on an up-to-date computer at present… this is potentially/probably an engine issue, not unicode-math (but I wouldn’t rule out the latter, either).

eg9 commented 7 years ago

I can confirm the wrong behavior with TL 2017. I seem to remember having seen something similar in the past.

Found:

https://tex.stackexchange.com/questions/323797/

I applied the workaround and it seems to work.

PatrickMassot commented 7 years ago

@wspr: I don't know exactly what is an engine issue but the example I gave uses no unicode and the issue disappear if I remove the unicode-math package.

wspr commented 7 years ago

"Unicode" in this context refers more to the fonts and the engine. Much of the underlying maths engine is altered when you load the package, which is why you're seeing a problem.

eg9 commented 7 years ago

@PatrickMassot The issue appears with LuaLaTeX, but not with XeLaTeX, which is referred to as “engine issue”.