processing very big tables
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
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 -----------------------------------------------------------------
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
Am 2017-04-09 um 16:53 schrieb Thomas A. Schmitz
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
On Tue, 11 Apr 2017 10:02:38 +0200
Henning Hraban Ramm
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
On 4/11/2017 4:17 PM, Alan Braslau wrote:
On Tue, 11 Apr 2017 10:02:38 +0200 Henning Hraban Ramm
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 -----------------------------------------------------------------
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
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 -----------------------------------------------------------------
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
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
participants (4)
-
Alan Braslau
-
Hans Hagen
-
Henning Hraban Ramm
-
Thomas A. Schmitz