ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* processing very big tables
@ 2017-04-09 11:20 Thomas A. Schmitz
  2017-04-09 13:57 ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas A. Schmitz @ 2017-04-09 11:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I need some fundamental advice from experienced users: I'm processing 
xml and collecting the data in lua tables, which I want to typeset in 
some sort of table or tabular format. Typesetting requirements are 
fairly low, just a couple of columns that need to be nicely aligned, 
with the occasional horizontal overflow that should be handled 
gracefully (i.e. longer lines should be broken), and of course, the 
table has to break across pages. However, the lua tables have several 
thousands of entries, and I expect the final document to have around 
3,000 pages. When I tried Natural Tables, I got a "TeX capacity 
exceeded" error, which disappeared when I tried with a smaller part of 
my document. So my question is: what is the most "inexpensive" way of 
typesetting this sort of material? One of the table environments? Which 
one (would xtables be better?)? Or low-level vboxes within hboxes etc.? 
Or just \framed within \framed? What would you suggest for this sort of 
material?

Thanks for your insights!

Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-09 11:20 processing very big tables Thomas A. Schmitz
@ 2017-04-09 13:57 ` Hans Hagen
  2017-04-09 14:53   ` Thomas A. Schmitz
  2017-04-10 14:25   ` Thomas A. Schmitz
  0 siblings, 2 replies; 11+ messages in thread
From: Hans Hagen @ 2017-04-09 13:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/9/2017 1:20 PM, Thomas A. Schmitz wrote:
> Hi all,
>
> I need some fundamental advice from experienced users: I'm processing
> xml and collecting the data in lua tables, which I want to typeset in
> some sort of table or tabular format. Typesetting requirements are
> fairly low, just a couple of columns that need to be nicely aligned,
> with the occasional horizontal overflow that should be handled
> gracefully (i.e. longer lines should be broken), and of course, the
> table has to break across pages. However, the lua tables have several
> thousands of entries, and I expect the final document to have around
> 3,000 pages. When I tried Natural Tables, I got a "TeX capacity
> exceeded" error, which disappeared when I tried with a smaller part of
> my document. So my question is: what is the most "inexpensive" way of
> typesetting this sort of material? One of the table environments? Which
> one (would xtables be better?)? Or low-level vboxes within hboxes etc.?
> Or just \framed within \framed? What would you suggest for this sort of
> material?

\starttext

\setuplinetable[n=2,lines=25]
\setuplinetable[c][1][width=6cm] % 
,background=color,backgroundcolor=red,color=white]
\setuplinetable[c][1][width=6cm] % 
,background=color,backgroundcolor=red,color=white]
\setuplinetable[1][all][background=color,backgroundcolor=white]

\dontcomplain

\startlinetable
     \dorecurse{100}{
         \dorecurse{100}{
             \NC aaa \NC test test test  test \NC \NR
         }
     }
\stoplinetable

\page

% \startluacode
%     local context = context
%     local NC = context.NC
%     local NR = context.NR

%     context.startlinetable()
%     for i=1,100 do
%         for i=1,100 do
%             NC()
%             context("aaa")
%             NC()
%             context("test test test test")
%             NC()
%             NR()
%         end

%     context.stoplinetable()
% \stopluacode



\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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-09 13:57 ` Hans Hagen
@ 2017-04-09 14:53   ` Thomas A. Schmitz
  2017-04-11  8:02     ` Henning Hraban Ramm
  2017-04-10 14:25   ` Thomas A. Schmitz
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas A. Schmitz @ 2017-04-09 14:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 04/09/2017 03:57 PM, Hans Hagen wrote:
> \starttext
>
> \setuplinetable[n=2,lines=25]
> \setuplinetable[c][1][width=6cm] %
> ,background=color,backgroundcolor=red,color=white]
> \setuplinetable[c][1][width=6cm] %
> ,background=color,backgroundcolor=red,color=white]
> \setuplinetable[1][all][background=color,backgroundcolor=white]
>
> \dontcomplain

Alright, so the answer is: "use linetables!" Thanks, Hans: I will play 
with them and report back!

Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-09 13:57 ` Hans Hagen
  2017-04-09 14:53   ` Thomas A. Schmitz
@ 2017-04-10 14:25   ` Thomas A. Schmitz
  2017-04-10 15:07     ` Hans Hagen
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas A. Schmitz @ 2017-04-10 14:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 09.04.2017 15:57, Hans Hagen wrote:
>
> \starttext
>
> \setuplinetable[n=2,lines=25]
> \setuplinetable[c][1][width=6cm] %
> ,background=color,backgroundcolor=red,color=white]
> \setuplinetable[c][1][width=6cm] %
> ,background=color,backgroundcolor=red,color=white]
> \setuplinetable[1][all][background=color,backgroundcolor=white]
>
> \dontcomplain
>
> \startlinetable
>     \dorecurse{100}{
>         \dorecurse{100}{
>             \NC aaa \NC test test test  test \NC \NR
>         }
>     }
> \stoplinetable
>
> \page

Alright, I experimented a bit and am back with questions I couldn't 
solve by looking at the source:

1. How does the parameter lines=NUMBER work? If I set it, I get very 
weird page breaks in some locations and lines that are printed above 
each other in other places. When I leave it out, the table isn't typeset 
at all. I can't find the right parameter to have the table fill the 
entire page.

2. Is it possible to get horizontal and vertical lines?

Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-10 14:25   ` Thomas A. Schmitz
@ 2017-04-10 15:07     ` Hans Hagen
  2017-04-10 15:20       ` Thomas A. Schmitz
  2017-04-11  9:53       ` Thomas A. Schmitz
  0 siblings, 2 replies; 11+ messages in thread
From: Hans Hagen @ 2017-04-10 15:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/10/2017 4:25 PM, Thomas A. Schmitz wrote:
> On 09.04.2017 15:57, Hans Hagen wrote:
>>
>> \starttext
>>
>> \setuplinetable[n=2,lines=25]
>> \setuplinetable[c][1][width=6cm] %
>> ,background=color,backgroundcolor=red,color=white]
>> \setuplinetable[c][1][width=6cm] %
>> ,background=color,backgroundcolor=red,color=white]
>> \setuplinetable[1][all][background=color,backgroundcolor=white]
>>
>> \dontcomplain
>>
>> \startlinetable
>>     \dorecurse{100}{
>>         \dorecurse{100}{
>>             \NC aaa \NC test test test  test \NC \NR
>>         }
>>     }
>> \stoplinetable
>>
>> \page
>
> Alright, I experimented a bit and am back with questions I couldn't
> solve by looking at the source:
>
> 1. How does the parameter lines=NUMBER work? If I set it, I get very
> weird page breaks in some locations and lines that are printed above
> each other in other places. When I leave it out, the table isn't typeset
> at all. I can't find the right parameter to have the table fill the
> entire page.

don't set it then (line tables are actually able to span pages 
horizontally)

> 2. Is it possible to get horizontal and vertical lines?

hm, currently not, but i can probably add some features

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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-10 15:07     ` Hans Hagen
@ 2017-04-10 15:20       ` Thomas A. Schmitz
  2017-04-11  9:53       ` Thomas A. Schmitz
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas A. Schmitz @ 2017-04-10 15:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10.04.2017 17:07, Hans Hagen wrote:
>
> don't set it then (line tables are actually able to span pages
> horizontally)

