Have a cell span multiple columns with tabulate
Hi, I'm using tabulate for parallel texts (source and translation next to each other). The top of each table should consist of only one cell covering both columns with centered content. Is that possible? A HTML equivalent will look roughly like this: <table> <tr> <th colspan="2">Manuscript XY </th> </tr> <tr> <td>Some text in Greek or Hebrew or whatever</td> <td>This is the translation</td> </tr> </table> With ConteXt I'd like to do something like this \starttabulate[|p(1.2cm)|p(1.2cm)|] \NC Manuscript XY \NR \NC Some text in Greek or Hebrew or whatever \NC This is the translation \NC \NR \stoptabulate This compiles (interestingly?), but the cells at the top aren't merged. Any ideas ? I know that natural tables offer more in this regard, but those seem not to be so well suited for parallel texts. Denis
Dear Denis,
Le 27 nov. 2021 à 13:25, Denis Maier via ntg-context
a écrit : Hi,
I’m using tabulate for parallel texts (source and translation next to each other). The top of each table should consist of only one cell covering both columns with centered content. Is that possible?
A HTML equivalent will look roughly like this:
<table> <tr> <th colspan="2">Manuscript XY </th> </tr> <tr> <td>Some text in Greek or Hebrew or whatever</td> <td>This is the translation</td> </tr> </table>
With ConteXt I’d like to do something like this
\starttabulate[|p(1.2cm)|p(1.2cm)|] \NC Manuscript XY \NR \NC Some text in Greek or Hebrew or whatever \NC This is the translation \NC \NR \stoptabulate
This compiles (interestingly?), but the cells at the top aren’t merged.
Any ideas ?
I know that natural tables offer more in this regard, but those seem not to be so well suited for parallel texts.
I switched to natural tables a long time ago and that's how I would do it: \starttext \bTABLE[width=8cm, frame=off] \setupTABLE[c][1][roffset=0.5em] \setupTABLE[c][2][loffset=0.5em] \bTR \bTD[nc=2, align=center, bottomframe=on] Manuscript XY \eTD \eTR\bTR \bTD Some text in Greek or Hebrew or whatever. The text can comprise multiple paragraphs. Or even lists and other goodies : \startitemize[intro, packed] \item first item \item second item \stopitemize \eTD\bTD This is the translation \eTD \eTR \eTABLE \stoptext I haven't seen drawbacks with parallel texts (yet) and I found natural tables very flexible. Hope it helps, -- Jean-Philippe Rey jean-philippe.rey@centralesupelec.fr mailto:jean-philippe.rey@centralesupelec.fr 91192 Gif-sur-Yvette Cedex - France Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51
Bonjour Jean-Philippe
Thank you for your response. That sounds very promising. I don’t remember why I didn’t use natural tables when I’ve started setting things up for this journal. I think I’d might have had something to do with tables that break across pages. (At least, this is what https://wiki.contextgarden.net/Tables_Overview currently says: extremetables are said to be better when page breaking is involved.)
Have you ever noticed problems in that area?
Best,
Denis
Von: Jean-Philippe Rey
Denis Maier via ntg-context schrieb am 27.11.2021 um 17:45:
Bonjour Jean-Philippe
Thank you for your response. That sounds very promising. I don’t remember why I didn’t use natural tables when I’ve started setting things up for this journal. I think I’d might have had something to do with tables that break across pages. (At least, this is what https://wiki.contextgarden.net/Tables_Overview currently says: extremetables are said to be better when page breaking is involved.)
Have you ever noticed problems in that area?
Hans added a short while ago a span feature to tabulate but it works only for simple tables (e.g. single line cells). A big feature of tabulate is that cells can be split at page breaks while cells in natural tables and extreme tables are limited to a single page. Wolfgang
Von: Wolfgang Schuster
Looks like Outlook messed up the formatting in my last message ...
Von: ntg-context
Am 27.11.21 um 21:49 schrieb Denis Maier via ntg-context:
Hans added a short while ago a span feature to tabulate but it works only for simple tables (e.g. single line cells).
You mean every cell has to be a single line cell? Or the ones where this span features applies ? That would be enough for me – at least ATM.
How does that feature work? I couldn’t find information about it.
Now it’s documented: https://wiki.contextgarden.net/Tabulate Hraban
Thanks, Hraban. That's really helpful. I'll have a look at this feature. Denis
-----Ursprüngliche Nachricht----- Von: ntg-context
Im Auftrag von Henning Hraban Ramm via ntg-context Gesendet: Samstag, 27. November 2021 22:23 An: ntg-context@ntg.nl Cc: Henning Hraban Ramm Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate Am 27.11.21 um 21:49 schrieb Denis Maier via ntg-context:
Hans added a short while ago a span feature to tabulate but it works only for simple tables (e.g. single line cells).
You mean every cell has to be a single line cell? Or the ones where this span features applies ? That would be enough for me – at least ATM.
How does that feature work? I couldn’t find information about it.
Now it’s documented: https://wiki.contextgarden.net/Tabulate
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 __________________________________________________________ _________________________
Ok, did some tests: Now I understand what was meant with the limitation that this only supports single line cells: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \starttext % this works \starttabulate[|l|l|] \NS[1][c] Manuskript X \NC\NR \NC foo \NC bar \NC\NR \stoptabulate % this does not work \starttabulate[|p|p|] \NS[1][c] Manuskript X \NC\NR \NC foo \NC bar \NC\NR \stoptabulate \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Changing the column definitions from l,c,r to p breaks it. Denis
-----Ursprüngliche Nachricht----- Von: ntg-context
Im Auftrag von Denis Maier via ntg-context Gesendet: Sonntag, 28. November 2021 08:42 An: ntg-context@ntg.nl Cc: Maier, Denis Christian (UB) Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate Thanks, Hraban. That's really helpful. I'll have a look at this feature.
Denis
-----Ursprüngliche Nachricht----- Von: ntg-context
Im Auftrag von Henning Hraban Ramm via ntg-context Gesendet: Samstag, 27. November 2021 22:23 An: ntg-context@ntg.nl Cc: Henning Hraban Ramm Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate Am 27.11.21 um 21:49 schrieb Denis Maier via ntg-context:
Hans added a short while ago a span feature to tabulate but it works only for simple tables (e.g. single line cells).
You mean every cell has to be a single line cell? Or the ones where this span features applies ? That would be enough for me – at least ATM.
How does that feature work? I couldn’t find information about it.
Now it’s documented: https://wiki.contextgarden.net/Tabulate
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
__________________________________________________________
_________________________
_________________________ 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 __________________________________________________________ _________________________
On 11/28/2021 9:26 AM, Denis Maier via ntg-context wrote:
Ok, did some tests: Now I understand what was meant with the limitation that this only supports single line cells:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \starttext
% this works \starttabulate[|l|l|] \NS[1][c] Manuskript X \NC\NR \NC foo \NC bar \NC\NR \stoptabulate
% this does not work \starttabulate[|p|p|] \NS[1][c] Manuskript X \NC\NR \NC foo \NC bar \NC\NR \stoptabulate \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Changing the column definitions from l,c,r to p breaks it. indeed, i check if that can be handled but it's too intrusive (for now) so i leave that as limitation
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Denis, I have used natural tables that span multiple pages. However, if I am right, each row must be contained on a single page. That may be an issue depending on your use cases. Best,
Le 27 nov. 2021 à 17:45, denis.maier@unibe.ch a écrit :
Bonjour Jean-Philippe
Thank you for your response. That sounds very promising. I don’t remember why I didn’t use natural tables when I’ve started setting things up for this journal. I think I’d might have had something to do with tables that break across pages. (At least, this is whathttps://wiki.contextgarden.net/Tables_Overview https://wiki.contextgarden.net/Tables_Overview currently says: extremetables are said to be better when page breaking is involved.) Have you ever noticed problems in that area?
Best, Denis
Von: Jean-Philippe Rey
Gesendet: Samstag, 27. November 2021 17:36 An: mailing list for ConTeXt users Cc: Maier, Denis Christian (UB) Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate Dear Denis,
Le 27 nov. 2021 à 13:25, Denis Maier via ntg-context
mailto:ntg-context@ntg.nl> a écrit : Hi,
I’m using tabulate for parallel texts (source and translation next to each other). The top of each table should consist of only one cell covering both columns with centered content. Is that possible?
A HTML equivalent will look roughly like this:
<table> <tr> <th colspan="2">Manuscript XY </th> </tr> <tr> <td>Some text in Greek or Hebrew or whatever</td> <td>This is the translation</td> </tr> </table>
With ConteXt I’d like to do something like this
\starttabulate[|p(1.2cm)|p(1.2cm)|] \NC Manuscript XY \NR \NC Some text in Greek or Hebrew or whatever \NC This is the translation \NC \NR \stoptabulate
This compiles (interestingly?), but the cells at the top aren’t merged.
Any ideas ?
I know that natural tables offer more in this regard, but those seem not to be so well suited for parallel texts.
I switched to natural tables a long time ago and that's how I would do it:
\starttext \bTABLE[width=8cm, frame=off] \setupTABLE[c][1][roffset=0.5em] \setupTABLE[c][2][loffset=0.5em] \bTR \bTD[nc=2, align=center, bottomframe=on] Manuscript XY \eTD \eTR\bTR \bTD Some text in Greek or Hebrew or whatever.
The text can comprise multiple paragraphs. Or even lists and other goodies : \startitemize[intro, packed] \item first item \item second item \stopitemize \eTD\bTD This is the translation \eTD \eTR \eTABLE \stoptext
I haven't seen drawbacks with parallel texts (yet) and I found natural tables very flexible.
Hope it helps,
-- Jean-Philippe Rey jean-philippe.rey@centralesupelec.fr mailto:jean-philippe.rey@centralesupelec.fr 91192 Gif-sur-Yvette Cedex - France Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51
-- Jean-Philippe Rey jean-philippe.rey@centralesupelec.fr mailto:jean-philippe.rey@centralesupelec.fr 91192 Gif-sur-Yvette Cedex - France Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51
Von: Jean-Philippe Rey
participants (5)
-
denis.maier@unibe.ch
-
Hans Hagen
-
Henning Hraban Ramm
-
Jean-Philippe Rey
-
Wolfgang Schuster