The warnings-off option fails to support comma-separated arguments; warning types not logged
Description
The intended mechanism of warning suppression \usepackage[warnings-off = {mathtools-overbracket, mathtools-colon}]{unicode-math} produces an error: 562: Package keyvalue Error: Unknown option 'mathtools-colon' for package(keyvalue) unicode-math-luatex. \ProcessKeysOptions {unicode-math} and a warning: I'm going to overwrite the following commands from the mathtools' package: \dblcolon, \coloneqq, \Coloneqq, \eqqcolon`. Moreover, the log output contradicts the documentation.
Additional information
- Relevant for LuaTeX
- This bug is related to the issue #552
- Discussion on Stackexchange
Minimal example demonstrating the issue
% !TeX program = lualatex
\documentclass[12pt]{book}
\usepackage{mathtools}
\usepackage{fontspec}
% \usepackage{unicode-math}
% \usepackage[warnings-off = {mathtools-colon}]{unicode-math}
% \usepackage[warnings-off = {mathtools-overbracket}]{unicode-math}
\usepackage[warnings-off = {mathtools-overbracket, mathtools-colon}]{unicode-math}
\setmainfont{Times New Roman}
\setmathfont{XITS Math}
\begin{document}
Gauss said: $\sum_{i=1}^{100} n = 5050$.
\end{document}
Further details
I am getting an error in LuaHBTeX, Version 1.18.0 (TeX Live 2024/Arch Linux), Development id: 7611 when trying to suppress warnings, as documented.
The documentation (um-doc-main.tex) mentions the syntax but the example below will show that this does not work:
As an experimental feature, these can be turn off on an individual basis with the package option |warnings-off| which takes a comma-separated list of warnings to suppress.
A warning will give you its name when printed on the console output; e.g.,
\begin{Verbatim}
* unicode-math warning: "mathtools-colon"
*
* ... <warning message> ...
\end{Verbatim}
This warning could be suppressed by loading the package as follows:
\begin{Verbatim}
\usepackage[warnings-off={mathtools-colon}]{unicode-math}
\end{Verbatim}
As per many recommendations, I am loading the packages in this order: mathtools, then fontspec, then unicode-math. The comma-separated option for suppressing warnings does not work:
-
\usepackage{unicode-math}produces 2 warnings:Using \overbracket and \underbracket frommathtools' packageandI'm going to overwrite the following commands from themathtools' package: \dblcolon, \coloneqq, \Coloneqq, \eqqcolon. -
Using
[warnings-off = {mathtools-colon}]or[warnings-off = {mathtools-overbracket}]works, but leaves the other warning.
Also, contrary to the documentation, \jobname.log does not contain the warning names:
...
Package unicode-math Warning: Using \overbracket and \underbracket from
(unicode-math) `mathtools' package.
(unicode-math)
(unicode-math) Use \Uoverbracket and \Uunderbracket for
(unicode-math) original `unicode-math' definition.
Package unicode-math Warning: I'm going to overwrite the following commands
(unicode-math) from the `mathtools' package:
(unicode-math)
(unicode-math) \dblcolon, \coloneqq, \Coloneqq, \eqqcolon.
(unicode-math)
(unicode-math)
(unicode-math) Note that since I won't overwrite the other
(unicode-math) colon-like commands, using them will lead to
(unicode-math) inconsistencies.
I should be grateful if someone could fix two birds with one drone: bring the warning names into the main log file, and allow multiple comma-separated warning types to be ignored. Or even simpler, maybe we should allow suppressing ALL warnings via something as simple as
\usepackage[warnings-off]{unicode-math}
? After all, the intended way of using YYYLaTeX is writing good code the produced no warnings on its own, right?
I haven't looked into this deeper but just wanted to leave a quick note that specifying the key multiple times seems to do the trick, for anyone just trying to get this to work
\usepackage[
warnings-off = mathtools-colon,
warnings-off = mathtools-overbracket
]{unicode-math}