ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Math bug (maybe) - prime
@ 2022-12-27 17:33 Alan Braslau via ntg-context
  2022-12-27 23:27 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Braslau via ntg-context @ 2022-12-27 17:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Alan Braslau

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$.)

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Math bug (maybe) - prime
  2022-12-27 17:33 Math bug (maybe) - prime Alan Braslau via ntg-context
@ 2022-12-27 23:27 ` Hans Hagen via ntg-context
  2022-12-28  4:58   ` Alan Braslau via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen via ntg-context @ 2022-12-27 23:27 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

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:

$\primed{a}^2$

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

Hans

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Math bug (maybe) - prime
  2022-12-27 23:27 ` Hans Hagen via ntg-context
@ 2022-12-28  4:58   ` Alan Braslau via ntg-context
  2022-12-28  7:26     ` Mikael Sundqvist via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Braslau via ntg-context @ 2022-12-28  4:58 UTC (permalink / raw)
  To: Hans Hagen via ntg-context; +Cc: Alan Braslau

On Wed, 28 Dec 2022 00:27:39 +0100
Hans Hagen via ntg-context <ntg-context@ntg.nl> wrote:

> What you can do is:
> 
> $\primed{a}^2$
> 
> which basically makes the prime an operation .. a small price to pay
> for more robust handling of primes (also across fonts)

I anticipated that (unicode) prime is a pain to handle, given that
different fonts present it differently.

$\primed{a}...$ is a very readable and reasonable solution (unlike
\mathord{}, which seems to be a messy fix). I will learn and use that.

Thank you!

Alan 

P.S. inverting the order of the "exponents", if prime is some sort of
exponent, was a surprising result.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Math bug (maybe) - prime
  2022-12-28  4:58   ` Alan Braslau via ntg-context
@ 2022-12-28  7:26     ` Mikael Sundqvist via ntg-context
  2022-12-28 17:32       ` Alan Braslau via ntg-context
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Sundqvist via ntg-context @ 2022-12-28  7:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mikael Sundqvist

On Wed, Dec 28, 2022 at 5:58 AM Alan Braslau via ntg-context
<ntg-context@ntg.nl> wrote:
>
> On Wed, 28 Dec 2022 00:27:39 +0100
> Hans Hagen via ntg-context <ntg-context@ntg.nl> wrote:
>
> > What you can do is:
> >
> > $\primed{a}^2$
> >
> > which basically makes the prime an operation .. a small price to pay
> > for more robust handling of primes (also across fonts)
>
> I anticipated that (unicode) prime is a pain to handle, given that
> different fonts present it differently.
>
> $\primed{a}...$ is a very readable and reasonable solution (unlike
> \mathord{}, which seems to be a messy fix). I will learn and use that.
>
> Thank you!
>
> Alan
>
> P.S. inverting the order of the "exponents", if prime is some sort of
> exponent, was a surprising result.

Alan,

Note that the 2 sits higher in

\primed{a}^2

than it does in

(a')^2.

For readability, I really prefer the version with parentheses.

/Mikael
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Math bug (maybe) - prime
  2022-12-28  7:26     ` Mikael Sundqvist via ntg-context
@ 2022-12-28 17:32       ` Alan Braslau via ntg-context
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Braslau via ntg-context @ 2022-12-28 17:32 UTC (permalink / raw)
  To: Mikael Sundqvist via ntg-context; +Cc: Alan Braslau, Mikael Sundqvist

On Wed, 28 Dec 2022 08:26:24 +0100
Mikael Sundqvist via ntg-context <ntg-context@ntg.nl> wrote:

> Note that the 2 sits higher in
> 
> \primed{a}^2
> 
> than it does in
> 
> (a')^2.
> 
> For readability, I really prefer the version with parentheses.

Certain Mathematical writing styles seek to minimize the use of
parenthesis ...

Now, the question is whether a prime is considered an exponent or
rather some sort of accent? One can ask the same question considering
other modifiers such as asterisk/star or even $\hat{a}$. Sometimes,
these can symbolize operators, in other cases they may indicate a
variant (as does prime).

I suspect that Context is currently treating $\primed{a}^2$ as
${a^{\prime}}^2$ (although, maybe the 2 is not made smaller?).

Aesthetically, should $x^2$ and $\hat{x}^2$ display any difference in
the placement of the exponent?

Alan

P.S. As a challenge, consider the following:
\chemical{^{14}_6C^*}
(a chiral carbon-14 atom).
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-28 17:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 17:33 Math bug (maybe) - prime Alan Braslau via ntg-context
2022-12-27 23:27 ` Hans Hagen via ntg-context
2022-12-28  4:58   ` Alan Braslau via ntg-context
2022-12-28  7:26     ` Mikael Sundqvist via ntg-context
2022-12-28 17:32       ` Alan Braslau via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).