\starttable questions
Hi, I was wondering if anyone here could help me with these three things: For a long time I have been using Wichura's TaBle macros (i.e., what one gets with \input table in plain TeX) and would like to use what appears to be ConTeXt's version of those (i.e., what one gets with \starttable ... \stoptable). However, https://wiki.contextgarden.net/Command/starttable says The environment \starttable ... \stoptable is and (sic) old and nearly obsolete way to handle tabular material Q1: are there plans to remove \starttable ... \endtable from ConTeXt any time "soon", or is that wiki comment gratuitously pessimistic? In a recent answer on this list, Mikael helped someone by pointing out the \HF[...] command. The \HF command is not listed in the \starttable wiki page. Q2: Is \HF[] documented anywhere? If so, can someone point me to that/those document(s)? Perhaps an answer to Q2 will answer this one too, but in case it doesn't... When using Wichura's \BeginTable ... \EndTable macros, I occasionally use the \\+nm feature to add n points above the current line and/or m points below the current line. Q3: Does ConTexT's \starttable ... \endtable have this feature? If so, how does one access this feature? Thanks. Jim
Am 25.01.24 um 16:12 schrieb Jim:
Hi, I was wondering if anyone here could help me with these three things:
For a long time I have been using Wichura's TaBle macros (i.e., what one gets with \input table in plain TeX) and would like to use what appears to be ConTeXt's version of those (i.e., what one gets with \starttable ... \stoptable).
However, https://wiki.contextgarden.net/Command/starttable says The environment \starttable ... \stoptable is and (sic) old and nearly obsolete way to handle tabular material
Q1: are there plans to remove \starttable ... \endtable from ConTeXt any time "soon", or is that wiki comment gratuitously pessimistic?
Hans suggests to use tabulate as long as it fits. tabulate uses mostly the same syntax as table(s), but as far as I looked into the sources, it’s a different (and probably better) implementation. I’m quite sure \starttable will stay, it’s just discouraged since \startTABLE (natural tables) is better if you need more than \starttabulate.
In a recent answer on this list, Mikael helped someone by pointing out the \HF[...] command. The \HF command is not listed in the \starttable wiki page.
Q2: Is \HF[] documented anywhere? If so, can someone point me to that/those document(s)?
I also don’t know anything about \HF and didn’t find it in the source. Are you sure it wasn’t just used in a math context?
Perhaps an answer to Q2 will answer this one too, but in case it doesn't...
When using Wichura's \BeginTable ... \EndTable macros, I occasionally use the \\+nm feature to add n points above the current line and/or m points below the current line.
Q3: Does ConTexT's \starttable ... \endtable have this feature? If so, how does one access this feature?
Probably not, you don’t use \\ in a ConTeXt table. There’s \TB[] that understands the same parameters as \blank Hraban
Hi Henning, On Thu, Jan 25, 2024 at 17:16 (+0100), Henning Hraban Ramm wrote:
Am 25.01.24 um 16:12 schrieb Jim:
Hi, I was wondering if anyone here could help me with these three things:
For a long time I have been using Wichura's TaBle macros (i.e., what one gets with \input table in plain TeX) and would like to use what appears to be ConTeXt's version of those (i.e., what one gets with \starttable ... \stoptable).
However, https://wiki.contextgarden.net/Command/starttable says The environment \starttable ... \stoptable is and (sic) old and nearly obsolete way to handle tabular material
Q1: are there plans to remove \starttable ... \endtable from ConTeXt any time "soon", or is that wiki comment gratuitously pessimistic?
Hans suggests to use tabulate as long as it fits.
I just gave that a try, using the same syntax as \starttable: \starttable[|c|c|] \HL \VL \bf Year \VL \bf Citizens \VL\SR \HL \VL 1675 \VL ˜428 \VL\FR \VL 1795 \VL 1124 \VL\MR \VL 1880 \VL 2405 \VL\MR \VL 1995 \VL 7408 \VL\LR \HL \stoptable \starttabulate[|c|c|] \HL \VL \bf Year \VL \bf Citizens \VL\SR \HL \VL 1675 \VL ˜428 \VL\FR \VL 1795 \VL 1124 \VL\MR \VL 1880 \VL 2405 \VL\MR \VL 1995 \VL 7408 \VL\LR \HL \stoptabulate While tabulate produced a table with the above input, it needs some work to make the table look good. (The columns are too narrow, the vrules don't meet the hrules, ...). Perhaps these can be fixed with some tweaking, but I notice that in all of https://wiki.contextgarden.net/Command/starttabulate and https://wiki.contextgarden.net/Tabulate and http://www.ntg.nl/maps/22/28.pdf there is a conspicuous lack of examples with vrules. And the tables in the (at least) the starttabulate wiki page which use vrules don't use tabulate to create the tables. Coincidence? I think not. :-)
tabulate uses mostly the same syntax as table(s), but as far as I looked into the sources, it’s a different (and probably better) implementation.
I’m quite sure \starttable will stay, it’s just discouraged since \startTABLE (natural tables) is better if you need more than \starttabulate.
I looked at that and played with it (briefly), but when I saw there was something to make tables (i.e., \starttable) which used a syntax close to what I already know, I thought I'd go with what I know. At this point my ConTeXt learning curve is pretty steep already, but perhaps at some point in the future I'll be able to heed your advice.
In a recent answer on this list, Mikael helped someone by pointing out the \HF[...] command. The \HF command is not listed in the \starttable wiki page.
Q2: Is \HF[] documented anywhere? If so, can someone point me to that/those document(s)?
I also don’t know anything about \HF and didn’t find it in the source. Are you sure it wasn’t just used in a math context?
It was indeed used in a math context. Unfortunately, that knowledge doesn't bring me any closer to finding the documentation. (Which gets me back to my learning curve. :-)
Perhaps an answer to Q2 will answer this one too, but in case it doesn't...
When using Wichura's \BeginTable ... \EndTable macros, I occasionally use the \\+nm feature to add n points above the current line and/or m points below the current line.
Q3: Does ConTexT's \starttable ... \endtable have this feature? If so, how does one access this feature?
Probably not, you don’t use \\ in a ConTeXt table.
That I already knew.
There’s \TB[] that understands the same parameters as \blank
Thanks for that information. Unfortunately, it doesn't work well for tables with vrules, in either \starttabulate or \starttable. However, thanks for mentioning it, not all tables have vrules. Cheers. Jim
Jim schrieb am 25.01.2024 um 22:01:
Hi Henning,
On Thu, Jan 25, 2024 at 17:16 (+0100), Henning Hraban Ramm wrote:
Am 25.01.24 um 16:12 schrieb Jim:
Hi, I was wondering if anyone here could help me with these three things: For a long time I have been using Wichura's TaBle macros (i.e., what one gets with \input table in plain TeX) and would like to use what appears to be ConTeXt's version of those (i.e., what one gets with \starttable ... \stoptable).
However, https://wiki.contextgarden.net/Command/starttable says The environment \starttable ... \stoptable is and (sic) old and nearly obsolete way to handle tabular material Q1: are there plans to remove \starttable ... \endtable from ConTeXt any time "soon", or is that wiki comment gratuitously pessimistic?
Hans suggests to use tabulate as long as it fits. I just gave that a try, using the same syntax as \starttable:
\starttable[|c|c|] \HL \VL \bf Year \VL \bf Citizens \VL\SR \HL \VL 1675 \VL ˜428 \VL\FR \VL 1795 \VL 1124 \VL\MR \VL 1880 \VL 2405 \VL\MR \VL 1995 \VL 7408 \VL\LR \HL \stoptable
\starttabulate[|c|c|] \HL \VL \bf Year \VL \bf Citizens \VL\SR \HL \VL 1675 \VL ˜428 \VL\FR \VL 1795 \VL 1124 \VL\MR \VL 1880 \VL 2405 \VL\MR \VL 1995 \VL 7408 \VL\LR \HL \stoptabulate
While tabulate produced a table with the above input, it needs some work to make the table look good. (The columns are too narrow, the vrules don't meet the hrules, ...).
Perhaps these can be fixed with some tweaking, but I notice that in all of https://wiki.contextgarden.net/Command/starttabulate and https://wiki.contextgarden.net/Tabulate and http://www.ntg.nl/maps/22/28.pdf there is a conspicuous lack of examples with vrules. And the tables in the (at least) the starttabulate wiki page which use vrules don't use tabulate to create the tables.
Coincidence? I think not. :-)
Table which rely on rules to make the content readable have a serious problem (read Edward Tufte books how you can improve the visual style) but the better alternative in this case are either natural tables or extreme tables. Below is a example which uses the table like wrapper for natural tables which makes adding rules and changing the padding around text very simple because each table cell is a \framed block with all its options. \starttext \startsetups[ruledtable] \setupTABLE [frame=off,align=middle,loffset=.5em,roffset=.5em] \setupTABLE [column] [each] [leftframe=on,rightframe=on] \setupTABLE [row] [first] [topframe=on,bottomframe=on,foregroundstyle=bold] \setupTABLE [row] [last] [bottomframe=on] \stopsetups \startTABLE[setups=ruledtable] \NC Year \NC Citizens \NC\NR \NC 1675 \NC ˜428 \NC\NR \NC 1795 \NC 1124 \NC\NR \NC 1880 \NC 2405 \NC\NR \NC 1995 \NC 7408 \NC\NR \stopTABLE \stoptext Wolfgang
On Thu, Jan 25, 2024 at 22:22 (+0100), Wolfgang Schuster wrote:
Jim schrieb am 25.01.2024 um 22:01:
Hi Henning,
On Thu, Jan 25, 2024 at 17:16 (+0100), Henning Hraban Ramm wrote:
Am 25.01.24 um 16:12 schrieb Jim:
Hi, I was wondering if anyone here could help me with these three things: For a long time I have been using Wichura's TaBle macros (i.e., what one gets with \input table in plain TeX) and would like to use what appears to be ConTeXt's version of those (i.e., what one gets with \starttable ... \stoptable).
However, https://wiki.contextgarden.net/Command/starttable says The environment \starttable ... \stoptable is and (sic) old and nearly obsolete way to handle tabular material Q1: are there plans to remove \starttable ... \endtable from ConTeXt any time "soon", or is that wiki comment gratuitously pessimistic?
Hans suggests to use tabulate as long as it fits. I just gave that a try, using the same syntax as \starttable:
\starttable[|c|c|] \HL \VL \bf Year \VL \bf Citizens \VL\SR \HL \VL 1675 \VL ˜428 \VL\FR \VL 1795 \VL 1124 \VL\MR \VL 1880 \VL 2405 \VL\MR \VL 1995 \VL 7408 \VL\LR \HL \stoptable
\starttabulate[|c|c|] \HL \VL \bf Year \VL \bf Citizens \VL\SR \HL \VL 1675 \VL ˜428 \VL\FR \VL 1795 \VL 1124 \VL\MR \VL 1880 \VL 2405 \VL\MR \VL 1995 \VL 7408 \VL\LR \HL \stoptabulate
While tabulate produced a table with the above input, it needs some work to make the table look good. (The columns are too narrow, the vrules don't meet the hrules, ...).
Perhaps these can be fixed with some tweaking, but I notice that in all of https://wiki.contextgarden.net/Command/starttabulate and https://wiki.contextgarden.net/Tabulate and http://www.ntg.nl/maps/22/28.pdf there is a conspicuous lack of examples with vrules. And the tables in the (at least) the starttabulate wiki page which use vrules don't use tabulate to create the tables.
Coincidence? I think not. :-)
Table which rely on rules to make the content readable have a serious problem (read Edward Tufte books how you can improve the visual style) but the better alternative in this case are either natural tables or extreme tables.
Below is a example which uses the table like wrapper for natural tables which makes adding rules and changing the padding around text very simple because each table cell is a \framed block with all its options.
\starttext
\startsetups[ruledtable] \setupTABLE [frame=off,align=middle,loffset=.5em,roffset=.5em] \setupTABLE [column] [each] [leftframe=on,rightframe=on] \setupTABLE [row] [first] [topframe=on,bottomframe=on,foregroundstyle=bold] \setupTABLE [row] [last] [bottomframe=on] \stopsetups
\startTABLE[setups=ruledtable] \NC Year \NC Citizens \NC\NR \NC 1675 \NC ˜428 \NC\NR \NC 1795 \NC 1124 \NC\NR \NC 1880 \NC 2405 \NC\NR \NC 1995 \NC 7408 \NC\NR \stopTABLE
\stoptext
Wolfgang, thanks for the response and the sample code. [ Note to anyone else trying out this example: there are non-breakable spaces above, and depending on your system if you copy and paste them into a file, they will cause this code to fail. ] I won't argue with you about readability of tables, but if I am typesetting something for someone and they want it a certain way, I don't want to get into an argument about it with them either. :-) The nice thing about your setup above is that it is nice and structured. But if a table calls for some row, column or cell to be treated differently, I guess I am in for some more reading. Cheers. Jim
On 26/01/2024 01:52, Jim wrote:
I won't argue with you about readability of tables, but if I am typesetting something for someone and they want it a certain way, I don't want to get into an argument about it with them either. :-)
It all depends on the level of ignorance of your client. e.g. there is a difference between not doing something because you are unable to do it, or that you don't want to do it (for a reason). In both cases nothing happens, but there is still a difference in the outcome. .F
On Thu, 25 Jan 2024, Jim wrote:
The nice thing about your setup above is that it is nice and structured. But if a table calls for some row, column or cell to be treated differently, I guess I am in for some more reading.
You can do: \setupTABLE[2][3] to select the formatting for row 3 and column 2 (or the other way around ... always forget). In the worst case, you can always do ... \NC .. \NC[options] ... \NC \NR .... Each cell is just a \framed[...]; so all options for \framed[...] work for Natural Tables. Aditya
On Fri, Jan 26, 2024 at 09:55 (+0100), Aditya Mahajan wrote:
On Thu, 25 Jan 2024, Jim wrote:
The nice thing about your setup above is that it is nice and structured. But if a table calls for some row, column or cell to be treated differently, I guess I am in for some more reading.
You can do: \setupTABLE[2][3] to select the formatting for row 3 and column 2 (or the other way around ... always forget). In the worst case, you can always do
... \NC .. \NC[options] ... \NC \NR ....
Each cell is just a \framed[...]; so all options for \framed[...] work for Natural Tables.
Aditya thanks very much for that information. I still appreciate the conciseness of the TaBlE macros (and thus \starttable ... \endtable), but I also appreciate the power of the TABLE macros. Jim
On Thu, 25 Jan 2024, Jim wrote:
In a recent answer on this list, Mikael helped someone by pointing out the \HF[...] command. The \HF command is not listed in the \starttable wiki page.
Q2: Is \HF[] documented anywhere? If so, can someone point me to that/those document(s)?
Perhaps an answer to Q2 will answer this one too, but in case it doesn't...
When using Wichura's \BeginTable ... \EndTable macros, I occasionally use the \\+nm feature to add n points above the current line and/or m points below the current line.
Q3: Does ConTexT's \starttable ... \endtable have this feature? If so, how does one access this feature?
I haven't looked at starttable in well over a decade, but I did document some of it: https://www.tug.org/TUGboat/Articles/tb28-3/tb90mahajan.pdf https://www.tug.org/TUGboat/Articles/tb29-1/tb91mahajan.pdf Aditya
On Thu, Jan 25, 2024 at 17:30 (+0100), Aditya Mahajan wrote:
On Thu, 25 Jan 2024, Jim wrote:
In a recent answer on this list, Mikael helped someone by pointing out the \HF[...] command. The \HF command is not listed in the \starttable wiki page.
Q2: Is \HF[] documented anywhere? If so, can someone point me to that/those document(s)?
Perhaps an answer to Q2 will answer this one too, but in case it doesn't...
When using Wichura's \BeginTable ... \EndTable macros, I occasionally use the \\+nm feature to add n points above the current line and/or m points below the current line.
Q3: Does ConTexT's \starttable ... \endtable have this feature? If so, how does one access this feature?
I haven't looked at starttable in well over a decade, but I did document some of it:
https://www.tug.org/TUGboat/Articles/tb28-3/tb90mahajan.pdf https://www.tug.org/TUGboat/Articles/tb29-1/tb91mahajan.pdf
Aditya, thanks for those links. Would you mind if I added them to the "See also" section of the \starttable wiki page (notwithstanding someone's claim at the top of the page saying they are obsolete)? Cheers. Jim
On Thu, 25 Jan 2024, Jim wrote:
On Thu, Jan 25, 2024 at 17:30 (+0100), Aditya Mahajan wrote:
I haven't looked at starttable in well over a decade, but I did document some of it:
https://www.tug.org/TUGboat/Articles/tb28-3/tb90mahajan.pdf https://www.tug.org/TUGboat/Articles/tb29-1/tb91mahajan.pdf
Aditya,
thanks for those links. Would you mind if I added them to the "See also" section of the \starttable wiki page (notwithstanding someone's claim at the top of the page saying they are obsolete)?
Of course that's okay. It's a wiki1 Aditya
participants (5)
-
Aditya Mahajan
-
Henning Hraban Ramm
-
Jim
-
vm
-
Wolfgang Schuster