latex3 / unicode-math

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

`\widebridgeabove` is not wide (and it shouldn't be???) #591

Open marcin-serwin opened 2 years ago

marcin-serwin commented 2 years ago

Description

I've noticed that \widebridgeabove is not really wide since it is defined as \mathaccent in the package. https://github.com/wspr/unicode-math/blob/d28e48e46392516bae43bd9cb15660f7037e47ac/unicode-math-table.tex#L164 I've changed it to \mathaccentwide and it seemed to work since now \widebridgeabove{abcd} produced image instead of image I wanted to open a PR, but then I've tried the STIX Two Math font and it didn't work. image I was a bit confused and then I've also noticed that it is shifted a bit to the left in this font. (\widebridgeabove{x}) image So I thought that maybe it's a bug in the STIX font, but then I've looked at the unimath-symbols.pdf document and noticed that STIX is (semi-)consistent with the left shift. image image So I went to check the Unicode charts how the character is defined. image image "extends the full width". So that's it, STIX Math is wrong, I thought. But then I've also checked out of curiosity other fonts in that document, 20DD to be precise and here it was also shifted to the left, but this time by every font. image It is also visible in the old stix package documentation. image To sum up: I'm confused.

I guess these characters are meant to be used for single math symbols (for example to enclose the summation operator), and they are "wide" only in the sense that they should enclose the whole operator instead of being a fixed size (in contrast to U+0346), and not in the sense that they can extend over multiple characters. There is also something broken either in the handling of accents by the unicode-math or in the STIX font itself (occasional left shifts). Either way the \enclosecircle and friends shouldn't be mathord.

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{unicode-math}

\begin{document}
\[
  \widebridgeabove{abcd}
\]
\end{document}