From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/1008 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Fixed width form field Date: Tue, 12 Oct 1999 18:35:12 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <38037150.3618B501@wxs.nl> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035391852 29024 80.91.224.250 (23 Oct 2002 16:50:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 16:50:52 +0000 (UTC) Original-To: Matthew.Baker@gmd.de Xref: main.gmane.org gmane.comp.tex.context:1008 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:1008 Matthew Baker wrote: > I want to design a form in which fields appear in table cells so that they > line up correctly. In order to deal with baseline alignment and things, I > use the label field in the form. I have a macro like > > \def\putfield[#1]#2{\hbox{\field[#1][#2]}} > > I would like the field to extend to fill the table cell (which I set to a > fixed size with the w table format option). How can I set the field up to > fit to this size? I can't simple set the field width to the desired size > because I don't know how long the label is. I'd like ideally to set the > width of the frame around the field to something fixed and then set the > label and field widths to "fit", eg > > \setupfield [MyFieldSetup] [frame, label, horizontal] [width=60mm] > [width=fit] [width=fit] > > But that doesn't work. Any way to do this? A quick tip (untested) \setbox0=\hbox{#1}% label \dimen0=60mm \advance\dimen0 by -\wd0 \advende\dimen0 by % try some 2ex % if needed \edef\TheWidth{\the\dimen0} ... width=\TheWidth or something along these lines. 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.nl -----------------------------------------------------------------