[ extra line in last tabulate column ]
if the last column of a tabulate table is a paragraph, an extra blank line is added at the top, making the last column not align. adding data in the last (non) paragraph column, will make them top align correctly. 8<--- \starttext \starttabulate[|p|p|p|l|][width=\textwidth, split=yes,margin=2mm, align=right] \dorecurse{3}{ \dorecurse{3}{ \NC Lorem ipsum dolor sit amet, consectetur adip iscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. }% <<< no data here \AR } \stoptabulate \page \starttabulate[|p|p|p|l|][width=\textwidth, split=yes,margin=2mm, align=right] \dorecurse{3}{ \dorecurse{3}{ \NC Lorem ipsum dolor sit amet, consectetur adip iscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. }\NC\recurselevel %%%%%%%% <<< add data here \AR } \stoptabulate \stoptext --->8
On 12/22/2024 2:44 AM, vm via ntg-context wrote:
if the last column of a tabulate table is a paragraph, an extra blank line is added at the top, making the last column not align.
adding data in the last (non) paragraph column, will make them top align correctly.
8<--- \starttext
\starttabulate[|p|p|p|l|][width=\textwidth, split=yes,margin=2mm, align=right] \dorecurse{3}{ \dorecurse{3}{ \NC Lorem ipsum dolor sit amet, consectetur adip iscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. }% <<< no data here \AR } \stoptabulate
\page \starttabulate[|p|p|p|l|][width=\textwidth, split=yes,margin=2mm, align=right] \dorecurse{3}{ \dorecurse{3}{ \NC Lorem ipsum dolor sit amet, consectetur adip iscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. }\NC\recurselevel %%%%%%%% <<< add data here \AR } \stoptabulate
\stoptext --->8
\starttext \starttabulate[|p|p|p|l|][width=\textwidth, split=yes,margin=2mm, align=right] \expandedrepeat 3 { \NC \expandedrepeat 3 { \the\currentloopiterator: Lorem ipsum dolor sit amet, consectetur adip iscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. \NC } \AR } \stoptabulate \starttabulate[|p|p|p|l|][width=\textwidth, split=yes,margin=2mm, align=right] \expandedrepeat 3 { \NC \expandedrepeat 3 { \the\currentloopiterator: Lorem ipsum dolor sit amet, consectetur adip iscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. \NC } \the\currentloopiterator \NC \NR } \stoptabulate \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
for my perception, what is the difference between \dorecurse{5}{ } and \expandedrepeat 5 { } e.g. when to use which? .Floris
On 12/24/2024 12:30 PM, vm via ntg-context wrote:
for my perception, what is the difference between
\dorecurse{5}{ }
more heavy
and
\expandedrepeat 5 { }
primitive (more efficient)
e.g. when to use which?
your choice (i use it here to practice and test) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 24/12/2024 12:53, Hans Hagen wrote:
your choice (i use it here to practice and test)
There seems to be a difference in behavior too. In the example the \dorecurse places extra space before the B .Floris 8<--- \starttext \starttabulate[|c|] \HL\expandedrepeat 4 {\NC B\AR\HL} \stoptabulate \starttabulate[|c|] \HL\dorecurse{4}{\NC B\AR\HL} \stoptabulate \stoptext --->8
On 12/24/2024 2:55 PM, vm via ntg-context wrote:
On 24/12/2024 12:53, Hans Hagen wrote:
your choice (i use it here to practice and test)
There seems to be a difference in behavior too. In the example the \dorecurse places extra space before the B
.Floris
8<---
\starttext
\starttabulate[|c|] \HL\expandedrepeat 4 {\NC B\AR\HL} \stoptabulate
\starttabulate[|c|] \HL\dorecurse{4}{\NC B\AR\HL} \stoptabulate
\stoptext
--->8
Well, there is your x-mas puzzle then \starttext \writestatus{!!!!}{} \writestatus{!!!!}{\string\expandedrepeat} \writestatus{!!!!}{} \starttabulate[|c|] \HL\tracingall\expandedrepeat 1 {\NC B\AR\HL} \stoptabulate \writestatus{!!!!}{} \writestatus{!!!!}{} \writestatus{!!!!}{\string\dorecurse} \starttabulate[|c|] \HL\tracingall\dorecurse{1}{\NC B\AR\HL} \stoptabulate \writestatus{!!!!}{} \writestatus{!!!!}{\string\localcontrolledrepeat} \writestatus{!!!!}{} \starttabulate[|c|] \HL\tracingall\localcontrolledrepeat 1 {\NC B\AR\HL} \stoptabulate \writestatus{!!!!}{} \writestatus{!!!!}{\string\expandedloop} \writestatus{!!!!}{} \starttabulate[|c|] \HL\tracingall\expandedloop 1 1 1 {\NC B\AR\HL} \stoptabulate \writestatus{!!!!}{} \writestatus{!!!!}{\string\dostepwiserecurse} \writestatus{!!!!}{} \starttabulate[|c|] \HL\tracingall\dostepwiserecurse{1}{1}{1}{\NC B\AR\HL} \stoptabulate \writestatus{!!!!}{} \writestatus{!!!!}{DONE} \writestatus{!!!!}{} \stoptext Also, guess which ones are more efficient. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
For some reason there is a difference between placing the opening \HL before the \dorecurse and include a closing \HL in the loop, versus placing the opening \HL it in the loop and appending the closing \HL outside the \dorecurse. Is this the reason to use the new \expandedrepeat instead? .Floris 8<--- \starttext \starttabulate[|l|] % this does not work \dorecurse{5}{ \HL \NC b \AR } \HL \stoptabulate \starttabulate[|l|] % this works \HL \dorecurse{5}{ \NC a \AR \HL } \stoptabulate \starttabulate[|l|] % this works \HL \NC c \AR \HL \NC c \AR \HL \NC c \AR \HL \NC c \AR \HL \NC c \AR \HL \stoptabulate \starttabulate[|l|] % this works \expandedrepeat 5 { \HL \NC d \AR } \HL \stoptabulate \stoptext --->8
participants (3)
-
Hans Hagen
-
Hans Hagen
-
vm