From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77956 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5?= Newsgroups: gmane.comp.tex.context Subject: Re: test for (negative) number Date: Tue, 21 Aug 2012 08:32:34 +0200 Message-ID: References: <50325F28.6060102@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345530708 9300 80.91.229.3 (21 Aug 2012 06:31:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Aug 2012 06:31:48 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 21 08:31:49 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T3i0D-0007ag-7E for gctc-ntg-context-518@m.gmane.org; Tue, 21 Aug 2012 08:31:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D163510216; Tue, 21 Aug 2012 08:31:47 +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 jjaYT1bcblvr; Tue, 21 Aug 2012 08:31:45 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id DAA01101EC; Tue, 21 Aug 2012 08:31:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EA49E101EC for ; Tue, 21 Aug 2012 08:31:42 +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 t3OZjY3fwnjY for ; Tue, 21 Aug 2012 08:31:41 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id D0236101E8 for ; Tue, 21 Aug 2012 08:31:41 +0200 (CEST) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q7L6VQkG030707 for ; Tue, 21 Aug 2012 08:31:28 +0200 Original-Received: from lk-2008-nbk ([88.100.123.157]) (authenticated user lpr@pontex.cz) by mail.pontex.cz (Kerio MailServer 6.6.2) for ntg-context@ntg.nl; Tue, 21 Aug 2012 08:31:36 +0200 In-Reply-To: User-Agent: Opera Mail/12.01 (Win32) X-Bayes-Prob: 0.0011 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=89.233.168.98; country=CZ; region=52; city=Prague; latitude=50.0833; longitude=14.4667; http://maps.google.com/maps?q=50.0833,14.4667&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0WHNivqmq - 6b31c392ee7d - 20120821 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:77956 Archived-At: On Mon, 20 Aug 2012 20:11:32 +0200, Sietse Brouwer wrote: > Hi Peter, > > I recommend using the following handy little idiom: > \ctxlua{commands.doifelse(-45 > 0)}{big}{small} % small > > It lets you do all sorts of things that are tricky in TeX: > \ctxlua{ commands.doifelse( string.len( "-45" ) > 5 ) }{long}{short} > > Cheers, > Sietse ... Has been wikified - "http://wiki.contextgarden.net/Command/doif..." Lukas ___________________________________________________________________________________ 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 ___________________________________________________________________________________