From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24162 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Filling framed boxes up to the max Date: Tue, 06 Dec 2005 10:26:54 +0100 Message-ID: <4395595E.1020004@wxs.nl> References: <20051205185856.GA9175@dach-wg.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1133861311 3471 80.91.229.2 (6 Dec 2005 09:28:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2005 09:28:31 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 06 10:28:29 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 1EjZ6K-0001JC-T7 for gctc-ntg-context-518@m.gmane.org; Tue, 06 Dec 2005 10:27:08 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8DACC12865; Tue, 6 Dec 2005 10:27:08 +0100 (CET) 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 30062-03-4; Tue, 6 Dec 2005 10:27:04 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D44E31285C; Tue, 6 Dec 2005 10:27:04 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2E48F1284F for ; Tue, 6 Dec 2005 10:27:02 +0100 (CET) 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 30062-03-3 for ; Tue, 6 Dec 2005 10:27:01 +0100 (CET) Original-Received: from controller-1 (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with ESMTP id 18E5C1283B for ; Tue, 6 Dec 2005 10:26:56 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 6561 for ; Tue, 06 Dec 2005 10:32:39 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <20051205185856.GA9175@dach-wg.de> 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.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: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:24162 Archived-At: Alexander Klink wrote: >Hi, > >I would like to do the timetable of the Chaos Communication >Congress in ConTeXt again. Last year, I used a perl script >to convert the iCal file to ConTeXt code. This year, I'd like >to do it a bit better. One of the problems I have there is that >I would like to fill a framed box with text up to the max. If it >is full before everything is typeset, the text should end with >=EF=BF=BD...=EF=BF=BD. The manual solution (cf. http://www.alech.de/tmp/= day1.pdf) >involved counting the numbers of letters and perl and estimating >a cut-off value. But I guess there is a better method in ConTeXt >itself. >Maybe someone here has an idea. > =20 > if live was always so easy ... when confronted with problems like this, it's often that one first=20 thinks of the tools one knows (perl, ruby, xslt) even when the problem=20 is more related to typesetting which means that tex may well be able to=20 deal with the problem directly ... \starttext \def\StartCutOff {\setbox\scratchbox =3D \vbox \bgroup \setstrut \begstrut} \def\StopCutOff {\endstrut \egroup \ifdim\ht\scratchbox>\vsize \setbox\scratchbox=3D\vsplit\scratchbox to=20 \dimexpr\vsize-\lineheight\relax \unvbox\scratchbox \vfill \hfill \strut ?...? \else \unvbox\scratchbox \fi} \framed [width=3D4cm,height=3D5cm,align=3Dright,strut=3Dno] {\StartCutOff \input tufte \StopCutOff} \framed [width=3D4cm,height=3D5cm,align=3Dright,strut=3Dno] {\StartCutOff \input zapf \StopCutOff} \stoptext it's up to you to wikify it (maybe i should collect those things for a=20 magazine issue) Hans