professional looking tables
Dear context users: In latex I could make professional looking tables using booktabs module. Using longtable package I could make nice looking multipage tables. I see that context offers several table environments. Which one of them is suitable for making professional (publication quality) tables? The requirements for such tables are the follows: - Only horizontal rules are needed - Ability to set the rule's thickness for top rule, bottom rule, middle rule - Ability to set the distance between rules and table content - Ability to set rule length shorter than cell or row width on both left and right sides - Ability to set rules for spanning only some of the columns In addition, for multipage tables: - head row at the start of table - head rows at top on every page (possibly including first page) - foot row ate the end of table - foot rows at the end of every page (possibly including last page) Is this feasible in current context? Thank you in advance, bcsikos
On 12/18/2016 07:19 PM, Csikos Bela wrote:
Dear context users: [...] I see that context offers several table environments. Which one of them is suitable for making professional (publication quality) tables? [...] Is this feasible in current context?
Dear Csikos, http://www.pragma-ade.com/general/manuals/xtables-mkiv.pdf is your friend here. No sample, no code as reply ;-). Pablo -- http://www.ousia.tk
Pablo Rodriguez írta:
On 12/18/2016 07:19 PM, Csikos Bela wrote:
Dear context users: [...] I see that context offers several table environments. Which one of them is suitable for making professional (publication quality) tables? [...] Is this feasible in current context?
Dear Csikos,
http://www.pragma-ade.com/general/manuals/xtables-mkiv.pdf is your friend here.
Thank you. I started to learn xtables but I have problems. When I use toffset and boffset the table is not rendered correctly. The width of the columns are not correct, the defined widths are not applied to the columns. See my example code below and the corresponding pdf result, xtables example 1. I use context beta standalone: ConTeXt ver: 2016.10.12 17:26 MKIV beta fmt: 2016.10.13 int: english/english. Code: \starttext xtables example 1 \startxtable[frame=off,topframe=on,bottomframe=on,toffset=0.4cm,boffset=0.6cm] \startxrow \startxcell[width=4cm] First Column \stopxcell \startxcell[width=5cm] Second Column \stopxcell \startxcell[width=2cm] Third Column \stopxcell \stopxrow \startxrow \startxcell Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. \stopxcell \startxcell Lorem ipsum dolor sit amet, consectetur adipiscing elit. \stopxcell \startxcell Lorem ipsum \stopxcell \stopxrow \startxrow \startxcell Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell Pellentesque \stopxcell \stopxrow \startxrow \startxcell Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell Donec nunc lorem, sollicitudin vel sodales eget Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell Donec \stopxcell \stopxrow \stopxtable \stoptext How can I fix this? Thank you in advance, bcsikos
On 12/22/2016 4:02 PM, Csikos Bela wrote:
Pablo Rodriguez írta:
On 12/18/2016 07:19 PM, Csikos Bela wrote:
Dear context users: [...] I see that context offers several table environments. Which one of them is suitable for making professional (publication quality) tables? [...] Is this feasible in current context?
Dear Csikos,
http://www.pragma-ade.com/general/manuals/xtables-mkiv.pdf is your friend here.
Thank you. I started to learn xtables but I have problems. When I use toffset and boffset the table is not rendered correctly. The width of the columns are not correct, the defined widths are not applied to the columns. See my example code below and the corresponding pdf result, xtables example 1. I use context beta standalone: ConTeXt ver: 2016.10.12 17:26 MKIV beta fmt: 2016.10.13 int: english/english.
Code:
\starttext
xtables example 1
\startxtable[frame=off,topframe=on,bottomframe=on,toffset=0.4cm,boffset=0.6cm] \startxrow \startxcell[width=4cm] First Column \stopxcell \startxcell[width=5cm] Second Column \stopxcell \startxcell[width=2cm] Third Column \stopxcell \stopxrow \startxrow \startxcell Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. \stopxcell \startxcell Lorem ipsum dolor sit amet, consectetur adipiscing elit. \stopxcell \startxcell Lorem ipsum \stopxcell \stopxrow \startxrow \startxcell Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell Pellentesque \stopxcell \stopxrow \startxrow \startxcell Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell Donec nunc lorem, sollicitudin vel sodales eget Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell Donec \stopxcell \stopxrow \stopxtable
\stoptext
How can I fix this?
\setupxtable[one] [width=4cm] \setupxtable[two] [width=5cm] \setupxtable[three][width=2cm] \startxtable[frame=off,topframe=on,bottomframe=on,toffset=0.4cm,boffset=0.6cm] \startxrow \startxcell[one] First Column \stopxcell \startxcell[two] Second Column \stopxcell \startxcell[three] Third Column \stopxcell \stopxrow \startxrow \startxcell[one] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. \stopxcell \startxcell[two] Lorem ipsum dolor sit amet, consectetur adipiscing elit. \stopxcell \startxcell[three] Lorem ipsum \stopxcell \stopxrow \startxrow \startxcell[one] Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell[two] Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell[three] Pellentesque \stopxcell \stopxrow \startxrow \startxcell[one] Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell[two] Donec nunc lorem, sollicitudin vel sodales eget Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell[three] Donec \stopxcell \stopxrow \stopxtable ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen írta:
On 12/22/2016 4:02 PM, Csikos Bela wrote:
Pablo Rodriguez írta:
On 12/18/2016 07:19 PM, Csikos Bela wrote:
Dear context users: [...] I see that context offers several table environments. Which one of them is suitable for making professional (publication quality) tables? [...] Is this feasible in current context?
Dear Csikos,
http://www.pragma-ade.com/general/manuals/xtables-mkiv.pdf is your friend here.
Thank you. I started to learn xtables but I have problems. When I use toffset and boffset the table is not rendered correctly. The width of the columns are not correct, the defined widths are not applied to the columns. See my example code below and the corresponding pdf result, xtables example 1. I use context beta standalone: ConTeXt ver: 2016.10.12 17:26 MKIV beta fmt: 2016.10.13 int: english/english.
Code:
\starttext
xtables example 1
\startxtable[frame=off,topframe=on,bottomframe=on,toffset=0.4cm,boffset=0.6cm] \startxrow \startxcell[width=4cm] First Column \stopxcell \startxcell[width=5cm] Second Column \stopxcell \startxcell[width=2cm] Third Column \stopxcell \stopxrow \startxrow \startxcell Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. \stopxcell \startxcell Lorem ipsum dolor sit amet, consectetur adipiscing elit. \stopxcell \startxcell Lorem ipsum \stopxcell \stopxrow \startxrow \startxcell Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell Pellentesque \stopxcell \stopxrow \startxrow \startxcell Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell Donec nunc lorem, sollicitudin vel sodales eget Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell Donec \stopxcell \stopxrow \stopxtable
\stoptext
How can I fix this?
\setupxtable[one] [width=4cm] \setupxtable[two] [width=5cm] \setupxtable[three][width=2cm]
\startxtable[frame=off,topframe=on,bottomframe=on,toffset=0.4cm,boffset=0.6cm] \startxrow \startxcell[one] First Column \stopxcell \startxcell[two] Second Column \stopxcell \startxcell[three] Third Column \stopxcell \stopxrow \startxrow \startxcell[one] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. \stopxcell \startxcell[two] Lorem ipsum dolor sit amet, consectetur adipiscing elit. \stopxcell \startxcell[three] Lorem ipsum \stopxcell \stopxrow \startxrow \startxcell[one] Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell[two] Pellentesque habitant morbi tristique senectus et netus \stopxcell \startxcell[three] Pellentesque \stopxcell \stopxrow \startxrow \startxcell[one] Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell[two] Donec nunc lorem, sollicitudin vel sodales eget Donec nunc lorem, sollicitudin vel sodales eget \stopxcell \startxcell[three] Donec \stopxcell \stopxrow \stopxtable
OK, this works. Thank you for the very fast answer! bcsikos _________________________________________________
Thank you for your help so far. Now I am close to what I'd like to achieve. I want to insert a foot on every pages except on the last page (at the end of the table). Is it possible? I have this simple code: \starttext \setupxtable[split=repeat,header=repeat,footer=repeat] \startxtable[frame=off,topframe=on,bottomframe=on,toffset=2pt,boffset=4pt] \startxtablehead \startxrow[bottomframe=off,rulethickness=2pt] \startxcell Head \stopxcell \stopxrow \stopxtablehead \startxtablenext \startxrow[topframe=off] \startxcell Continued from previous page \stopxcell \stopxrow \startxrow \startxcell Next \stopxcell \stopxrow \stopxtablenext \startxtablefoot[bottomframe=off] \startxrow \startxcell Continued on next page \stopxcell \stopxrow \stopxtablefoot \startxtablebody \startxrow \startxcell \input tufte \stopxcell \stopxrow \startxrow \startxcell \input tufte \stopxcell \stopxrow \startxrow \startxcell \input tufte \stopxcell \stopxrow \startxrow \startxcell \input tufte \stopxcell \stopxrow \startxrow \startxcell \input tufte \stopxcell \stopxrow \startxrow \startxcell \input tufte \stopxcell \stopxrow \startxrow \startxcell \input tufte \stopxcell \stopxrow \stopxtablebody \stopxtable \stoptext Thank you, bcsikos
Dear Hans: I almost can do what I want with xtables except that I cannot add different foot to the very last page of the table. Could it be added to xtables an option for last page foot (on the analogy of head and next options), so that a different foot could be defined for the last page of the table? It would be a nice feature. Unfortunately I have no idea how difficult it is to add such an option, but if it is not too complex, I am asking you to include it in a future context version/update. Thank you in advance. Best regards, bcsikos
On Sun, 18 Dec 2016, Csikos Bela wrote:
Dear context users:
In latex I could make professional looking tables using booktabs module. Using longtable package I could make nice looking multipage tables.
I see that context offers several table environments. Which one of them is suitable for making professional (publication quality) tables?
The requirements for such tables are the follows:
- Only horizontal rules are needed - Ability to set the rule's thickness for top rule, bottom rule, middle rule - Ability to set the distance between rules and table content - Ability to set rule length shorter than cell or row width on both left and right sides - Ability to set rules for spanning only some of the columns
Natural tables can give the same visual output as booktabs but the only way to shorten rules is to either use a "fake" column as spacer or use metapost to draw borders. For simple tables, you could get around this by being a little creative. For example, here is the example from the booktabs package with very little manual tweaking. \startsetups booktabs \setupTABLE[frame=off, rulethickness=0.5bp, loffset=1em] \setupTABLE[column][first][loffset=0em] \setupTABLE[row][first][topframe=on, rulethickness=1.5bp] \setupTABLE[row][last] [bottomframe=on, rulethickness=1bp] \stopsetups \starttext \bTABLE[setups=booktabs] \setupTABLE[column][3][align=flushright] \bTR[topframe=on] \bTD[nc=2, align=middle] Item \eTD \bTD \eTD \eTR \bTR[bottomframe=on] \bTD[topframe=on] Animal \eTD \bTD[topframe=on] Description \eTD \bTD Price (\$) \eTD \eTR \bTR \bTD Gnat \eTD \bTD per gram \eTD \bTD 13.65 \eTD \eTR \bTR \bTD \eTD \bTD each \eTD \bTD 0.01 \eTD \eTR \bTR \bTD Gnu \eTD \bTD stuffed \eTD \bTD 92.50 \eTD \eTR \bTR \bTD Emu \eTD \bTD stuffed \eTD \bTD 33.33 \eTD \eTR \bTR \bTD Armadillo \eTD \bTD frozen \eTD \bTD 8.99 \eTD \eTR \eTABLE \stoptext Aditya
participants (4)
-
Aditya Mahajan
-
Csikos Bela
-
Hans Hagen
-
Pablo Rodriguez