nope, when I don't set it, I don't get a table typeset...

> hm, currently not, but i can probably add some features

would be awesome, if you have the time!

Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-09 14:53   ` Thomas A. Schmitz
@ 2017-04-11  8:02     ` Henning Hraban Ramm
  2017-04-11 14:17       ` Alan Braslau
  0 siblings, 1 reply; 11+ messages in thread
From: Henning Hraban Ramm @ 2017-04-11  8:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2017-04-09 um 16:53 schrieb Thomas A. Schmitz <thomas.schmitz@uni-bonn.de>:

> On 04/09/2017 03:57 PM, Hans Hagen wrote:
>> \starttext
>> 
>> \setuplinetable[n=2,lines=25]
>> \setuplinetable[c][1][width=6cm] %
>> ,background=color,backgroundcolor=red,color=white]
>> \setuplinetable[c][1][width=6cm] %
>> ,background=color,backgroundcolor=red,color=white]
>> \setuplinetable[1][all][background=color,backgroundcolor=white]
>> 
>> \dontcomplain
> 
> Alright, so the answer is: "use linetables!" Thanks, Hans: I will play with them and report back!

Hm, at the meeting it looked like we should/could now use xtables for everything?
Did I misunderstand you, Hans, that xtables can replace all the other kinds of tables?
I assumed linetables were just another try and we could forget about them (you didn’t say that), and now you’re willing to add features, I’m a bit confused.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-10 15:07     ` Hans Hagen
  2017-04-10 15:20       ` Thomas A. Schmitz
@ 2017-04-11  9:53       ` Thomas A. Schmitz
  2017-04-11 10:27         ` Thomas A. Schmitz
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas A. Schmitz @ 2017-04-11  9:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

On 10.04.2017 17:07, Hans Hagen wrote:
> don't set it then (line tables are actually able to span pages
> horizontally)

Hans, just in case it's useful: I have a small test file that shows my 
problem with linetables. The data comes from xml (of course...), but I 
have simply captured it in a lua table (in alphabet.lua). Look at p. 4, 
10, 11, etc.

All best

Thomas

[-- Attachment #2: test.7z --]
[-- Type: application/x-7z-compressed, Size: 48046 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-11  9:53       ` Thomas A. Schmitz
@ 2017-04-11 10:27         ` Thomas A. Schmitz
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas A. Schmitz @ 2017-04-11 10:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11.04.2017 11:53, Thomas A. Schmitz wrote:
>
> Hans, just in case it's useful: I have a small test file that shows my
> problem with linetables. The data comes from xml (of course...), but I
> have simply captured it in a lua table (in alphabet.lua). Look at p. 4,
> 10, 11, etc.
>
> All best
>
> Thomas

Oops, sorry, this was meant for Hans personally, not for the list... We 
apologize for the inconvenience...

Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-11  8:02     ` Henning Hraban Ramm
@ 2017-04-11 14:17       ` Alan Braslau
  2017-04-11 17:35         ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Alan Braslau @ 2017-04-11 14:17 UTC (permalink / raw)
  To: Henning Hraban Ramm; +Cc: mailing list for ConTeXt users

On Tue, 11 Apr 2017 10:02:38 +0200
Henning Hraban Ramm <hraban@fiee.net> wrote:

> Hm, at the meeting it looked like we should/could now use xtables for
> everything? Did I misunderstand you, Hans, that xtables can replace
> all the other kinds of tables?

Perhaps this is a bug that could be fixed, but I have found that *only*
natural tables (\bTABLE...\eTABLE) can be safely used within a (figure)
caption, all other table or tabulation environments have given me
errors.

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: processing very big tables
  2017-04-11 14:17       ` Alan Braslau
