Hi, I usually don't need tables, therefore this maybe stupid question: What is the currently recommended way to typeset tables? Still natural tables? Or extreme tables? (My tables won't be 30 pages long.) Also, how do you easiest define booktabs style tables? I mean: can you define tables such that the last row end with thicker lines without having to make this explicit? Is there a mechanism for this? (That would make the XML mapping much simpler.) Best Denis
Am 22.09.2020 um 10:03 schrieb Denis Maier
: I usually don't need tables, therefore this maybe stupid question: What is the currently recommended way to typeset tables? Still natural tables? Or extreme tables? (My tables won't be 30 pages long.)
tabulate as far as it fits your needs, then natural tables (Hans dixit in 2019).
Also, how do you easiest define booktabs style tables? I mean: can you define tables such that the last row end with thicker lines without having to make this explicit? Is there a mechanism for this? (That would make the XML mapping much simpler.)
In tabulate you have several kinds of horizontal lines (\HL, \FL, \ML, \LL), but you need to set them and define their width individually. IMO the different line widths of booktabs are very oldfashioned. Try to avoid lines as far as possible, and then use them unobtrusively. Depending on your product (black printing, CMYK printing, screen only) you can use light colors, but be aware that thin, rasterized lines look jagged, while you can e.g. use 100% cyan even in 0.25pt, if the resolution of the press (offset/digital) works with such thin lines. Also don’t use indented table lines if you don’t use vertical lines (and you should usually avoid those). Hraban
Am 22.09.2020 um 16:31 schrieb Henning Hraban Ramm:
tabulate as far as it fits your needs, then natural tables (Hans dixit in 2019).
That's in fact part of the question: I can not easily tell what the particular shortcomings are. As this is for an XML setup that supposed for more than one product, I have to make some design decisions right at the beginning and I won't be able to make ad hoc adjustments.
In tabulate you have several kinds of horizontal lines (\HL, \FL, \ML, \LL), but you need to set them and define their width individually.
IMO the different line widths of booktabs are very oldfashioned. Try to avoid lines as far as possible, and then use them unobtrusively. Depending on your product (black printing, CMYK printing, screen only) you can use light colors, but be aware that thin, rasterized lines look jagged, while you can e.g. use 100% cyan even in 0.25pt, if the resolution of the press (offset/digital) works with such thin lines.
Also don’t use indented table lines if you don’t use vertical lines (and you should usually avoid those).
Thanks for the suggestions. I'll keep that in mind. As said before, I don't really regularly use tables so I don't have much experience here. Best, Denis
On Tue, 22 Sep 2020, Denis Maier wrote:
Also, how do you easiest define booktabs style tables? I mean: can you define tables such that the last row end with thicker lines without having to make this explicit? Is there a mechanism for this?
You can get this behavior using any of table mechanism. The wiki has an example when using the (now deprecated) TaBlE macros https://wiki.contextgarden.net/Table#Booktabs The same effect is rather easy to achieve when using natural tables as well. \startsetups booktabs \setupTABLE[each][each][frame=off] \setupTABLE[row][first][topframe=on,rulethickness=1.2bp] \setupTABLE[row][2] [topframe=on,rulethickness=0.6bp] \setupTABLE[row][last] [bottomframe=on, rulethickness=1.2bp] \setupTABLE[row][first][style=bold] \stopsetups \starttext \startTABLE[setups=booktabs] \NC Heading 1 \NC Heading 2 \NC Heading 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \stopTABLE \stoptext Aditya
On Tue, Sep 22 2020, Aditya Mahajan wrote:
The same effect is rather easy to achieve when using natural tables as well.
But it fails, when there is only one data-row... :( \startsetups booktabs \setupTABLE[each][each][frame=off] \setupTABLE[row][first][topframe=on,rulethickness=1.2bp] \setupTABLE[row][2] [topframe=on,rulethickness=0.6bp] \setupTABLE[row][last] [bottomframe=on, rulethickness=1.2bp] \setupTABLE[row][first][style=bold] \stopsetups \startsetups workaround \setupTABLE[each][each][frame=off] \setupTABLE[row][first][topframe=on,rulethickness=1.2bp,offset=0pt] \setupTABLE[row][2] [style=bold, bottomframe=on,rulethickness=0.6bp] \setupTABLE[row][last] [bottomframe=on, rulethickness=1.2bp] \stopsetups \starttext \startTABLE[setups=booktabs] \NC Heading 1 \NC Heading 2 \NC Heading 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \stopTABLE \blank \startTABLE[setups=workaround] \NC\NC\NC\NC\NR \NC Heading 1 \NC Heading 2 \NC Heading 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \stopTABLE \stoptext -- Peter
On Tue, 22 Sep 2020, Peter Münster wrote:
On Tue, Sep 22 2020, Aditya Mahajan wrote:
The same effect is rather easy to achieve when using natural tables as well.
But it fails, when there is only one data-row... :(
Then don't create tables with only one data row :-) A better solution is to create a dedicate framehandler which draws the bottom frame at half the thickness: \startuseMPgraphic{booktabs_bottom} draw bottomboundary OverlayBox withpen pencircle scaled (OverlayLineWidth/2) withcolor OverlayColor; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \defineoverlay[booktabs_bottom] [\uniqueMPgraphic{booktabs_bottom}] \installbottomframerenderer{booktabs}{\uniqueMPgraphic{booktabs_bottom}} \startsetups booktabs \setupTABLE[each][each][frame=off, rulethickness=1.2bp] \setupTABLE[row][first][topframe=on, bottomframe=booktabs] \setupTABLE[row][last] [bottomframe=on] \setupTABLE[row][first][style=bold] \stopsetups \starttext \startTABLE[setups=booktabs] \NC Heading 1 \NC Heading 2 \NC Heading 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \stopTABLE \blank[2*line] \startTABLE[setups=booktabs] \NC Heading 1 \NC Heading 2 \NC Heading 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \stopTABLE \stoptext Aditya
Am 22.09.2020 um 20:55 schrieb Aditya Mahajan:
On Tue, 22 Sep 2020, Denis Maier wrote:
Also, how do you easiest define booktabs style tables? I mean: can you define tables such that the last row end with thicker lines without having to make this explicit? Is there a mechanism for this?
You can get this behavior using any of table mechanism. The wiki has an example when using the (now deprecated) TaBlE macros
https://wiki.contextgarden.net/Table#Booktabs
The same effect is rather easy to achieve when using natural tables as well.
\startsetups booktabs \setupTABLE[each][each][frame=off] \setupTABLE[row][first][topframe=on,rulethickness=1.2bp] \setupTABLE[row][2] [topframe=on,rulethickness=0.6bp] \setupTABLE[row][last] [bottomframe=on, rulethickness=1.2bp]
\setupTABLE[row][first][style=bold] \stopsetups
\starttext
\startTABLE[setups=booktabs] \NC Heading 1 \NC Heading 2 \NC Heading 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \NC Value 1 \NC Value 2 \NC Value 3 \NC \NR \stopTABLE \stoptext
Aditya
Thanks. That's exactly what I was looking for. By the way, I couldn't get the \startTABLE syntax working in a XML setting. Is this the same as with extreme tables? The classic syntax with \bTABLE \eTABLE works though. Best, Denis
participants (4)
-
Aditya Mahajan
-
Denis Maier
-
Henning Hraban Ramm
-
Peter Münster