
Hi folks, is it possible to use an externalfigure (blabla.jpg) as a repeated header in a table and if yes, how can I use it? \setupTABLE[][][\externalfigure[blabla]] doesn't work. Thank you for any hint! Greetings Tomás

Am 05.07.2025 um 10:51 schrieb Thomas Meyer:
Hi folks,
is it possible to use an externalfigure (blabla.jpg) as a repeated header in a table and if yes, how can I use it? \setupTABLE[][][\externalfigure[blabla]] doesn't work.
\setupexternalfigures[location=default] \starttext \bTABLE[split=repeat] \bTABLEhead \bTR \bTD[strut=no,align=middle] \dontleavehmode\externalfigure[hacker][height=4ex] \eTD \eTR \eTABLEhead \bTABLEbody \dorecurse{100}{\bTR \bTD table cell \eTD \eTR} \eTABLEbody \eTABLE \stoptext Wolfgang

the \recurselevel remains at zero, why? \setupexternalfigures[location=default] \starttext \bTABLE[split=repeat] \dorecurse{20}{\recurselevel\quad } % <-- this shows the \recurselevel \bTABLEhead \bTR \bTD[strut=no,align=middle] \dontleavehmode\externalfigure[hacker][height=4ex] \eTD \eTR \eTABLEhead \bTABLEbody \dorecurse{100}{\bTR \bTD table cell \recurselevel \eTD \eTR} % <- zero \eTABLEbody \eTABLE \stoptext On 05/07/2025 11:13, Wolfgang Schuster wrote:
Am 05.07.2025 um 10:51 schrieb Thomas Meyer:
Hi folks,
is it possible to use an externalfigure (blabla.jpg) as a repeated header in a table and if yes, how can I use it? \setupTABLE[][][\externalfigure[blabla]] doesn't work.
\setupexternalfigures[location=default]
\starttext
\bTABLE[split=repeat] \bTABLEhead \bTR \bTD[strut=no,align=middle] \dontleavehmode\externalfigure[hacker] [height=4ex] \eTD \eTR \eTABLEhead \bTABLEbody \dorecurse{100}{\bTR \bTD table cell \eTD \eTR} \eTABLEbody \eTABLE
\stoptext
Wolfgang
___________________________________________________________________________________ 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 ___________________________________________________________________________________

Am 05.07.2025 um 11:36 schrieb vm via ntg-context:
the \recurselevel remains at zero, why?
\setupexternalfigures[location=default]
\starttext
\bTABLE[split=repeat] \dorecurse{20}{\recurselevel\quad } % <-- this shows the \recurselevel \bTABLEhead \bTR \bTD[strut=no,align=middle] \dontleavehmode\externalfigure[hacker] [height=4ex] \eTD \eTR \eTABLEhead \bTABLEbody \dorecurse{100}{\bTR \bTD table cell \recurselevel \eTD \eTR} % <- zero \eTABLEbody \eTABLE
\stoptext
Most of contexts table environments process the content multiple times to get the cell width and height, as a result the loop iterator is expanded way after the loop has run and the default value 0 is used. To avoid this you can access the value with #1 (or ##1, ####1 etc. in nested loops), use \expanded the expand the value (at the moment broken in lmtx) or use the \expandedrepeat primitive. \starttext \bTABLE \dorecurse{10}{\bTR \bTD row #1 \eTD \eTR} \eTABLE % \bTABLE % \dorecurse{10}{\bTR \expanded{\bTD row \recurselevel \eTD} \eTR} % \eTABLE \bTABLE \expandedrepeat 10 {\bTR \bTD row \the\currentloopiterator \eTD \eTR} \eTABLE \stoptext Wolfgang

Am 05.07.25 um 11:13 schrieb Wolfgang Schuster:
Am 05.07.2025 um 10:51 schrieb Thomas Meyer:
Hi folks,
is it possible to use an externalfigure (blabla.jpg) as a repeated header in a table and if yes, how can I use it? \setupTABLE[][][\externalfigure[blabla]] doesn't work.
\setupexternalfigures[location=default]
\starttext
\bTABLE[split=repeat] \bTABLEhead \bTR \bTD[strut=no,align=middle] \dontleavehmode\externalfigure[hacker][height=4ex] \eTD \eTR \eTABLEhead \bTABLEbody \dorecurse{100}{\bTR \bTD table cell \eTD \eTR} \eTABLEbody \eTABLE
\stoptext
Thank you Wolfgang, but I wrote some pretty rubbish. In a table, I need a text that repeats on all pages as a table header consisting of two lines. I use the table format with \setupTABLE, \startTABLE, \NC, \NR and so on. I also need an image in the header on each page. Unfortunately, I am at a loss at the moment and have no idea about either I hope for your help Greetings Tomás

Am 05.07.2025 um 15:27 schrieb Thomas Meyer:
Am 05.07.25 um 11:13 schrieb Wolfgang Schuster:
Am 05.07.2025 um 10:51 schrieb Thomas Meyer:
Hi folks,
is it possible to use an externalfigure (blabla.jpg) as a repeated header in a table and if yes, how can I use it? \setupTABLE[][][\externalfigure[blabla]] doesn't work.
\setupexternalfigures[location=default]
\starttext
\bTABLE[split=repeat] \bTABLEhead \bTR \bTD[strut=no,align=middle] \dontleavehmode\externalfigure[hacker][height=4ex] \eTD \eTR \eTABLEhead \bTABLEbody \dorecurse{100}{\bTR \bTD table cell \eTD \eTR} \eTABLEbody \eTABLE
\stoptext
Thank you Wolfgang,
but I wrote some pretty rubbish.
In a table, I need a text that repeats on all pages as a table header consisting of two lines. I use the table format with \setupTABLE, \startTABLE, \NC, \NR and so on.
The \setupTABLE command is used to control the layout of natural tables I used in my example. \startTABLE is a wrapper for natural tables to save a few keys strokes (less markup) for less text heavy content.
I also need an image in the header on each page.
You can \setupheadertexts to place the image in the header area or use a layer to place it wherever you want.
Unfortunately, I am at a loss at the moment and have no idea about either
\setupexternalfigures[location=default] \setupheadertexts[{\externalfigure[hacker][height=\headerheight]}] \starttext \startTABLE[split=repeat] \startTABLEhead \NC First line\\Second line \NC\NR \stopTABLEhead \startTABLEbody \dorecurse{100}{\NC row #1 \NC\NR} \stopTABLEbody \stopTABLE \stoptext Wolfgang

Am 05.07.25 um 15:55 schrieb Wolfgang Schuster:
\setupexternalfigures[location=default]
\setupheadertexts[{\externalfigure[hacker][height=\headerheight]}]
\starttext
\startTABLE[split=repeat] \startTABLEhead \NC First line\\Second line \NC\NR \stopTABLEhead \startTABLEbody \dorecurse{100}{\NC row #1 \NC\NR} \stopTABLEbody \stopTABLE
\stoptext
Thanks Wolfgang, that was THE help I needed. Now I was able to bring the thing to a nice end. Greetings Tomás
participants (3)
-
Thomas Meyer
-
vm
-
Wolfgang Schuster