LaTeX forum ⇒ Math & Science\mathup vs. \mathrm

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

\mathup vs. \mathrm

Postby user49915 » Fri Mar 13, 2020 5:24 pm

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?

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

Postby kaiserkarl13 » Sun Mar 15, 2020 7:55 pm

\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: 75
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Tue Mar 17, 2020 2:13 pm

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?


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 2 guests