ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Feature Request: xtables extensions
@ 2017-03-08 15:29 Henri Menke
  2017-03-08 15:39 ` Henri Menke
  2017-03-08 16:44 ` Alan Braslau
  0 siblings, 2 replies; 6+ messages in thread
From: Henri Menke @ 2017-03-08 15:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear devs,

Natural Tables are quite handy but their syntax is a little verbose.

\bTABLE
  \bTR
    \bTD ... \eTD
  \eTR
\eTABLE

There exist nice extensions which make the format less verbose by mapping

\startTABLE
  \NC ... \NR\NR
\stopTABLE

back to the original macros.

The new method for tables, called xtables, is faster and seems to have less problems than Natural Tables.  However, the syntax is even more verbose

\startxtable
  \startxrow
    \startxcell ... \stopxcell
  \stopxrow
\stopxtable

Can we have similar abbreviations as for Natural Tables?  I am thinking of something like

\startXTABLE
  \NC ... \NR\NR
\stopXTABLE

I tried myself rewriting tabl-nte.mkiv for xtables but it is not straightforward.

What do you think of this proposal?

Kind regards,
Henri
___________________________________________________________________________________
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] 6+ messages in thread

* Re: Feature Request: xtables extensions
  2017-03-08 15:29 Feature Request: xtables extensions Henri Menke
@ 2017-03-08 15:39 ` Henri Menke
  2017-03-08 15:49   ` Henri Menke
  2017-03-08 16:44 ` Alan Braslau
  1 sibling, 1 reply; 6+ messages in thread
From: Henri Menke @ 2017-03-08 15:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I quickly came up with something myself.  Unfortunately, it involves overloading of the original xtables.  Perhaps there is a better way but it works.  I am happy to hear your opinions!

\unprotect

% Overload tabl_x_start_table
\unexpanded\def\tabl_x_start_table[#settings]% maybe two arguments: [tag][settings] | [tag] | [settings]
  {\bgroup
   \let\NC\tabl_xte_start_nc
   \let\NR\tabl_xte_start_nr
   \tabl_x_prepare{#settings}%
   \edef\tabl_x_current_buffer{\tabl_x_default_buffer}%
   \buff_pickup{\tabl_x_current_buffer}{startxtable}{stopxtable}\relax\tabl_x_process\zerocount}

% xtable extensions
\newconditional\c_tabl_xte_in_nc

\unexpanded\def\tabl_xte_start_nr
  {\stopxrow
   \setfalse\c_tabl_xte_in_nc}

\unexpanded\def\tabl_xte_start_nc
  {\futurelet\next\tabl_xte_start_nc_indeed}

\def\tabl_xte_start_nc_indeed
  {\ifx\next\tabl_xte_start_nr \else
     \expandafter\tabl_xte_start_nc_finish
   \fi}

\def\tabl_xte_start_nc_finish#1\NC
  {\ifconditional\c_tabl_xte_in_nc \else
     \settrue\c_tabl_xte_in_nc
     \startxrow[]%
   \fi
   \startxcell#1\stopxcell\NC}

\protect

\starttext

\startxtable[align={lohi,middle}]
  \NC OSI-Schicht            \NC[nx=6] Umsetzung \NC\NR
  \NC Anwendungsschicht      \NC[nx=2,ny=3] SOME/I \NC[nx=2,ny=3] AVB/TSN \NC[nx=2,ny=3] DoIP \NC\NR
  \NC Darstellungsschicht    \NC\NR
  \NC Sitzungsschicht        \NC\NR
  \NC Transportschicht       \NC[nx=3] TCP \NC[nx=3] UDP \NC\NR   
  \NC Vermittlungsschicht    \NC[nx=3] IPv4 \NC[nx=3] IPv6 \NC\NR
  \NC Sicherungsschicht      \NC[nx=6] Ethernet \NC\NR
  \NC Bitübertragungsschicht \NC[nx=2] 100BASE-TX \NC[nx=2] 100BASE-T \NC[nx=2] 1000BASE-T \NC\NR
\stopxtable

\stoptext

On 03/08/2017 04:29 PM, Henri Menke wrote:
> Dear devs,
> 
> Natural Tables are quite handy but their syntax is a little verbose.
> 
> \bTABLE
>   \bTR
>     \bTD ... \eTD
>   \eTR
> \eTABLE
> 
> There exist nice extensions which make the format less verbose by mapping
> 
> \startTABLE
>   \NC ... \NR\NR
> \stopTABLE
> 
> back to the original macros.
> 
> The new method for tables, called xtables, is faster and seems to have less problems than Natural Tables.  However, the syntax is even more verbose
> 
> \startxtable
>   \startxrow
>     \startxcell ... \stopxcell
>   \stopxrow
> \stopxtable
> 
> Can we have similar abbreviations as for Natural Tables?  I am thinking of something like
> 
> \startXTABLE
>   \NC ... \NR\NR
> \stopXTABLE
> 
> I tried myself rewriting tabl-nte.mkiv for xtables but it is not straightforward.
> 
> What do you think of this proposal?
> 
> Kind regards,
> Henri
> 

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

* Re: Feature Request: xtables extensions
  2017-03-08 15:39 ` Henri Menke
