Math & Science\mathup vs. \mathrm

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

\mathup vs. \mathrm

Post by user49915 »

unicode-math says: "\mathup and \mathrm are aliases of each other and cannot be configured separately."

However, https://tex.stackexchange.com/a/482988 says: "The default upright font for mathematics, which might or might not be Roman ,[...]".

This would make a difference if the default math font is a sans serif one.

My questions are:

1) Are the commands now really always aliases of each other? If you have a sans math font and say \mathrm{whatever}\mathup{whatever}, which version would you get twice, a roman or a sans one?

2) How SHOULD the two commands be eventually implemented, assuming that all bugs or inconsistencies are removed?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

\mathup vs. \mathrm

Post by kaiserkarl13 »

\mathup isn't defined in ordinary documents: it's only defined in unicode-math, and appears to be defined there merely as an alias for \mathrm. Presumably, the user could re-define it, but as it doesn't exist in standard LaTeX, there is little point in doing so.

As for your question about how they should be implemented, well, it's largely a choice the developers of unicode-math made to define it in the first place, so it's up to them.
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

\mathup vs. \mathrm

Post by user49915 »

kaiserkarl13 wrote:\mathup [... is ...] only defined in unicode-math, and appears to be defined there merely as an alias for \mathrm. Presumably, the user could re-define it [...]
I saw the definition, which uses LaTeX3:
\__um_keys_choices:nn {mathup}
{
{sym} { \bool_gset_false:N \g__um_mathrm_text_bool }
{text} { \bool_gset_true:N \g__um_mathrm_text_bool }
}
\cs_set_protected:Npn \mathup { \mathrm }

for both xetex and luatex.

If you look at this, can one really redefine \mathup then?
Post Reply