[NTG-context] Math bug (maybe) - prime

Hans Hagen j.hagen at freedom.nl
Wed Dec 28 00:27:39 CET 2022

On 12/27/2022 6:33 PM, Alan Braslau via ntg-context wrote:
> MWE:
> \starttext
> $a^2′$
> $a′^2$
> $\mathord{a′}^2$
> $a^*^2$
> \stoptext
> Should the \mathord{} be necessary to get the desired result?
> (I would expect the second line to work, just like $a^*^2$.)
primes are kind of special and a pain in tex

- traditional tex sees them as superscripts and therefore expects soem 
active character and parsing magick for successive scripts
- that assumes a special way of havign these primes in the font (read: 
is it a text size thing already raised or a script one not yet raised)
- it also sort of spoils spacing (as one can end up with an empty 
nucleus inserted)
- in mkiv we use different magick than in mkii

anyway, in lmtx (luametatex) primes have been promoted to first class 
citizens which means that a nucleus can have

- super(post)script
- sub(post)script
- superprescript
- subprescript
- prime

and each comes with spacing and positioning properties cf opentype and 
our own additions for the pre/prime)

there is some magick wrt subscripts as these often are indices (which is 
why we have for instance ^^^ and ___ too)

What you can do is:


which basically makes the prime an operation .. a small price to pay for 
more robust handling of primes (also across fonts)


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl

More information about the ntg-context mailing list