From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/61285 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Filling boxes Date: Sat, 28 Aug 2010 16:20:39 +0200 Message-ID: <4C791B37.60606@googlemail.com> References: <877hjbqavw.fsf@linux-lqcw.site> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1283005264 13314 80.91.229.12 (28 Aug 2010 14:21:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 28 Aug 2010 14:21:04 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Aug 28 16:21:03 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OpMHE-0007fq-6g for gctc-ntg-context-518@m.gmane.org; Sat, 28 Aug 2010 16:21:00 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7949CCA68C; Sat, 28 Aug 2010 16:20:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SwZqJKY1A1ts; Sat, 28 Aug 2010 16:20:56 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 676BDCA689; Sat, 28 Aug 2010 16:20:56 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A7B74CA689 for ; Sat, 28 Aug 2010 16:20:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lKiBY1xP5kOB for ; Sat, 28 Aug 2010 16:20:43 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id D3BAFCA687 for ; Sat, 28 Aug 2010 16:20:43 +0200 (CEST) Original-Received: from mail-bw0-f41.google.com (mail-bw0-f41.google.com [209.85.214.41]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o7SEKgie016806 for ; Sat, 28 Aug 2010 16:20:43 +0200 Original-Received: by bwz6 with SMTP id 6so3333277bwz.14 for ; Sat, 28 Aug 2010 07:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=7A8g1opm27soDPdQ/0Jz9of3nnVHa2Pijt5wFI9uaFo=; b=wUCv+tCoSmD+HHqDX1ja4t087Kw/Gcqu9Sc/W+ELsHdAun4HTtLWpBNzSTSCCgwrxg bmPfY2xLoSxVanL30pJxOvFgT2EEgQ/WxT7TsXbQDIA0JGCGUoI6qmsPSLAAZRIvPrmh Y8AzS8tiUgs3Z6Rqz54JOSd1iVbBUHu/RwRnI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=UaBhoE1MrIW9qm2kURZYELXBJ16limpYmCyWA7xQi18UN5z4dkbFx4AmfpiEyKygNE d5VzTBM28qHYdunYAryFQDkudO3vTWSi8RYRA0iix9SgkPu/DFsjeJ7G/jcrWdw+p+7c 803NIqWn4yWD8dyZhCZ7v0DuKYmMeCx8puSPk= Original-Received: by 10.204.76.69 with SMTP id b5mr1505790bkk.79.1283005242521; Sat, 28 Aug 2010 07:20:42 -0700 (PDT) Original-Received: from [192.168.2.23] (p5B29601A.dip.t-dialin.net [91.41.96.26]) by mx.google.com with ESMTPS id 24sm3492207bkr.7.2010.08.28.07.20.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 28 Aug 2010 07:20:41 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 In-Reply-To: <877hjbqavw.fsf@linux-lqcw.site> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0cCXOkHKt - b49ead387be9 - 20100828 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:61285 Archived-At: Am 28.08.10 12:39, schrieb Cecil Westerhof: > I have (a long time ago) made the following .tex file: > % christmasTree.tex: creates a to-do Christmas tree > % Copyright 2009 Cecil Westerhof, Decebal Computing > % You are free to use this code when you keep my copyright > % This file should be processed with ConTeXt (texexec file) > > \usemodule[defaults] > > \setupoutput[pdf] > > \setuplayout[header=0cm, footer=0.25cm] > > \defineframed > [action][width=5cm, height=3cm, offset=none] > \defineframed > [base] [width=3cm, height=2cm, offset=none, topframe=off] > > \starttext > > \setupheader[state=high] > > \setupfootertexts[\hfill {\switchtobodyfont[6pt]\copyright Decebal Computing, http://www.decebal.nl} \hfill][] [][] > > \setupalign[middle]\offinterlineskip > > {\bold\switchtobodyfont[32pt]De taken kerstboom\switchtobodyfont[16pt]\blank} > > \noindent\action[bottomframe=off]{} > > \noindent\action[bottomframe=off, rightframe=off]{}% > \action[bottomframe=off]{} > > \noindent\dorecurse{2}{% > \action[rightframe=off]{}% > }% > \action{} > > \dorecurse{7}{ > \noindent \base{} > > } > > \stoptext > > It makes a 'Christmas tree' made of boxes. What I would like is to put > some text, which are given as parameters, into the 13 boxes. But when > a text does not fit into it's box, I do not want the PDF to be > generated and receive an error code. Is this possible? \setuplayout[header=0cm,footer=0.25cm] \defineframed [action] [width=5cm,height=3cm,offset=none,frameoffset=.5\linewidth] \defineframed [base] [width=3cm,height=2cm,offset=none,frameoffset=.5\linewidth] \setupfooter[style={\switchtobodyfont[6pt]}] \newcounter\treecounter \setvariables [tree] [1=One, 2=Two, 3=Three, 4=Four, 4={\switchtobodyfont[9pt]\input ward }, 5=Five, 6=Six, 7=Seven] \def\CheckBoxContent {\begingroup \setbox\scratchbox\vbox{\getvariable{tree}{\treecounter}}% \ifdim\ht\scratchbox>\vsize \forcequitjob{tree}% \else \box\scratchbox \fi \endgroup} \starttext \setupfootertexts[\copyright Decebal Computing, http://www.decebal.nl] \setupalign[middle]\offinterlineskip {\definedfont[Bold at 32pt]De taken kerstboom} \blank \dorecurse{3} {\noindent\dorecurse\recurselevel {\increment\treecounter \action{\CheckBoxContent}}\par} \dorecurse{7} {\increment\treecounter\noindent\base{\CheckBoxContent}\par} \stoptext Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________