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
___________________________________________________________________________________