From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/19695 Path: news.gmane.org!not-for-mail From: Eckhart =?iso-8859-1?Q?Guth=F6hrlein?= Newsgroups: gmane.comp.tex.context Subject: struggle for booktabs Date: Fri, 8 Apr 2005 16:26:06 +0200 Message-ID: <20050408142606.GA14997@cebitec.uni-bielefeld.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="KsGdsel6WgEHnImy" X-Trace: sea.gmane.org 1112970254 20980 80.91.229.2 (8 Apr 2005 14:24:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2005 14:24:14 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 08 16:24:12 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1DJuOn-0004ci-SM for gctc-ntg-context-518@m.gmane.org; Fri, 08 Apr 2005 16:23:53 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id ACB5B128FB; Fri, 8 Apr 2005 16:26:20 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 12888-09; Fri, 8 Apr 2005 16:26:16 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 20E6412812; Fri, 8 Apr 2005 16:26:16 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 96C9912812 for ; Fri, 8 Apr 2005 16:26:14 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13404-01 for ; Fri, 8 Apr 2005 16:26:13 +0200 (CEST) Original-Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE (sauron.cebitec.uni-bielefeld.de [129.70.160.28]) by ronja.ntg.nl (Postfix) with ESMTP id AE5EB127FC for ; Fri, 8 Apr 2005 16:26:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 4970D3B3 for ; Fri, 8 Apr 2005 16:26:09 +0200 (MEST) Original-Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (sauron [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13776-03-6 for ; Fri, 8 Apr 2005 16:26:08 +0200 (MEST) Original-Received: from mowgli.Genetik.Uni-Bielefeld.DE (mowgli.CeBiTec.Uni-Bielefeld.DE [129.70.160.61]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 252F13AE for ; Fri, 8 Apr 2005 16:26:08 +0200 (MEST) Original-Received: by mowgli.Genetik.Uni-Bielefeld.DE (Postfix, from userid 13119) id A00472400; Fri, 8 Apr 2005 16:26:07 +0200 (MEST) Original-To: ntg-context@ntg.nl Mail-Followup-To: ntg-context@ntg.nl Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at cebitec.uni-bielefeld.de X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:19695 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:19695 --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi again, since I often need row and column spanning, I have tried to use natural tables to produce good looking tables (booktabs-like, as discussed in the recent thread). I think it will be possible to achieve what I want, but I have some open points. For those interested, I have attached a file showing what I have devised to get the job done. The code is not very elegant, and the parameters controlling spacing and rule thickness are just for testing. But the main idea becomes clear: I use dummy rows with a height determined by rule thickness and vertical separation. The rules are drawn by metapost. Any comments and suggestions are very welcome. Now, my questions/remarks: - How to control spacing between table rows and columns? I can't simply set the offset, since I must be able to set vertical and horizontal spacing independently. - To have each cell entry centered horizontally and vertically, I have to say \setupTABLE[row][each][align={middle,lohi}]. I think it should also be possible to do this via \setupTABLE[align={middle,lohi}] which currently has no effect. - I think I will come to the point where I want to define macros of my own wich can take a key=value list of arguments with the ability to set defaults using a setup command. Can someone give me a pointer where to look in order to learn how this is done? Thanks for your help and comments, Eckhart --KsGdsel6WgEHnImy Content-Type: application/x-tex Content-Disposition: attachment; filename="tab.tex" Content-Transfer-Encoding: quoted-printable \newdimen\toprulethickness \toprulethickness1pt=0A\newdimen\midrulethick= ness \midrulethickness.4pt=0A\newdimen\bottomrulethickness \bottomrulet= hickness\toprulethickness=0A\newdimen\toprulesep \toprulesep2ex= =0A\newdimen\midrulesep \midrulesep.5\toprulesep=0A\newdimen\bott= omrulesep \bottomrulesep\toprulesep=0A\newdimen\lefttrim = \lefttrim.25em=0A\newdimen\righttrim \righttrim\lefttrim=0A=0A\st= artuniqueMPgraphic{toprule}=0A fill unitsquare xscaled \overlaywidth yscal= ed \MPvar{rulethickness}=0A shifted (0,\overlayheight-\MPvar{rulethickne= ss});=0A\stopuniqueMPgraphic=0A\startuniqueMPgraphic{bottomrule}=0A fill u= nitsquare xscaled \overlaywidth yscaled \MPvar{rulethickness};=0A\stopuniqu= eMPgraphic=0A\startuniqueMPgraphic{midrule}=0A fill unitsquare xscaled \ov= erlaywidth yscaled \MPvar{rulethickness}=0A shifted (0,.5*(\overlayheigh= t-\MPvar{rulethickness}));=0A\stopuniqueMPgraphic=0A\startuniqueMPgraphic{c= midrule}=0A fill unitsquare =0A xscaled (\overlaywidth-\MPvar{lefttrim}= -\MPvar{righttrim})=0A yscaled \MPvar{rulethickness}=0A shifted (0,.5= *(\overlayheight-\MPvar{rulethickness}));=0A\stopuniqueMPgraphic=0A=0A\setu= pMPvariables[toprule][rulethickness=3D\the\toprulethickness]=0A\setupMPvari= ables[midrule][rulethickness=3D\the\midrulethickness]=0A\setupMPvariables[c= midrule][rulethickness=3D\the\midrulethickness,=0A lefttrim=3D\the\lefttri= m, righttrim=3D\the\righttrim]=0A\setupMPvariables[bottomrule][rulethicknes= s=3D\the\bottomrulethickness]=0A=0A\defineoverlay[toprule][\uniqueMPgraphic= {toprule}]=0A\defineoverlay[midrule][\uniqueMPgraphic{midrule}]=0A\defineov= erlay[cmidrule][\uniqueMPgraphic{cmidrule}]=0A\defineoverlay[bottomrule][\u= niqueMPgraphic{bottomrule}]=0A=0A\define\TRL{\bTR[height=3D\dimexpr(\toprul= ethickness+\toprulesep),=0A background=3Dtoprule]\eTR}=0A\de= fine\BRL{\bTR[height=3D\dimexpr(\bottomrulethickness+\bottomrulesep),=0A = background=3Dbottomrule]\eTR}=0A\define\MRL{\bTR[height=3D\dim= expr(\midrulethickness+\midrulesep),=0A background=3Dmidrule= ]\eTR}=0A=0A\starttext=0A=0A \setupTABLE[frame=3Doff]=0A \setupTABLE[row]= [each][align=3D{middle,lohi}]=0A \bTABLE=0A \TRL=0A \bTR \bTD[nr=3D3= ] rowspan \eTD=0A \bTD[nc=3D2] colspan \eTD=0A \eTR=0A \bTR[h= eight=3D\midrulethickness]=0A \bTD[nc=3D2,background=3Dcmidrule]\eTD= =0A \eTR=0A \bTR =0A \bTD this is this \e= TD \bTD that is that\eTD=0A \eTR=0A \MRL=0A \bTR \bTD 1,1 \eTD \bT= D 2,1 \eTD \bTD 3,1 \eTD \eTR=0A \bTR \bTD 1,2 \eTD \bTD 2,2 \eTD \bTD 3= ,2 \eTD \eTR=0A \BRL=0A \eTABLE=0A=0A\stoptext=0A --KsGdsel6WgEHnImy Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --KsGdsel6WgEHnImy--