@ 2017-04-11 17:35         ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2017-04-11 17:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

On 4/11/2017 4:17 PM, Alan Braslau wrote:
> On Tue, 11 Apr 2017 10:02:38 +0200
> Henning Hraban Ramm <hraban@fiee.net> wrote:
>
>> Hm, at the meeting it looked like we should/could now use xtables for
>> everything? Did I misunderstand you, Hans, that xtables can replace
>> all the other kinds of tables?
>
> Perhaps this is a bug that could be fixed, but I have found that *only*
> natural tables (\bTABLE...\eTABLE) can be safely used within a (figure)
> caption, all other table or tabulation environments have given me
> errors.

it's more a tex issue ... just wrap a something more complex in a \vbox

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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2017-04-11 17:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-09 11:20 processing very big tables Thomas A. Schmitz
2017-04-09 13:57 ` Hans Hagen
2017-04-09 14:53   ` Thomas A. Schmitz
2017-04-11  8:02     ` Henning Hraban Ramm
2017-04-11 14:17       ` Alan Braslau
2017-04-11 17:35         ` Hans Hagen
2017-04-10 14:25   ` Thomas A. Schmitz
2017-04-10 15:07     ` Hans Hagen
2017-04-10 15:20       ` Thomas A. Schmitz
2017-04-11  9:53       ` Thomas A. Schmitz
2017-04-11 10:27         ` Thomas A. Schmitz

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).