ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] [ extra line in last tabulate column ]
@ 2024-12-22  1:44 vm via ntg-context
  2024-12-24 10:40 ` [NTG-context] " Hans Hagen via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: vm via ntg-context @ 2024-12-22  1:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: vm


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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: [ extra line in last tabulate column ]
  2024-12-22  1:44 [NTG-context] [ extra line in last tabulate column ] vm via ntg-context
@ 2024-12-24 10:40 ` Hans Hagen via ntg-context
  2024-12-24 11:30   ` vm via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen via ntg-context @ 2024-12-24 10:40 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: [ extra line in last tabulate column ]
  2024-12-24 10:40 ` [NTG-context] " Hans Hagen via ntg-context
@ 2024-12-24 11:30   ` vm via ntg-context
  2024-12-24 11:53     ` Hans Hagen
  2024-12-24 11:54     ` [NTG-context] nesting \dorecurse ] vm via ntg-context
  0 siblings, 2 replies; 7+ messages in thread
From: vm via ntg-context @ 2024-12-24 11:30 UTC (permalink / raw)
  To: ntg-context; +Cc: vm

for my perception, what is the difference between

\dorecurse{5}{
}

and

\expandedrepeat 5 {
}


e.g. when to use which?

.Floris
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: [ extra line in last tabulate column ]
  2024-12-24 11:30   ` vm via ntg-context
@ 2024-12-24 11:53     ` Hans Hagen
  2024-12-24 13:55       ` vm via ntg-context
  2024-12-24 11:54     ` [NTG-context] nesting \dorecurse ] vm via ntg-context
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2024-12-24 11:53 UTC (permalink / raw)
  To: ntg-context

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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] nesting \dorecurse ]
  2024-12-24 11:30   ` vm via ntg-context
  2024-12-24 11:53     ` Hans Hagen
@ 2024-12-24 11:54     ` vm via ntg-context
  1 sibling, 0 replies; 7+ messages in thread
From: vm via ntg-context @ 2024-12-24 11:54 UTC (permalink / raw)
  To: ntg-context; +Cc: vm

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

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: [ extra line in last tabulate column ]
  2024-12-24 11:53     ` Hans Hagen
@ 2024-12-24 13:55       ` vm via ntg-context
  2024-12-24 15:14         ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: vm via ntg-context @ 2024-12-24 13:55 UTC (permalink / raw)
  To: ntg-context; +Cc: vm



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




___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: [ extra line in last tabulate column ]
  2024-12-24 13:55       ` vm via ntg-context
@ 2024-12-24 15:14         ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen via ntg-context @ 2024-12-24 15:14 UTC (permalink / raw)
  To: vm via ntg-context; +Cc: Hans Hagen

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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-12-24 15:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-22  1:44 [NTG-context] [ extra line in last tabulate column ] vm via ntg-context
2024-12-24 10:40 ` [NTG-context] " Hans Hagen via ntg-context
2024-12-24 11:30   ` vm via ntg-context
2024-12-24 11:53     ` Hans Hagen
2024-12-24 13:55       ` vm via ntg-context
2024-12-24 15:14         ` Hans Hagen via ntg-context
2024-12-24 11:54     ` [NTG-context] nesting \dorecurse ] vm via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).