ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Thomas A.Schmitz <thomas.schmitz@uni-bonn.de>
Subject: Re: Table question
Date: Mon, 15 Nov 2004 22:01:57 +0100	[thread overview]
Message-ID: <964D7C28-3749-11D9-B42C-000A95B9ADE2@uni-bonn.de> (raw)
In-Reply-To: <D4742FF2-1770-11D9-BF29-000A95B9ADE2@uni-bonn.de>

OK, I'm answering my own question from October: by shamelessly copying 
and adapting code from enattab, I managed to get double lines in 
tables, and I'm almost there. I guess real texnicians would call it a 
dirty hack, but it does what I want. Could anybody test this code:

\starttext

\startuniqueMPgraphic{c11}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
path q ;
q = llcorner p--ulcorner p ;
pair a ;
a := point .08 of q ;
path r ;
r = lrcorner p--urcorner p ;
pair b ;
b := point .08 of r ;
draw b--a--ulcorner p--urcorner p ;
draw lrcorner p--llcorner p--a ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{c12}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
path q ;
q = ulcorner p--urcorner p ;
pair a ;
a := point .02 of q ;
path r ;
r = llcorner p--lrcorner p ;
pair b ;
b := point .02 of r ;
path s ;
s = lrcorner p--urcorner p ;
pair c ;
c := point .08 of s ;
path t ;
t = b--a ;
pair d ;
d := point .08 of t ;
path u ;
u = llcorner p--ulcorner p ;
pair e ;
e := point .08 of u ;
draw ulcorner p--urcorner p--c--d--a ;
draw b--lrcorner p ;
draw e--ulcorner p ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{c13}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
path q ;
q = llcorner p--ulcorner p ;
pair a ;
a := point .08 of q ;
path r ;
r = lrcorner p--urcorner p ;
pair b ;
b := point .08 of r ;
draw ulcorner p--urcorner p--b--a ;
draw llcorner p--lrcorner p ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{c14}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
path q ;
q = llcorner p--ulcorner p ;
pair a ;
a := point .08 of q ;
path r ;
r = lrcorner p--urcorner p ;
pair b ;
b := point .08 of r ;
draw ulcorner p--urcorner p--lrcorner p--llcorner p ;
draw b--a ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{c21}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
draw ulcorner p--llcorner p--lrcorner p ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{c22}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
path q ;
q = ulcorner p--urcorner p ;
pair a ;
a := point .02 of q ;
path r ;
r = llcorner p--lrcorner p ;
pair b ;
b := point .02 of r ;
draw a--b--lrcorner p ;
draw llcorner p--ulcorner p ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{c24}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
draw ulcorner p--llcorner p--lrcorner p--urcorner p ;
\stopuniqueMPgraphic


\defineoverlay[c11][\uniqueMPgraphic{c11}]
\defineoverlay[c12][\uniqueMPgraphic{c12}]
\defineoverlay[c13][\uniqueMPgraphic{c13}]
\defineoverlay[c14][\uniqueMPgraphic{c14}]
\defineoverlay[c21][\uniqueMPgraphic{c21}]
\defineoverlay[c22][\uniqueMPgraphic{c22}]
\defineoverlay[c24][\uniqueMPgraphic{c24}]

\bTABLE[width=.25\textwidth,frame=off] \bTR \bTD 
\framed[width=.25\textwidth,height=4.5ex,background=c11,frame=off]{A}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c12,frame=off]{B}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c13,frame=off]{C}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c14,frame=off]{D}
\eTD \eTR
\bTR \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c21,frame=off]{E}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c22,frame=off]{F}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c21,frame=off]{G}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c24,frame=off]{H}
\eTD \eTR
\bTR\bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c21,frame=off]{I}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c22,frame=off]{K}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c21,frame=off]{L}
\eTD \bTD[align=middle] 
\framed[width=.25\textwidth,height=4.5ex,background=c24,frame=off]{M}
\eTD \eTR
\eTABLE

\stoptext

As you can see, the only problem is that there is a small gap between 
the rows in the table. Is there a way how this gap can be closed?

Thanks for your patience!

Thomas

On Oct 6, 2004, at 10:22 AM, Thomas A.Schmitz wrote:

> Hi all,
>
> quick question: does any of the table environments in ConTeXt (table, 
> tables, TABLE, linetable) provide the possibility to have double lines 
> separate some rows and columns?
>
> A || B | C
> __________
> ----------
> D |  E | F
>
> Thanks a lot!
>
> Thomas
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>

  reply	other threads:[~2004-11-15 21:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-06  8:22 Thomas A.Schmitz
2004-11-15 21:01 ` Thomas A.Schmitz [this message]
2004-11-17 13:11 Peter Rolf
2004-11-17 13:29 ` Thomas A. Schmitz
2004-12-03 14:35   ` Patrick Gundlach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=964D7C28-3749-11D9-B42C-000A95B9ADE2@uni-bonn.de \
    --to=thomas.schmitz@uni-bonn.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).