@ 2017-03-08 15:49   ` Henri Menke
  2017-03-08 16:10     ` Henri Menke
  0 siblings, 1 reply; 6+ messages in thread
From: Henri Menke @ 2017-03-08 15:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Alternatively to my first proposal but still overloading the original xtables I came up with another solution which does not have the \NC\NR but only \NR and does not read the cell content as an argument.

\unprotect

% Overload tabl_x_start_table
\unexpanded\def\tabl_x_start_table[#settings]% maybe two arguments: [tag][settings] | [tag] | [settings]
  {\bgroup
   \let\NC\tabl_xte_start_nc
   \let\NR\tabl_xte_start_nr
   \settrue\c_tabl_xte_first_nc
   \tabl_x_prepare{#settings}%
   \edef\tabl_x_current_buffer{\tabl_x_default_buffer}%
   \buff_pickup{\tabl_x_current_buffer}{startxtable}{stopxtable}\relax\tabl_x_process\zerocount}

% xtable extensions
\newconditional\c_tabl_xte_first_nc

\unexpanded\def\tabl_xte_start_nr
  {\stopxcell\stopxrow
   \settrue\c_tabl_xte_first_nc}

\unexpanded\def\tabl_xte_start_nc
  {\ifconditional\c_tabl_xte_first_nc
     \setfalse\c_tabl_xte_first_nc
     \expandafter\startxrow\expandafter\startxcell
   \else
     \expandafter\stopxcell\expandafter\startxcell
   \fi}

\protect

\starttext

\startxtable[align={lohi,middle}]
  \NC OSI-Schicht            \NC[nx=6] Umsetzung \NR
  \NC Anwendungsschicht      \NC[nx=2,ny=3] SOME/I \NC[nx=2,ny=3] AVB/TSN \NC[nx=2,ny=3] DoIP \NR
  \NC Darstellungsschicht    \NR
  \NC Sitzungsschicht        \NR
  \NC Transportschicht       \NC[nx=3] TCP \NC[nx=3] UDP \NR   
  \NC Vermittlungsschicht    \NC[nx=3] IPv4 \NC[nx=3] IPv6 \NR
  \NC Sicherungsschicht      \NC[nx=6] Ethernet \NR
  \NC Bitübertragungsschicht \NC[nx=2] 100BASE-TX \NC[nx=2] 100BASE-T \NC[nx=2] 1000BASE-T \NR
\stopxtable

\stoptext

On 03/08/2017 04:39 PM, Henri Menke wrote:
> I quickly came up with something myself.  Unfortunately, it involves overloading of the original xtables.  Perhaps there is a better way but it works.  I am happy to hear your opinions!
> 
> \unprotect
> 
> % Overload tabl_x_start_table
> \unexpanded\def\tabl_x_start_table[#settings]% maybe two arguments: [tag][settings] | [tag] | [settings]
>   {\bgroup
>    \let\NC\tabl_xte_start_nc
>    \let\NR\tabl_xte_start_nr
>    \tabl_x_prepare{#settings}%
>    \edef\tabl_x_current_buffer{\tabl_x_default_buffer}%
>    \buff_pickup{\tabl_x_current_buffer}{startxtable}{stopxtable}\relax\tabl_x_process\zerocount}
> 
> % xtable extensions
> \newconditional\c_tabl_xte_in_nc
> 
> \unexpanded\def\tabl_xte_start_nr
>   {\stopxrow
>    \setfalse\c_tabl_xte_in_nc}
> 
> \unexpanded\def\tabl_xte_start_nc
>   {\futurelet\next\tabl_xte_start_nc_indeed}
> 
> \def\tabl_xte_start_nc_indeed
>   {\ifx\next\tabl_xte_start_nr \else
>      \expandafter\tabl_xte_start_nc_finish
>    \fi}
> 
> \def\tabl_xte_start_nc_finish#1\NC
>   {\ifconditional\c_tabl_xte_in_nc \else
>      \settrue\c_tabl_xte_in_nc
>      \startxrow[]%
>    \fi
>    \startxcell#1\stopxcell\NC}
> 
> \protect
> 
> \starttext
> 
> \startxtable[align={lohi,middle}]
>   \NC OSI-Schicht            \NC[nx=6] Umsetzung \NC\NR
>   \NC Anwendungsschicht      \NC[nx=2,ny=3] SOME/I \NC[nx=2,ny=3] AVB/TSN \NC[nx=2,ny=3] DoIP \NC\NR
>   \NC Darstellungsschicht    \NC\NR
>   \NC Sitzungsschicht        \NC\NR
>   \NC Transportschicht       \NC[nx=3] TCP \NC[nx=3] UDP \NC\NR   
>   \NC Vermittlungsschicht    \NC[nx=3] IPv4 \NC[nx=3] IPv6 \NC\NR
>   \NC Sicherungsschicht      \NC[nx=6] Ethernet \NC\NR
>   \NC Bitübertragungsschicht \NC[nx=2] 100BASE-TX \NC[nx=2] 100BASE-T \NC[nx=2] 1000BASE-T \NC\NR
> \stopxtable
> 
> \stoptext
> 
> On 03/08/2017 04:29 PM, Henri Menke wrote:
>> Dear devs,
>>
>> Natural Tables are quite handy but their syntax is a little verbose.
>>
>> \bTABLE
>>   \bTR
>>     \bTD ... \eTD
>>   \eTR
>> \eTABLE
>>
>> There exist nice extensions which make the format less verbose by mapping
>>
>> \startTABLE
>>   \NC ... \NR\NR
>> \stopTABLE
>>
>> back to the original macros.
>>
>> The new method for tables, called xtables, is faster and seems to have less problems than Natural Tables.  However, the syntax is even more verbose
>>
>> \startxtable
>>   \startxrow
>>     \startxcell ... \stopxcell
>>   \stopxrow
>> \stopxtable
>>
>> Can we have similar abbreviations as for Natural Tables?  I am thinking of something like
>>
>> \startXTABLE
>>   \NC ... \NR\NR
>> \stopXTABLE
>>
>> I tried myself rewriting tabl-nte.mkiv for xtables but it is not straightforward.
>>
>> What do you think of this proposal?
>>
>> Kind regards,
>> Henri
>>
> 

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

* Re: Feature Request: xtables extensions
  2017-03-08 15:49   ` Henri Menke
@ 2017-03-08 16:10     ` Henri Menke
  0 siblings, 0 replies; 6+ messages in thread
From: Henri Menke @ 2017-03-08 16:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I refined the proposal a little further to not having to overload xtables but only use one remaining internal macro of xtables.  I also sent this version to Hans to be considered going to the ConTeXt core.

\unprotect

%D xtable extensions

\definextable[XTABLE]

\unexpanded\def\startXTABLE
  {\bgroup
   \let\NC\tabl_xte_start_nc
   \let\NR\tabl_xte_start_nr
   \settrue\c_tabl_xte_first_nc
   \tabl_x_start_named{XTABLE}}

\newconditional\c_tabl_xte_first_nc

\unexpanded\def\tabl_xte_start_nr
  {\stopxcell\stopxrow
   \settrue\c_tabl_xte_first_nc}

\unexpanded\def\tabl_xte_start_nc
  {\ifconditional\c_tabl_xte_first_nc
     \setfalse\c_tabl_xte_first_nc
     \expandafter\startxrow\expandafter\startxcell
   \else
     \expandafter\stopxcell\expandafter\startxcell
   \fi}

%D The related structure commands are also available:

\let\startXTABLEhead\startxtablehead
\let\startXTABLEfoot\startxtablefoot
\let\startXTABLEnext\startxtablenext
\let\startXTABLEbody\startxtablebody
\let\stopXTABLEhead\stopxtablehead
\let\stopXTABLEfoot\stopxtablefoot
\let\stopXTABLEnext\stopxtablenext
\let\stopXTABLEbody\stopxtablebody

\protect

\starttext

\startXTABLE[align={lohi,middle}]
  \startXTABLEhead
    \NC OSI-Schicht            \NC[nx=6] Umsetzung \NR
  \stopXTABLEhead
  \startXTABLEbody
    \NC Anwendungsschicht      \NC[nx=2,ny=3] SOME/I \NC[nx=2,ny=3] AVB/TSN \NC[nx=2,ny=3] DoIP \NR
    \NC Darstellungsschicht    \NR
    \NC Sitzungsschicht        \NR
    \NC Transportschicht       \NC[nx=3] TCP \NC[nx=3] UDP \NR   
    \NC Vermittlungsschicht    \NC[nx=3] IPv4 \NC[nx=3] IPv6 \NR
    \NC Sicherungsschicht      \NC[nx=6] Ethernet \NR
  \stopXTABLEbody
  \startXTABLEfoot
    \NC Bitübertragungsschicht \NC[nx=2] 100BASE-TX \NC[nx=2] 100BASE-T \NC[nx=2] 1000BASE-T \NR
  \stopXTABLEfoot
\stopXTABLE

\stoptext


On 03/08/2017 04:49 PM, Henri Menke wrote:
> Alternatively to my first proposal but still overloading the original xtables I came up with another solution which does not have the \NC\NR but only \NR and does not read the cell content as an argument.
> 
> \unprotect
> 
> % Overload tabl_x_start_table
> \unexpanded\def\tabl_x_start_table[#settings]% maybe two arguments: [tag][settings] | [tag] | [settings]
>   {\bgroup
>    \let\NC\tabl_xte_start_nc
>    \let\NR\tabl_xte_start_nr
>    \settrue\c_tabl_xte_first_nc
>    \tabl_x_prepare{#settings}%
>    \edef\tabl_x_current_buffer{\tabl_x_default_buffer}%
>    \buff_pickup{\tabl_x_current_buffer}{startxtable}{stopxtable}\relax\tabl_x_process\zerocount}
> 
> % xtable extensions
> \newconditional\c_tabl_xte_first_nc
> 
> \unexpanded\def\tabl_xte_start_nr
>   {\stopxcell\stopxrow
>    \settrue\c_tabl_xte_first_nc}
> 
> \unexpanded\def\tabl_xte_start_nc
>   {\ifconditional\c_tabl_xte_first_nc
>      \setfalse\c_tabl_xte_first_nc
>      \expandafter\startxrow\expandafter\startxcell
>    \else
>      \expandafter\stopxcell\expandafter\startxcell
>    \fi}
> 
> \protect
> 
> \starttext
> 
> \startxtable[align={lohi,middle}]
>   \NC OSI-Schicht            \NC[nx=6] Umsetzung \NR
>   \NC Anwendungsschicht      \NC[nx=2,ny=3] SOME/I \NC[nx=2,ny=3] AVB/TSN \NC[nx=2,ny=3] DoIP \NR
>   \NC Darstellungsschicht    \NR
>   \NC Sitzungsschicht        \NR
>   \NC Transportschicht       \NC[nx=3] TCP \NC[nx=3] UDP \NR   
>   \NC Vermittlungsschicht    \NC[nx=3] IPv4 \NC[nx=3] IPv6 \NR
>   \NC Sicherungsschicht      \NC[nx=6] Ethernet \NR
>   \NC Bitübertragungsschicht \NC[nx=2] 100BASE-TX \NC[nx=2] 100BASE-T \NC[nx=2] 1000BASE-T \NR
> \stopxtable
> 
> \stoptext
> 
> On 03/08/2017 04:39 PM, Henri Menke wrote:
>> I quickly came up with something myself.  Unfortunately, it involves overloading of the original xtables.  Perhaps there is a better way but it works.  I am happy to hear your opinions!
>>
>> \unprotect
>>
>> % Overload tabl_x_start_table
>> \unexpanded\def\tabl_x_start_table[#settings]% maybe two arguments: [tag][settings] | [tag] | [settings]
>>   {\bgroup
>>    \let\NC\tabl_xte_start_nc
>>    \let\NR\tabl_xte_start_nr
>>    \tabl_x_prepare{#settings}%
>>    \edef\tabl_x_current_buffer{\tabl_x_default_buffer}%
>>    \buff_pickup{\tabl_x_current_buffer}{startxtable}{stopxtable}\relax\tabl_x_process\zerocount}
>>
>> % xtable extensions
>> \newconditional\c_tabl_xte_in_nc
>>
>> \unexpanded\def\tabl_xte_start_nr
>>   {\stopxrow
>>    \setfalse\c_tabl_xte_in_nc}
>>
>> \unexpanded\def\tabl_xte_start_nc
>>   {\futurelet\next\tabl_xte_start_nc_indeed}
>>
>> \def\tabl_xte_start_nc_indeed
>>   {\ifx\next\tabl_xte_start_nr \else
>>      \expandafter\tabl_xte_start_nc_finish
>>    \fi}
>>
>> \def\tabl_xte_start_nc_finish#1\NC
>>   {\ifconditional\c_tabl_xte_in_nc \else
>>      \settrue\c_tabl_xte_in_nc
>>      \startxrow[]%
>>    \fi
>>    \startxcell#1\stopxcell\NC}
>>
>> \protect
>>
>> \starttext
>>
>> \startxtable[align={lohi,middle}]
>>   \NC OSI-Schicht            \NC[nx=6] Umsetzung \NC\NR
>>   \NC Anwendungsschicht      \NC[nx=2,ny=3] SOME/I \NC[nx=2,ny=3] AVB/TSN \NC[nx=2,ny=3] DoIP \NC\NR
>>   \NC Darstellungsschicht    \NC\NR
>>   \NC Sitzungsschicht        \NC\NR
>>   \NC Transportschicht       \NC[nx=3] TCP \NC[nx=3] UDP \NC\NR   
>>   \NC Vermittlungsschicht    \NC[nx=3] IPv4 \NC[nx=3] IPv6 \NC\NR
>>   \NC Sicherungsschicht      \NC[nx=6] Ethernet \NC\NR
>>   \NC Bitübertragungsschicht \NC[nx=2] 100BASE-TX \NC[nx=2] 100BASE-T \NC[nx=2] 1000BASE-T \NC\NR
>> \stopxtable
>>
>> \stoptext
>>
>> On 03/08/2017 04:29 PM, Henri Menke wrote:
>>> Dear devs,
>>>
>>> Natural Tables are quite handy but their syntax is a little verbose.
>>>
>>> \bTABLE
>>>   \bTR
>>>     \bTD ... \eTD
>>>   \eTR
>>> \eTABLE
>>>
>>> There exist nice extensions which make the format less verbose by mapping
>>>
>>> \startTABLE
>>>   \NC ... \NR\NR
>>> \stopTABLE
>>>
>>> back to the original macros.
>>>
>>> The new method for tables, called xtables, is faster and seems to have less problems than Natural Tables.  However, the syntax is even more verbose
>>>
>>> \startxtable
>>>   \startxrow
>>>     \startxcell ... \stopxcell
>>>   \stopxrow
>>> \stopxtable
>>>
>>> Can we have similar abbreviations as for Natural Tables?  I am thinking of something like
>>>
>>> \startXTABLE
>>>   \NC ... \NR\NR
>>> \stopXTABLE
>>>
>>> I tried myself rewriting tabl-nte.mkiv for xtables but it is not straightforward.
>>>
>>> What do you think of this proposal?
>>>
>>> Kind regards,
>>> Henri
>>>
>>
> 

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

* Re: Feature Request: xtables extensions
  2017-03-08 15:29 Feature Request: xtables extensions Henri Menke
  2017-03-08 15:39 ` Henri Menke
@ 2017-03-08 16:44 ` Alan Braslau
  2017-03-08 17:29   ` Aditya Mahajan
  1 sibling, 1 reply; 6+ messages in thread
From: Alan Braslau @ 2017-03-08 16:44 UTC (permalink / raw)
  To: Henri Menke; +Cc: mailing list for ConTeXt users

On Wed, 8 Mar 2017 16:29:52 +0100
Henri Menke <henrimenke@gmail.com> wrote:

> Natural Tables are quite handy but their syntax is a little verbose.
> 
> \bTABLE
>   \bTR
>     \bTD ... \eTD
>   \eTR
> \eTABLE
> 
> There exist nice extensions which make the format less verbose by
> mapping
> 
> \startTABLE
>   \NC ... \NR\NR
> \stopTABLE
> 
> back to the original macros.
> 
> The new method for tables, called xtables, is faster and seems to
> have less problems than Natural Tables.  However, the syntax is even
> more verbose
> 
> \startxtable
>   \startxrow
>     \startxcell ... \stopxcell
>   \stopxrow
> \stopxtable
> 
> Can we have similar abbreviations as for Natural Tables?


Beauty is in the eyes of the beholder, but I have always found the
syntax of the older table macros to be quite unreadable, somewhat a
left-over from laTeX-like syntax.

The xtables syntax is verbose, indeed, but much more readable and much
better in line with other ConTeXt syntax.

(Hans, my only complaint about xtables is that they apparently cannot be
used nested in a title={} of \startplacefigure.)

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

* Re: Feature Request: xtables extensions
  2017-03-08 16:44 ` Alan Braslau
@ 2017-03-08 17:29   ` Aditya Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2017-03-08 17:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 8 Mar 2017, Alan Braslau wrote:

> On Wed, 8 Mar 2017 16:29:52 +0100
> Henri Menke <henrimenke@gmail.com> wrote:
>
>> Natural Tables are quite handy but their syntax is a little verbose.
>> 
>> \bTABLE
>>   \bTR
>>     \bTD ... \eTD
>>   \eTR
>> \eTABLE
>> 
>> There exist nice extensions which make the format less verbose by
>> mapping
>> 
>> \startTABLE
>>   \NC ... \NR\NR
>> \stopTABLE
>> 
>> back to the original macros.
>> 
>> The new method for tables, called xtables, is faster and seems to
>> have less problems than Natural Tables.  However, the syntax is even
>> more verbose
>> 
>> \startxtable
>>   \startxrow
>>     \startxcell ... \stopxcell
>>   \stopxrow
>> \stopxtable
>> 
>> Can we have similar abbreviations as for Natural Tables?
>
> Beauty is in the eyes of the beholder, but I have always found the
> syntax of the older table macros to be quite unreadable, somewhat a
> left-over from laTeX-like syntax.
>
> The xtables syntax is verbose, indeed, but much more readable and much
> better in line with other ConTeXt syntax.

It depends. For numerical tables, the old syntax is easier to read.

\startTABLE
   \NC Parameter \NC value 1 \NC value 2 \NC value 3 \NC \NR
   \NC 1.0       \NC 3.4     \NC 3.6     \NC 4.2     \NC \NR
   \NC 1.0       \NC 3.4     \NC 3.6     \NC 4.2     \NC \NR
   \NC 1.0       \NC 3.4     \NC 3.6     \NC 4.2     \NC \NR
\stopTABLE

For textual tables, or for generating tables programmatically using CLD, 
the start-stop syntax is more convenient.

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

end of thread, other threads:[~2017-03-08 17:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08 15:29 Feature Request: xtables extensions Henri Menke
2017-03-08 15:39 ` Henri Menke
2017-03-08 15:49   ` Henri Menke
2017-03-08 16:10     ` Henri Menke
2017-03-08 16:44 ` Alan Braslau
2017-03-08 17:29   ` 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).