From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/18917 Path: news.gmane.org!not-for-mail From: h h extern Newsgroups: gmane.comp.tex.context Subject: Re: Re: Current text width? Date: Sun, 13 Mar 2005 22:39:46 +0100 Message-ID: <4234B322.5020704@wxs.nl> References: <20050307215318.4572E12800@ronja.ntg.nl> <422D62B8.9010606@capdm.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1110755489 23007 80.91.229.2 (13 Mar 2005 23:11:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 13 Mar 2005 23:11:29 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Mar 14 00:11:28 2005 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 1DAcCK-0002ol-FR for gctc-ntg-context-518@m.gmane.org; Mon, 14 Mar 2005 00:08:37 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3A3A1128BE; Mon, 14 Mar 2005 00:08:54 +0100 (CET) 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 30069-04-28; Mon, 14 Mar 2005 00:08:50 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B4EB6127D4; Mon, 14 Mar 2005 00:08:50 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5533A127D4 for ; Mon, 14 Mar 2005 00:08:49 +0100 (CET) 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 30216-03-24 for ; Mon, 14 Mar 2005 00:08:45 +0100 (CET) Original-Received: from mailrelay01.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 6AA10128B9 for ; Mon, 14 Mar 2005 00:08:44 +0100 (CET) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay01.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j2DN8c4k005268 for ; Mon, 14 Mar 2005 00:08:38 +0100 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id DB90518224; Sun, 13 Mar 2005 23:53:12 +0100 (CET) Original-Received: from [127.0.0.1] (unknown [10.100.1.1]) by server-1.pragma-net.nl (Postfix) with ESMTP id 06E4C17C1E for ; Sun, 13 Mar 2005 22:53:07 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <422D62B8.9010606@capdm.com> X-Virus-Scanned: ClamAV 0.80/744/Fri Mar 4 04:01:45 2005 clamav-milter version 0.80j on mailrelay01 X-Virus-Status: Clean 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 X-MailScanner-From: ntg-context-bounces@ntg.nl X-MailScanner-To: gctc-ntg-context-518@m.gmane.org Xref: news.gmane.org gmane.comp.tex.context:18917 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:18917 Duncan Hothersall wrote: > I said: > >> So - is there a parameter which represents the current width of the >> layout area, taking into account itemisations, textbackgrounds and >> anything else? Thanks. > > > I came up with a rather ugly kludge which solves my immediate problem > but might not be best. I created a new dimen, \RealWidth, and before > each table I set it to the value of \textwidth minus leftskip minus > rightskip. In other words, I did this: > > -- > \newdimen\RealWidth > \definetextbackground[TestBackground] > [leftoffset=1em,rightoffset=1em,topoffset=8pt, > bottomoffset=8pt,frame=on,location=paragraph] > \starttext > \starttextbackground[TestBackground] > Some text first, which behaves perfectly, and then a table: > > \leavevmode\RealWidth=\textwidth\advance\RealWidth > by-\leftskip\advance\RealWidth by-\rightskip\bTABLE > \setupTABLE[column][1][width=0.3\RealWidth] > \setupTABLE[column][2][width=0.7\RealWidth] > \bTR\bTD I was hoping\eTD > \bTD that this table would make itself narrower according to the > background offsets, like the text does. And now it does!\eTD\eTR > \eTABLE} > \stoptextbackground > \stoptext > -- > > This produces what I want as far as I have tested it. I'm not sure it's > the best or most comprehensive solution though. kind of; an alternative is: \startlinecorrection % needed anyway \setlocalhsize \hsize\localhsize \dontleavehmode \bTABLE \setupTABLE[column][1][width=0.3\hsize] \setupTABLE[column][2][width=0.7\hsize] \bTR\bTD I was hoping\eTD \bTD that this table would make itself narrower according to the background offsets, like the text does. And now it does!\eTD\eTR \eTABLE \stoplinecorrection auto adaption is kind of tricky here because Hans ----------------------------------------------------------------- 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 -----------------------------------------------------------------