[lltx] unicode-math + mathtools

Philipp Stephani p.stephani2 at googlemail.com
Sun Aug 28 19:26:45 CEST 2011


2011/8/24 Arno Trautmann <Arno.Trautmann at gmx.de>:
> Hi all,
>
> the following document fails because unicode-math overwrites the definition
> of mathtools:
>
> \documentclass{minimal}
>
> \usepackage{mathtools}
> \usepackage{unicode-math}
> \setmathfont{XITS-math}
>
> \begin{document}
> \[\underbracket{abc}\]
> \[\underbracket[7pt]{abc}\]
> \end{document}
>
> \underbracket works, but the optional arguments are gone. I tried to use
> \let to restore the definition of mathtools after loading unicode-math, but
> did not succeed. Is this fixable or incompatible in principle?

It is unfortunately incompatible in principle. Unicode-math uses
LuaTeX's \Udelimiterunder to place a special stretchable character
under the expression, while mathtools uses a form of vector graphics.
Because the shape of the underbracket character is determined by the
font in the unicode-math case, the options to set the rule thickness
and bracket height cannot possibly work.
For me this is a name clash: both definitions are useful, and possibly
unicode-math should not use the names used by mathtools. Bug is here:
https://github.com/wspr/unicode-math/issues/215
You can restore the definition by saying:

\usepackage{mathtools}
\let\savedunderbracket
\usepackage{unicode-math}
...
\begin{document}
% Unicode table is executed at begin document
\let\underbracket\savedunderbracket


More information about the lualatex-dev mailing list