ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* More table questions
@ 2020-09-22  8:03 Denis Maier
  2020-09-22 14:31 ` Henning Hraban Ramm
  2020-09-22 18:55 ` Aditya Mahajan
  0 siblings, 2 replies; 7+ messages in thread
From: Denis Maier @ 2020-09-22  8:03 UTC (permalink / raw)
  To: ntg-context

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

___________________________________________________________________________________
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] 7+ messages in thread

* Re: More table questions
  2020-09-22  8:03 More table questions Denis Maier
@ 2020-09-22 14:31 ` Henning Hraban Ramm
  2020-09-22 20:26   ` Denis Maier
  2020-09-22 18:55 ` Aditya Mahajan
  1 sibling, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2020-09-22 14:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> Am 22.09.2020 um 10:03 schrieb Denis Maier <denis.maier.lists@mailbox.org>:
> 
> 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
___________________________________________________________________________________
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] 7+ messages in thread

* Re: More table questions
  2020-09-22  8:03 More table questions Denis Maier
  2020-09-22 14:31 ` Henning Hraban Ramm
@ 2020-09-22 18:55 ` Aditya Mahajan
  2020-09-22 19:34   ` Peter Münster
  2020-09-22 20:18   ` Denis Maier
  1 sibling, 2 replies; 7+ messages in thread
From: Aditya Mahajan @ 2020-09-22 18:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
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] 7+ messages in thread

* Re: More table questions
  2020-09-22 18:55 ` Aditya Mahajan
@ 2020-09-22 19:34   ` Peter Münster
  2020-09-22 20:02     ` Aditya Mahajan
  2020-09-22 20:18   ` Denis Maier
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Münster @ 2020-09-22 19:34 UTC (permalink / raw)
  To: ConTeXt users

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
___________________________________________________________________________________
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] 7+ messages in thread

* Re: More table questions
  2020-09-22 19:34   ` Peter Münster
@ 2020-09-22 20:02     ` Aditya Mahajan
  0 siblings, 0 replies; 7+ messages in thread
From: Aditya Mahajan @ 2020-09-22 20:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

[-- Attachment #2: Type: text/plain, Size: 493 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] 7+ messages in thread

* Re: More table questions
  2020-09-22 18:55 ` Aditya Mahajan
  2020-09-22 19:34   ` Peter Münster
@ 2020-09-22 20:18   ` Denis Maier
  1 sibling, 0 replies; 7+ messages in thread
From: Denis Maier @ 2020-09-22 20:18 UTC (permalink / raw)
  To: ntg-context

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

___________________________________________________________________________________
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] 7+ messages in thread

* Re: More table questions
  2020-09-22 14:31 ` Henning Hraban Ramm
@ 2020-09-22 20:26   ` Denis Maier
  0 siblings, 0 replies; 7+ messages in thread
From: Denis Maier @ 2020-09-22 20:26 UTC (permalink / raw)
  To: ntg-context

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

___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2020-09-22 20:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22  8:03 More table questions Denis Maier
2020-09-22 14:31 ` Henning Hraban Ramm
2020-09-22 20:26   ` Denis Maier
2020-09-22 18:55 ` Aditya Mahajan
2020-09-22 19:34   ` Peter Münster
2020-09-22 20:02     ` Aditya Mahajan
2020-09-22 20:18   ` Denis Maier

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