How hard should something get \smash-ed ?
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. Jim
Hi,
On Mon, Jan 13, 2025 at 1:43 AM Jim
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.
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 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 -----------------------------------------------------------------
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
Hi Mikael et al, On Mon, Jan 13, 2025 at 07:44 (+0100), Mikael Sundqvist wrote:
Hi,
On Mon, Jan 13, 2025 at 1:43 AM Jim
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.)
At the risk of citing an example using a deprecated feature, in https://wiki.contextgarden.net/Tables/Deprecated/Table the following example is shown: \starttable[|M|c|] \HL \VL \VL a \VL \AR \DC \DL[1] \DR \VL \smash{\displaystyle\sum_0^N} \VL b \VL \AR \DC \DL[1] \DR \VL \VL c \VL \AR \HL \stoptable Without \smash{}, the second row is higher than (presumably) whomever wrote the example wanted. I can imagine someone wanting to do something like that in another type of table, even using a non-deprecated type of table. (I added \displaystyle to the example yesterday to make it do what the example's author intended.)
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.
Yeah... as a very-long-time plain TeX user, old habits die hard (and I am not using any math in my current main use of ConTeXt). The main reason for using $$ in my report was because that is what is in the wiki page. (And the issue is still there with \startformula and \stopformula anyway.) Cheers. Jim
On 1/13/2025 3:58 PM, Jim wrote:
\starttable[|M|c|] \HL \VL \VL a \VL \AR \DC \DL[1] \DR \VL \smash{\displaystyle\sum_0^N} \VL b \VL \AR \DC \DL[1] \DR \VL \VL c \VL \AR \HL \stoptable
\bTABLE[offset=.5ex] \bTR \bTD[ny=3,align=lohi] \dm {\sum_0^N} \eTD \bTD a \eTD \eTR \bTR \bTD b \eTD \eTR \bTR \bTD c \eTD \eTR ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Mon, Jan 13, 2025 at 17:14 (+0100), Hans Hagen wrote:
On 1/13/2025 3:58 PM, Jim wrote:
\starttable[|M|c|] \HL \VL \VL a \VL \AR \DC \DL[1] \DR \VL \smash{\displaystyle\sum_0^N} \VL b \VL \AR \DC \DL[1] \DR \VL \VL c \VL \AR \HL \stoptable
\bTABLE[offset=.5ex] \bTR \bTD[ny=3,align=lohi] \dm {\sum_0^N} \eTD \bTD a \eTD \eTR \bTR \bTD b \eTD \eTR \bTR \bTD c \eTD \eTR
Thanks Hans, I took the liberty of adding that to the (deprecated) TaBlE page for the benefit of anyone trying to undeprecate themselves. Jim
participants (3)
-
Hans Hagen
-
Jim
-
Mikael Sundqvist