Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
muzimuzhi opened this issue Mar 25, 2020 · 3 comments
Open

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

muzimuzhi opened this issue Mar 25, 2020 · 3 comments

Comments

@muzimuzhi
Copy link
Contributor

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:

  • Relevant for XeTeX
  • Relevant for LuaTeX
  • Issue tracker has been searched for similar issues? Yes

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 872775e, 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:}.

@muzimuzhi muzimuzhi changed the title Patching to mathtools' commands \[over|under]bracket has no effects Patching to mathtools' commands \[over|under]bracket fails Mar 25, 2020
@aomader
Copy link

aomader commented Mar 27, 2020

@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
Copy link
Contributor Author

@b52
Here is what I am facing:

  • unicode-math defines \overbracket{<arg>} as a one-argument command, while
  • mathtools defines it with different syntax, say \overbracket[<rule thickness>][<bracket height>]{<arg>}

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
Copy link

aomader commented Apr 1, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants