Hi,
It looks like putting the \hskip commands between brackets works (-ish) on
my side. (It creates a bit more horizontal space, though, the 5ex and 10ex
may need to be updated.)

Cheers,
Florent

\defineframedtext
   [algorithmframe]
   [width=fit,
    foregroundstyle={\tt\switchtobodyfont[11pt]},
    framecolor=,
    rulethickness=,
    location=middle,
    after=,
    before=,
    ]
 \starttext
 \startlinecorrection[blank]
   \startmidaligned
   \algorithmframe{def pyramide(n) :

     {\hskip 5ex} S = 0

     {\hskip 5ex} for i in range(1,n+1) :

     {\hskip 10ex}       S = \ldots

     {\hskip 5ex} return \ldots
                }
    \stopmidaligned
    \stoplinecorrection
 \stoptext

Le mar. 6 oct. 2026 à 08:59, Fabrice C <[email protected]> a
écrit :

> Hi,
> Wolfgang suggested some code to me for inserting a Python script. It
> worked perfectly until today.
> Thanks
> Fabrice
>
> \defineframedtext
>    [algorithmframe]
>    [width=fit,
>     foregroundstyle={\tt\switchtobodyfont[11pt]},
>     framecolor=,
>     rulethickness=,
>     location=middle,
>     after=,
>     before=,
>     ]
>  \starttext
>  \startlinecorrection[blank]
>    \startmidaligned
>    \algorithmframe{def pyramide(n) :
>
>      \hskip 5ex S = 0
>
>      \hskip 5ex for i in range(1,n+1) :
>
>      \hskip 10ex       S = \ldots
>
>      \hskip 5ex return \ldots
>                 }
>     \stopmidaligned
>     \stoplinecorrection
>  \stoptext
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : [email protected] /
> 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
>
> ___________________________________________________________________________________
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
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