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

Isolated math symbols in text mode? #524

Open wspr opened 5 years ago

wspr commented 5 years ago

From the LuaTeX mailing list:

I mean that 𝗔 (u1D5D4), occurring in text mode, is treated as $\mathbf{A}$.

Oh I would not have guessed that you meant that:-) No. The package only only affects math mode and has no effect on text.

This list isn't really the right place for discussing macro layer definitions, you could suggest a change at

https://github.com/wspr/unicode-math/issues/

it's not my call but I think not affecting text mode is the right thing here.

I think we could reasonably say that such a blatant insertion of a maths symbol in text mode could be at least trapped more obviously.

I had always intended eventually to make such slots math-active, which would be easy enough to insert a text mode definition for. Not saying I'd allow it, just logging here for future reference.

davidcarlisle commented 5 years ago

my personal preference would be not to force math mode and not to flag any error, I don't think the plane 1 math alphabets are that different to characters in the BMP math operator blocks, I can use ∮ in text mode and if the font in use has it it all just works, obviously just as a text character without any math spacing, and I think the same is true of 𝗔 it may be that current "text" fonts don't include the math alphabets but that isn't clearly always going to be the case, and you may have a custom virtual or combo font set up for this, so I don't think unicode-math should be affecting the non-math use of these characters.

wspr commented 5 years ago

I agree that silently entering maths mode to do the right thing would be the wrong approach, as you’d get obvious edge cases with incorrect spacing. I like the analogy with script/language ideas in general — you can’t fix or enforce in general, so why do it for maths?

OTOH for the vast majority of users, having a maths symbol in text mode is almost certainly a syntax error, and if we have a mechanism to call an error I like the idea it could be a possibility. Perhaps unicode-math could have a “strict” mode…