latex3 / unicode-math

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

Patching to mathtools' commands \[over|under]bracket fails #544

Open muzimuzhi opened 4 years ago

muzimuzhi commented 4 years ago

Description

Both unicode-math and mathtools provide commands \[over|under]bracket but with different syntaxes. Currently unicode-math contains a patching for this, in order to use names \U[over|under]bracket for unicode-math version. This patching has no effects now.

All packages are updated, using texlive 2019.

Add info or delete as appropriate:

Minimal example demonstrating the issue

\documentclass{article}
% order of package loading is irrelavent
\usepackage{mathtools}
% \let\underbracketMT=\underbracket % a workaround
\usepackage{unicode-math}

% explicitely use \setmathfont or not is irrelavent
\setmathfont{Latin Modern Math} 

\begin{document}
\ttfamily

\meaning\underbracket    \par
\meaning\MTunderbracket  \par
\meaning\Uunderbracket   \par
\end{document}

These three commands now have the same meaning.

Further details

Source lines of that patching: https://github.com/wspr/unicode-math/blob/eb529920bc53dc2509864e909efc30c8f8b119f9/um-code-compat.dtx#L68-L111

Related message: https://github.com/wspr/unicode-math/blob/eb529920bc53dc2509864e909efc30c8f8b119f9/um-code-msg.dtx#L68-L76

This compatibility problem was firstly reported in #215 and then fixed in https://github.com/wspr/unicode-math/commit/872775eed44857706c0041bae798a04d8971125a, accompanied by a test file F-mathtools-overbracket.lvt. But that test file is disabled now, for it resides in directory testfiles-disabled.

I guess the patching is called too late. It should be used before \[over|under]bracket are (re)defined by \AtBeginDocument{\__um_define_math_chars:}.

aomader commented 4 years ago

@muzimuzhi What kind of error are you facing?

I'm curious, because I just updated my texlive 2019 installation (the packages) and run into the following error and I'm wondering whether this is related:

! Undefined control sequence.
┬╣...ain_tl {1}\cs_set_eq:NN \__um_sub_or_super:n
                                                  \sp \tl_set:Nn \l__um_tmpa...

l.55 \begin{document}

?

Everything worked flawless with my original texlive installation from 2019-12-06.

muzimuzhi commented 4 years ago

@b52 Here is what I am facing:

unicode-math had provided a patching so that user can continue to use \overbracket for mathtools syntax, and use \Uoverbracket for unicode-math syntax. The similar things happen for \underbracket.

But I find that patching fails now, both \overbracket and \Uoverbracket have the unicode-math definition.

Not sure if you are facing a same problem. Maybe you can prepare a minimal working example and post it here as a new issue, or to tex.stackexchange.com.

aomader commented 4 years ago

@muzimuzhi Thanks, turns out it was unrelated. These error messages can be quite overwhelming, sorry. :D