2

If I compile

\documentclass[border=5pt]{standalone}
\usepackage{unicode-math}
    \newcommand*\Nu{\mathit{Nu}}
%    \newcommand*\Nu{bla}
\begin{document}
    $\Nu$
\end{document}

(with LuaLaTeX) with an up-to-date MiKTeX this results in

image showing the result of above code with is an upright capital N

rather than in an italic "Nu". That seems because unicode-math seems to define that command which can be verified by commenting the currently not commented \newcommand line.

But then I would guess/hope to get the error message

! LaTeX Error: Command \Nu already defined.
Or name \end... illegal, see p.192 of the manual.

as one gets if you uncomment the currently commented \newcommand line.

Does anybody have a clue why this is so and/or if this is a bug in unicode-math? Or does anybody have an idea how I can preserve the original command and still make the new one effective instead of renaming it?

Stefan Pinnow
  • 29,535
  • The reason for why no error is reported has been given, but I would like to point out that it's been traditional in math publications for hundreds of years to print uppercase greek upright. The reason is that printers usually didn't have italic uppercase greek metal type. Be that as it may, tradition is tradition, and math publishers honor tradition. – barbara beeton Aug 08 '21 at 20:16

1 Answers1

4

unicode-math (unfortunately) does almost all its definitions \AtBeginDocument so the command is not defined at that point. (so you can place a redefinition after \begin{document} or in \AtBeginDocument

David Carlisle
  • 757,742
  • Thanks for the prompt reply. So I guess unicode-math is then using \providecommand to define it and that is the reason why I don't get any hint in the LOG, right? Is that intended behavior, i.e. a feature or a bug? In my point of view this is a bug because it took me quite some time to find that difference after I added that package to a books preamble with more than 450 pages ... Would there be any negative consequences/drawbacks if I would define that command via \AtBeginDocument and thus override unicode-maths command? – Stefan Pinnow Aug 08 '21 at 18:23
  • @StefanPinnow not providecommand that would not define most things it uses \def or \mathchardef etc as by design it is over-writing existing math definitions from the format or amssymb etc to fit the unicode locations so it is expecting to redefine thousands of commands so doesn't warn about each one. – David Carlisle Aug 08 '21 at 19:03
  • 1
    no you can certainly redefine that. also see https://github.com/wspr/unicode-math/issues/548 – David Carlisle Aug 08 '21 at 19:06
  • You say, “unfortunately,” but this allows it to work with the many, many classes and templates that load a Type 1 font, regardless of loading order. It’s not the most intuitive design feature, but it’s saved me a lot of problems over the years. – Davislor Aug 08 '21 at 20:01
  • 1
    @Davislor sure but there would be other ways to do that and it comes at a heavy price in terms of making it difficult (or at least confusing) to customise. – David Carlisle Aug 08 '21 at 20:04
  • @DavidCarlisle Fair enough. Your answer, you’re entitled to share your opinion. – Davislor Aug 08 '21 at 20:09