From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/45594 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: layout parameter testing Date: Fri, 14 Nov 2008 15:33:00 +0100 Message-ID: <5F68A397-85AA-49C3-A30A-68B295ABF0A3@gmail.com> References: <326847810811131152w6ae4ad5et1aef1f4d91df2762@mail.gmail.com> <8829B802-8243-45E0-BBEC-CD1FD5BE1E98@gmail.com> <326847810811140606x3294f583u44b5f50ee662dfa8@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226673307 16589 80.91.229.12 (14 Nov 2008 14:35:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2008 14:35:07 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 14 15:36:08 2008 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 lo.gmane.org with esmtp (Exim 4.50) id 1L0zmJ-00022e-Gp for gctc-ntg-context-518@m.gmane.org; Fri, 14 Nov 2008 15:36:07 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9CD201FC44; Fri, 14 Nov 2008 15:34:56 +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 20817-05-4; Fri, 14 Nov 2008 15:33:47 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 14B781FBDB; Fri, 14 Nov 2008 15:33:47 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 030A41FBC9 for ; Fri, 14 Nov 2008 15:33:45 +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 25498-04-2 for ; Fri, 14 Nov 2008 15:33:08 +0100 (CET) Original-Received: from qb-out-1314.google.com (qb-out-1314.google.com [72.14.204.168]) by ronja.ntg.nl (Postfix) with ESMTP id E726B1FBFB for ; Fri, 14 Nov 2008 15:33:07 +0100 (CET) Original-Received: by qb-out-1314.google.com with SMTP id e19so1430750qba.8 for ; Fri, 14 Nov 2008 06:33:06 -0800 (PST) Original-Received: by 10.86.62.3 with SMTP id k3mr655819fga.6.1226673186150; Fri, 14 Nov 2008 06:33:06 -0800 (PST) Original-Received: from ?10.40.152.8? (8.121.113.82.net.de.o2.com [82.113.121.8]) by mx.google.com with ESMTPS id l19sm2000712fgb.7.2008.11.14.06.33.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 Nov 2008 06:33:05 -0800 (PST) In-Reply-To: <326847810811140606x3294f583u44b5f50ee662dfa8@mail.gmail.com> X-Mailer: Apple Mail (2.929.2) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:45594 Archived-At: Am 14.11.2008 um 15:06 schrieb Alan STONE: > On Thu, Nov 13, 2008 at 9:48 PM, Wolfgang Schuster > wrote: > > Am 13.11.2008 um 20:52 schrieb Alan STONE: > > > Hi, > > > > With \definelayout[myLayout][...], how do you test whether one of > > its parameters has a certain value, is greater than 0, etc... ? > > \definelayout > [mylayout] > [backspace=3cm, > width=12cm] > > \starttext > > \doifdimensionelse{\namedlayoutparameter{mylayout}{width}} % width > could be 'fit' > {\ifdim\namedlayoutparameter{mylayout}{width}<10cm > ... > \else > ... > \fi} > {\processaction > [\namedlayoutparameter{mylayout}{width}] > [fit=>..., > unknown=>...]} > > \stoptext > > Re: http://wiki.contextgarden.net/System_Macros/Action_Processing > > What is 'fit' ? You could set the the width of the textarea in three different ways: 1) as absolute value, 2) as remaining space between backspace and cutspace (useful in presentations) and 3) as remaining space between equal margins. \definelayout[1][backspace=4cm,width=12cm] \definelayout[2][backspace=5cm,cutspace=7cm,width=fit] \definelayout[3][backspace=3cm,width=middle] \showframe \starttext \dorecurse{3} {\starttabulate \NC backspace \EQ \PtToCm\backspace \NC\NR \NC textwidth \EQ \PtToCm\textwidth \NC\NR \NC cutspace \EQ \PtToCm\cutspace \NC\NR \stoptabulate \page} \stoptext Regards, 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________