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

`mathtools` and `\coloneq` #590

Open marcin-serwin opened 2 years ago

marcin-serwin commented 2 years ago

Description

The mathtools package defines \coloneq as :-, while the unicode-math defines it as :=. The same problem also applies to \Coloneq. This should be either mentioned in the mathtools warning or changed so that the naming is the same.

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{mathtools}
\usepackage{unicode-math}
\setmathfont{STIXTwoMath-Regular.otf}

\begin{document}
\[
  a \coloneq b \Coloneq c
\]
\end{document}

Further details

With unicode-math image Without unicode-math image

davidcarlisle commented 2 years ago

mathtools has the =versions using qq it just documents the commands as coming from txfonts but

\documentclass{article}

\usepackage{newtxmath}

\begin{document}
\[
  a \coloneq b \Coloneq c
\]
\[
  a \coloneqq b \Coloneqq c
\]
\end{document}

image

with three =and one -??

the older txfonts package matches mathtools

image

and as you say unicode-math only defines the single q versions as =.

Given the command name, unicode-math seems most reasonable, but whether we can overcome compatibility issues to get there I am not sure.

thanks for the report...

davidcarlisle commented 2 years ago

Unless I have missed It don't think Unicode has a :- character,

:= is U+ 2254

-: is U+2239

::= is U+2A74

marcin-serwin commented 2 years ago

I haven't found it either.

davidcarlisle commented 2 years ago

@marcin-serwin newtxmath documents

https://mirror.apps.cam.ac.uk/pub/tex-archive/fonts/newtx/doc/newtxdoc.pdf

\coloneq and \eqcolon now point to the correct glyphs;

so I think the :- form was an error in txfonts copied into mathtools and (half) corrected in newtxmath but correct in unicode-math

marcin-serwin commented 2 years ago

So I guess it's just a matter of adding \coloneq and \Coloneq to the commands listed in the warning produced when mathtools is loaded.

davidcarlisle commented 2 years ago

I will raise issues at mathtools and newtxmath, will need to decide whether to document or fix the incompatibility