ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Hans Hagen <j.hagen@freedom.nl>
Subject: [NTG-context] Re: How hard should something get \smash-ed ?
Date: Mon, 13 Jan 2025 08:49:07 +0100	[thread overview]
Message-ID: <2d2fa7b5-5e52-4786-8193-c1ab04d0b043@freedom.nl> (raw)
In-Reply-To: <CAHy-LL8H0OvDJyDotVF6D5BNA8r5Swncieha+qi40r18jYDqNw@mail.gmail.com>

On 1/13/2025 7:44 AM, Mikael Sundqvist wrote:
> Hi,
> 
> On Mon, Jan 13, 2025 at 1:43 AM Jim <zlists+context@jdvb.ca 
> <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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2025-01-13  7:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13  0:40 [NTG-context] " Jim
2025-01-13  6:44 ` [NTG-context] " Mikael Sundqvist
2025-01-13  7:49   ` Hans Hagen via ntg-context [this message]
2025-01-13 15:21     ` Jim
2025-01-13 14:58   ` Jim
2025-01-13 16:14     ` Hans Hagen via ntg-context
2025-01-13 16:28       ` Jim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d2fa7b5-5e52-4786-8193-c1ab04d0b043@freedom.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@freedom.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).