From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85106 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?G=C3=A9ry_Ogam?= Newsgroups: gmane.comp.tex.context Subject: How to test the emptyness of a variable? Date: Tue, 5 Nov 2013 13:41:29 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0795737673==" X-Trace: ger.gmane.org 1383655298 5265 80.91.229.3 (5 Nov 2013 12:41:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Nov 2013 12:41:38 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 05 13:41:45 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vdfwz-0004hA-9i for gctc-ntg-context-518@m.gmane.org; Tue, 05 Nov 2013 13:41:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F1DD41022B; Tue, 5 Nov 2013 13:41:40 +0100 (CET) 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 tFFRpvxBDsT5; Tue, 5 Nov 2013 13:41:35 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 8B45D101F5; Tue, 5 Nov 2013 13:41:35 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B1C5A101F5 for ; Tue, 5 Nov 2013 13:41:33 +0100 (CET) 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 pkZRfq3KB09X for ; Tue, 5 Nov 2013 13:41:32 +0100 (CET) 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 25CC4101EF for ; Tue, 5 Nov 2013 13:41:30 +0100 (CET) Original-Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id rA5CfUst031280 for ; Tue, 5 Nov 2013 13:41:30 +0100 Original-Received: by mail-wi0-f177.google.com with SMTP id f4so1989259wiw.16 for ; Tue, 05 Nov 2013 04:41:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Vn67KOJDggql7p8El7/WO7TniW0ebHJ4mQSwZWEcAns=; b=i4a911Hm1Ol/4iptDhktZMx166tgBORiMaXmBsHceFTAbzojzRdwb6TCTk/lKMd+OZ 2s8S1B7cQrYY4qjLnb+rh9CFN4oVWeqnDE4xRxuLq6JN220tEc9D0DsivkD1yEbPmFrT rf14/WB0Xzxjoq/MeyByjCpPQu9pgHBQSnQCezw079zR64KS8mIxINYDKad+PJ3aEbGp vGR/LX/USOzCGyhcDX2tz1KiaOeqivj0kYwUiZSclfv+L2dTkhLoPZzf/gpjW4MFp4nb VDU52uh/HrReT00czeyqeuH9S4xeA3YXfPabQhOlVY7z1yTuTBRk7b3ISv7XrffTVctD IpVg== X-Received: by 10.180.160.240 with SMTP id xn16mr16550812wib.62.1383655289939; Tue, 05 Nov 2013 04:41:29 -0800 (PST) Original-Received: by 10.216.244.4 with HTTP; Tue, 5 Nov 2013 04:41:29 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::231; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03KJMFuk0 - c914529c56a8 - 20131105 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:85106 Archived-At: --===============0795737673== Content-Type: multipart/alternative; boundary=047d7b6251b00c6b8004ea6d5ab1 --047d7b6251b00c6b8004ea6d5ab1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > you can try > > \doifnothing\currentstructurelabel{Do something} It does not work in my case (even if the currenstructurelabel is empty it acts as if it not empty). In fact I asked that to get the following behaviour: =E2=80=94 When there is a chapter label (\setuplabeltext[chapter=3DCHAPTER~= ]) I want that: CHAPTER ONE Cool CHAPTER 2 Cat CHAPTER 3 Mouse etc. =E2=80=94 When there is no chapter label (\setuplabeltext[chapter=3D]) I wa= nt that: 1 Cool 2 Cat 3 Mouse etc. E.g.: \setuplabeltext[chapter=3DCHAPTER~] \define[1] \MyCommand{\doifelse{\currentsectioncountervalue}{1}{ONE}{#1}} \setuphead[chapter][deepnumbercommand=3D\MyCommand] \starttext \chapter{Cool} \chapter{Cat} \chapter{Mouse} \stoptext --047d7b6251b00c6b8004ea6d5ab1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>=C2=A0you can try
>=C2=A0
> \doifnothing\currentstructurelabel{Do something}

It does not work in my case (even if the curr= enstructurelabel is empty it acts as if it not empty). In fact I asked that= to get the following behaviour:

=E2=80=94 When th= ere is a chapter label (\setuplabeltext[chapter=3DCHAPTER~]) I want that:

CHAPTER ONE Cool
CHAPTER 2 Cat
CHAP= TER 3 Mouse
etc.

=E2=80=94 When the= re is no chapter label (\setuplabeltext[chapter=3D]) I want that:

1 Cool
2 Cat
3 Mouse
etc.


E.g.:

\= setuplabeltext[chapter=3DCHAPTER~]
\define[1] \MyCommand{\doifels= e{\currentsectioncountervalue}{1}{ONE}{#1}}
\setuphead[chapter][deepnumbercommand=3D\MyCommand]

\starttext

\chapter{Cool}
\chapte= r{Cat}
\chapter{Mouse}

\stoptext
--047d7b6251b00c6b8004ea6d5ab1-- --===============0795737673== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0795737673==--