ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* professional looking tables
@ 2016-12-18 18:19 Csikos Bela
  2016-12-18 21:01 ` Pablo Rodriguez
  2016-12-23  2:53 ` professional looking tables Aditya Mahajan
  0 siblings, 2 replies; 8+ messages in thread
From: Csikos Bela @ 2016-12-18 18:19 UTC (permalink / raw)
  To: ntg-context

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

* Re: professional looking tables
  2016-12-18 18:19 professional looking tables Csikos Bela
@ 2016-12-18 21:01 ` Pablo Rodriguez
  2016-12-22 15:02   ` Csikos Bela
  2016-12-23  2:53 ` professional looking tables Aditya Mahajan
  1 sibling, 1 reply; 8+ messages in thread
From: Pablo Rodriguez @ 2016-12-18 21:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

* Re: professional looking tables
  2016-12-18 21:01 ` Pablo Rodriguez
@ 2016-12-22 15:02   ` Csikos Bela
  2016-12-22 15:56     ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Csikos Bela @ 2016-12-22 15:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

[-- Attachment #2: xtables-example-01.pdf --]
[-- Type: application/pdf, Size: 8423 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] 8+ messages in thread

* Re: professional looking tables
  2016-12-22 15:02   ` Csikos Bela
@ 2016-12-22 15:56     ` Hans Hagen
  2016-12-22 19:26       ` Csikos Bela
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Hans Hagen @ 2016-12-22 15:56 UTC (permalink / raw)
  To: ntg-context

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

* Re: professional looking tables
  2016-12-22 15:56     ` Hans Hagen
@ 2016-12-22 19:26       ` Csikos Bela
  2016-12-23 12:36       ` Csikos Bela
  2016-12-30 15:28       ` xtables feature request, (professional looking tables) Csikos Bela
  2 siblings, 0 replies; 8+ messages in thread
From: Csikos Bela @ 2016-12-22 19:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

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

* Re: professional looking tables
  2016-12-18 18:19 professional looking tables Csikos Bela
  2016-12-18 21:01 ` Pablo Rodriguez
@ 2016-12-23  2:53 ` Aditya Mahajan
  1 sibling, 0 replies; 8+ messages in thread
From: Aditya Mahajan @ 2016-12-23  2:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

* Re: professional looking tables
  2016-12-22 15:56     ` Hans Hagen
  2016-12-22 19:26       ` Csikos Bela
@ 2016-12-23 12:36       ` Csikos Bela
  2016-12-30 15:28       ` xtables feature request, (professional looking tables) Csikos Bela
  2 siblings, 0 replies; 8+ messages in thread
From: Csikos Bela @ 2016-12-23 12:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

* Re: xtables feature request, (professional looking tables)
  2016-12-22 15:56     ` Hans Hagen
  2016-12-22 19:26       ` Csikos Bela
  2016-12-23 12:36       ` Csikos Bela
@ 2016-12-30 15:28       ` Csikos Bela
  2 siblings, 0 replies; 8+ messages in thread
From: Csikos Bela @ 2016-12-30 15:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

end of thread, other threads:[~2016-12-30 15:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-18 18:19 professional looking tables Csikos Bela
2016-12-18 21:01 ` Pablo Rodriguez
2016-12-22 15:02   ` Csikos Bela
2016-12-22 15:56     ` Hans Hagen
2016-12-22 19:26       ` Csikos Bela
2016-12-23 12:36       ` Csikos Bela
2016-12-30 15:28       ` xtables feature request, (professional looking tables) Csikos Bela
2016-12-23  2:53 ` professional looking tables Aditya Mahajan

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