[NTG-context] recursion in a table
Aditya Mahajan
adityam at umich.edu
Mon May 2 02:30:11 CEST 2022
On Sun, 1 May 2022, Henning Hraban Ramm via ntg-context wrote:
> Hi,
> I was playing with the example from
> https://wiki.contextgarden.net/Scaling_Rotating_Mirroring_Clipping#Location_parameter
> and tried to put it in a tabulate:
>
>
> \useMPlibrary[dum]
> \setupexternalfigures[width=3em,height=2em,frame=on,]
>
> %\def\TXT{\ruledhbox{\bf(XyX)}}
> \def\TXT{\externalfigure[pic]}
>
> \starttabulate[|l|l|l|l|l|l|]
> \NC\NC normal\NC depth\NC fit\NC broad\NC high\NC\NR
> \HL
> \dostepwiserecurse{0}{359}{45}{%
> %\expanded{\setuprotate[rotation=\recurselevel]}
> \NC{\expanded{\recurselevel}˚}%
Untested, but I think that you might need:
\expanded{\NC \recurselevel \noexpand\NC ... }
> This works, but \recurselevel is always 0. I know I must expand it (like
> in the original example), but I can’t make it work within the tabulation.
> In the first column, \expanded{\recurselevel} stays 0, and
> rotation=\expanded{\recurselevel} gives an error, while the \setuprotate
> line has no effect (if I remove "rotation=\recurselevel", of course).
>
> How would that work?
Remind me of a more-than-a-decade-old discussion on the mailing list, summarized here:
https://adityam.github.io/context-blog/post/tex-programming/
> Also, \HL doesn’t work at the end, and the second line of the error
> message makes no sense:
I find that in such cases, using Lua (CLD) is the simplest solution
Aditya
More information about the ntg-context
mailing list