On 1/3/2025 1:56 AM, Jim wrote:
Hi,
I was perusing an update to
https://wiki.contextgarden.net/index.php?title=Framed&diff=next&oldid=35583
and noticed that the grey math was not properly aligned on the wiki page.
But then I tried it on my system, and, worse yet, I found out that
\setuppapersize[A5]
\setupcolors[state=start]
\def\graymath{\mframed[frame=off,
background=color,
backgroundcolor=gray,
backgroundoffset=3pt]}
\starttext
\startformula
{x^3\over3} - 2
\stopformula
\stoptext
creates a fraction that I would expect from
{x^3\over3 - 2}
Is this just my (newly updated) context, or has the year 2025 started off
with a \over problem?
It's been so for a while. In fact, using \over was never advocated
For various reasons you should use:
\frac{x^3}{3} - 2
Here are some:
- in lmtx we configure {} to as anywhere else in tex: grouping or
argument delimiters; if not it will always create atoms
- \over is a special but confusing case of parsing where, when it is
seen, tex will take the previous atom and pair that with an upcoming
only case of such parsing
- just try to predict what
{x} \over {y}
{x+1} \over {y}
x + {1} \over {y}
x + 1\over y
{x + {1} \over {y}}
{x + 1\over y}
etc etc are supposed to do especially when you also mix in
\scriptstyle, \red, \bf or alike in different places in or ourside these { }
- this means that when one wants to control rendering rather dirty
tricks have to be used to might not always work
- for that reason \frac is there (afaik not only in context): we can
control how the numerator and denominator are handled in more detail
- in lmtx (see the extended math manual) we've spend a lot (!) of time
on improving math rendering and spacing especially, so in our case
fractions are native classes
I'm sure Mikael can add some more arguments ... like different kind of
fractions, skrewed fraction etc, but maybe best read the quite extensive
mathincontext manual first.
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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________