Much appreciated for the help. It works nicely when this follows the
\item immediately.
However, if I use it after some text in \item it is aligned with list
enumerator and does
not indent. How can I achieve that?

On Tue, Jul 15, 2025 at 7:32 AM Aditya Mahajan <adit...@umich.edu> wrote:
>
>
>
> On Tue, 15 Jul 2025, Shiv Shankar Dayal wrote:
>
> > Consider following code:
> >
> > \starttext
> > \startitemize[n]
> > \item   \startformula \startalign[n=3]
> >     \NC S = \NC T_1 + \NC T_2 + T_3 + \cdots + T_n\NR
> >     \NC S = \NC \NC T_1 + T_2 + \cdots + T_{n - 1} + T_n\NR
> >   \stopalign\stopformula
> > \stopitemize
> > \stoptext
> >
> > The formula is centered below the list enumerator and mid-aligned. How
> > can I align it to left and in the same line as list enumerator. I
> > tried replacing \startformula with $ but then it goes above the list
> > enumerator and is still mid-aligned. I tried setting flushleft and
> > align attributes but they did not work.
>
> You need a couple of things:
>
> - \startformula ... \stopformula uses the full local width. You need to use 
> inline math $ ... $ (I use \startimath ... \stopimath below so that it looks 
> nicer).
>
> - You need to add location=packed to \startalign so that it does not use 
> extra horizontal space
>
> - Then you can adjust the vertical location by wrapping everything in a frame.
>
> \starttext
> \startitemize[n]
> \item
>   \startframed[align=normal,frame=off,location=high]
>     \startimath \startalign[n=3,location=packed]
>     \NC S = \NC T_1 + \NC T_2 + T_3 + \cdots + T_n\NR
>     \NC S = \NC \NC T_1 + T_2 + \cdots + T_{n - 1} + T_n\NR
>     \stopalign \stopimath
>   \stopframed
> \stopitemize
> \stoptext
>
> Aditya
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________



-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
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 via email to