# [NTG-context] recursion in a table

Henning Hraban Ramm texml at fiee.net
Sun May 1 20:43:23 CEST 2022

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}˚}%

\NC{\ruledhbox{X\rotate[location=normal,rotation=\recurselevel]{\TXT}X}}%
\NC{\ruledhbox{X\rotate[location=depth,rotation=\recurselevel]
{\TXT}X}}%
\NC{\ruledhbox{X\rotate[location=fit,rotation=\recurselevel]
{\TXT}X}}%
{\TXT}X}}%
\NC{\ruledhbox{X\rotate[location=high,rotation=\recurselevel]
{\TXT}X}}%
\NC\NR}
%    \HL % error
\stoptabulate

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?

Also, \HL doesn’t work at the end, and the second line of the error
message makes no sense:
"""
I expect to see \noalign only after the \cr of an alignment.
Proceed, and I'll ignore this case.
mtx-context     | fatal error: return code: 1
"""

Hraban