From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27411 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Table width trouble Date: Sun, 23 Apr 2006 18:28:20 +0200 Message-ID: <444BAB24.3080401@wxs.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1145809715 4248 80.91.229.2 (23 Apr 2006 16:28:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 Apr 2006 16:28:35 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Apr 23 18:28:32 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org 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 1FXhRn-0000Lz-H5 for gctc-ntg-context-518@m.gmane.org; Sun, 23 Apr 2006 18:28:31 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0052E127A5; Sun, 23 Apr 2006 18:28:31 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 12665-05; Sun, 23 Apr 2006 18:28:25 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 862811278B; Sun, 23 Apr 2006 18:28:25 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B4FDA1278B for ; Sun, 23 Apr 2006 18:28:24 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11046-06 for ; Sun, 23 Apr 2006 18:28:23 +0200 (CEST) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id C110312788 for ; Sun, 23 Apr 2006 18:28:23 +0200 (CEST) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 13746 for ; Sun, 23 Apr 2006 20:28:23 +0400 User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) Original-To: mailing list for ConTeXt users In-Reply-To: X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:27411 Archived-At: nico wrote: > Hello, > > I come back with that damn table test case. With release 2006.04.22: > > - it works fine when the column width is passed as table option, > - it's wrong when the width is passed via a column setup only, > - it works ok when both table and column option are passed, and it's the > column option that is used (which is the expected behaviour). > - it's ok when no width specified at all. > > \starttext > > \startbuffer > \bTR \bTD[nc=2] A \eTD\bTD x \eTD \bTD[nc=2] B \eTD \eTR > \bTR \bTD X \eTD \bTD[nc=3] C \eTD \bTD x \eTD \eTR > \bTR \bTD[nc=2] D \eTD \bTD x \eTD \bTD[nc=2] E \eTD \eTR > \stopbuffer > > % ok > \bTABLE[frame=on,width=3em] > \getbuffer > \eTABLE > > % nok, messy table > \bTABLE[frame=on] > \setupTABLE[c][each][width=3em] > \getbuffer > \eTABLE > > % ok, width=3em for each column > \bTABLE[frame=on,width=0.1pt] > \setupTABLE[c][each][width=3em] > \getbuffer > \eTABLE > > % ok > \bTABLE[frame=on] > \getbuffer > \eTABLE > > \stoptext > > \long\def\dohandleTBLcellA#1#2[#3]#4% {\bgroup \setupTBLcell{#1}{#2}% \setbox\scratchbox\hbox {\scratchdimen\tbltbldistance\relax \ifdim\scratchdimen>\gettbldis{#2}\relax \settbldis{#2}{\the\scratchdimen}% \fi \localframed [\@@tbl\@@tbl] [#3,\c!background=,\c!frame=\v!off]% 25% faster {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL\inTBLcell{#1}{#2}}}% \scratchdimen\gettblwid\colTBL\relax \ifdim\wd\scratchbox>\scratchdimen \ifsqueezeTBLspan \ifautosqueezeTBLspan \doifinsetelse\tbltblwidth{\v!fit,\v!fixed,\v!broad,\v!local} \donetrue \donefalse \else \donetrue \fi \ifdone \ifnum0\number\gettblcol{#1}{#2}>1\relax \settblspn\colTBL \fi \fi \fi \doifelsetblspn\colTBL \donothing {\ifdim\gettblwid\colTBL<\wd\scratchbox \settblwid\colTBL{\the\wd\scratchbox}% \fi}% auto set \fi \let\rowTBLx\rowTBL\increment\rowTBLx \scratchdimen\gettblhei\rowTBLx\relax \ifdim\ht\scratchbox<\scratchdimen \settblhei\rowTBLx{\the\ht\scratchbox}% auto set \fi \settblht{#1}{#2}{\the\ht\scratchbox}% \settblwd{#1}{#2}{\the\wd\scratchbox}% \ifautoTBLcheckwidth \ifdim\wd\scratchbox<.75\hsize \ifdim\ht\scratchbox>2\openlineheight % honor width since this \scratchdimen\gettblaut\colTBL\relax % can be a figure or so \ifdim\scratchdimen=\zeropoint % side effect: when width is set to 0pt, % we can force a span that fits the sum of spans widths \settblaut\colTBL{\the\scratchdimen}% \else\ifdim\wd\scratchbox>\scratchdimen % unless span \settblaut\colTBL{\the\wd\scratchbox}% % to be translated \writestatus\m!TABLE {no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}% \fi\fi \fi \fi \fi \setbox2\null \wd2\wd\scratchbox \ht2\ht\scratchbox \dp2\dp\scratchbox \box2 \egroup} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------