Hi Hans (et al), On Mon, Jan 13, 2025 at 08:49 (+0100), Hans Hagen via ntg-context wrote:
On 1/13/2025 7:44 AM, Mikael Sundqvist wrote:
Hi,
On Mon, Jan 13, 2025 at 1:43 AM Jim
mailto:zlists%2Bcontext@jdvb.ca> wrote:
Hi,
In plain TeX,
$$\smash{\sum_0^n}$$
is set in \displaystyle, just like
$$\smash{\sum_0^n}$$
However, ConTeXt
\starttext $$\smash{\sum^0_n}$$ \stoptext
outputs the above in \textstyle, whereas
\starttext $$\sum^0_n$$ \stoptext
is in (of course(?)) \displaystyle.
Is this difference intentional?
Thanks for reporting. I don't think it is intentional. (Can you show your real world example where \smash is needed? It seems to not really be used in any macro in ConTeXt.)
/Mikael
PS $$ is not meant to be used in ConTeXt. If you want inline math in display style, use \dm {}, and if you want displayed formulas in display style, use \startformula \stopformula.
% put this in cont-new.mkxl
\unprotect
\protected\def\syst_boxes_math_set_nextbox#1% {\setbox\nextbox\hbox\expandafter\bgroup \expandafter\Ustartmathmode\the\mathstyle \mathsurround\zeropoint{#1}% \Ustopmathmode \egroup}
\protect
to get this right
\starttext
\ruledhbox{\smash{$\sum^0_n$}} \blank
\ruledhbox{\smash{$\displaystyle\sum^0_n$}} \blank
\ruledhbox{$\smash{\sum^0_n}$} \blank
\ruledhbox{$\displaystyle\smash{\sum^0_n}$} \blank
\stoptext
Thanks Hans, that fixes that up nicely. (And it is always nice to see a fix which actually makes the codebase (a bit) shorter. Jim