Support and test amsmath macros `\varGamma...\varOmega`
Description
amsmath doesn't use \upGamma but rather \varGamma.
Check/indicate
- [x] Relevant for XeTeX
- [x] Relevant for LuaTeX
- [x] Issue tracker has been searched for similar issues?
- [x] Links to <tex.stackexchange.com> discussion if appropriate:
- https://tex.stackexchange.com/questions/105653/emulating-amsmaths-vargamma-varomega-with-unicode-math
Minimal example demonstrating the issue
\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$\varGamma$?
\end{document}
Further details
These commands do appear to work when amsmath is loaded, so it might just be a matter of ensuring and checking the behaviour makes sense.
I just run into this problem while testing the tagging in the amsldoc documentation. Imho it would be good if unicode-math could redefine the following commands and map them to the \it... version. (or whatever is sensible).
\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$
\varGamma
\varDelta
\varLambda
\varXi
\varPi
\varSigma
\varUpsilon
\varPhi
\varPsi
\varOmega
$
$
\itGamma
\itDelta
\itLambda
\itXi
\itPi
\itSigma
\itUpsilon
\itPhi
\itPsi
\itOmega
$
\end{document}
hmm the alternative to \itGamma (which is \symit\Gamma) would be \mitGamma (which is directly the character 𝛤) The behaviour of these is similar but differs in edge cases (notably if \Gamma is redefined) I'd be tempted to use \mit... but not sure if @wspr sees any conceptual differences between \mit.. and \it... here?
I was mostly wondering about the compability with amsmath. \varGamma is "italic", \Gamma is upright. But perhaps \varGamma should simply do the opposite of \Gamma?
in amsmath \Gamma follows the current \fam so \mathbf{\Gamma} is bold \mathit{\Gamma} is italic etc, but \varGamma is \mathord rather than \mathalpha so is always medium weight italic. so a compatible unicode-math would be for \Gamma to be U+0393 so it gets translated by \sym.. and \varGamma to be \mitGamma U+1D6E4 so not translated by \sym.. and always italic.
\mitGamma is upright in the default setup, that's why I used \itGamma.
\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$
\varGamma
\Gamma
\mitGamma
\itGamma
$
\end{document}
oh sorry that seems unfortunate: yes so it would have to be \symit currently, but direct Unicode input of 𝛤 should be italic.
\Umathcharnumdef\x\Umathcode`𝛤
\show\x
produces
> \x=\Umathchar"7"00"000393.
showing the math italic gamma input is used the same way as a base plane Gamma, using the standard U+0393 slot not the math italic slot.
Don’t forget that unicode-math has package options for controlling italic/upright shapes independent from the input source. This is why you seemingly see inconsistencies — the \it prefix forces the “shape”, the \mit prefix is equivalent to using the symbol directly so the resulting shape is controlled by package options.
@wspr I think it's fine that there are options to control the mapping of the base plane characters but if you use U+1D6E4 (𝛤) \mitGamma which is mathematical italic capital gamma then you should always get an italic Gamma. it should be equivalent to \symit{\Gamma} That's more or less the whole point of the Unicode math alphabets that they give an unequivocal representation of the styled symbols.
This is just like MathML where <mi mathvariant="italic">Γ</mi> (\symit{\Gamma}) is cannoncally equivalent to <mi>𝛤</mi> (𝛤)
Sadly that’s not how Unicode-math was designed :-) But if that’s what you as a user expect you get that behaviour with math-style=literal.
The use case intended was that people would be (potentially) using plain Unicode source to as input characters but still want to control whether their Greek symbols were upright or italic.
We could add another style which only has this behaviour for lower-plane characters, but I have always had a soft spot for this feature as I know certain people like to emulate different math styles.
Yes I can see that this is by design:-) but sorry I think it's wrong to have this as an option and certainly a bug to have it as default. The options should only affect the base plane styling. I don't think mathstyle=literal really addresses the use case as it's legitinate to want options to control whether by default capital Greek is upright or bold etc, but those options should not affect explicitly styled characters. Just as <mi mathvariant="bold">𝛤</mi> is not bold upright. The input is an explicit non-bold italic Gamma so it is unaffected by the mathvariant which controls the mapping of the base plane to the math alphanumeric slots.
I would be happy with a new default where the remapping only occurs with the base plane. My thinking there originally was that people might be copy/pasting characters from wherever and it would seem natural to normalise all the input to a consistent shape, relying on markup to then achieve a variation from that shape.
But by the same token, if the characters are coming from well-formed Unicode maths outputs, normalising any differences away could be seen as unnecessary or inappropriate.
@wspr thanks that would be good. As I say, my strong preference would be for none of the style options to affect the math alphabetic characters, but at least making math italic gamma default to an italic gamma would be a good start:-)
@wspr would it work to not map the math alphabetic characters at all either by default or in any of the style options and then have a legacy boolean option "ignore-mathalphabet-style=true" or some such that enabled the current behaviour and treated the math alphabets like the base plane characters if that is needed.
This issue appeared on TeX-SX as well: https://tex.stackexchange.com/questions/745032/how-to-force-lualatex-to-take-upper-italic-greek-from-the-default-math-font
I agree that the current situation is very confusing for users.