From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/71933 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Re: How do I test for empty labeltext? Date: Tue, 25 Oct 2011 11:26:47 +0200 Message-ID: References: <4EA5B147.3060805@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1319534831 19796 80.91.229.12 (25 Oct 2011 09:27:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 25 Oct 2011 09:27:11 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 25 11:27:07 2011 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 1RIdHj-0006fd-Re for gctc-ntg-context-518@m.gmane.org; Tue, 25 Oct 2011 11:27:03 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D1B17CB083; Tue, 25 Oct 2011 11:27:02 +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 Yskxbz34Asan; Tue, 25 Oct 2011 11:26:56 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C3098CB085; Tue, 25 Oct 2011 11:26:56 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0754ECB085 for ; Tue, 25 Oct 2011 11:26: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 A9WD8hsFJtCf for ; Tue, 25 Oct 2011 11:26:49 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id A5FB5CB083 for ; Tue, 25 Oct 2011 11:26:49 +0200 (CEST) Original-Received: from mail-qw0-f41.google.com (mail-qw0-f41.google.com [209.85.216.41]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p9P9QlfL001161 for ; Tue, 25 Oct 2011 11:26:48 +0200 Original-Received: by qadc11 with SMTP id c11so291777qad.14 for ; Tue, 25 Oct 2011 02:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LM9vrLJSA4kM5uf1eIMgowFh86vVhn/OmlDJO6lRr94=; b=x5WK4skkHzRZBCisXYlohUxrq74Tr89sjZNQRJ0aIkGBUxQCp4KfJIr/+uTvBmDP1p XB1a5JeGcfr71RG12DzCng6iZFseUG8Eqhqz0US5PZOc5bQwcQVJDCsS9YOP6rpbJiBU B/SRkkDmooqNccHyKREESwAkMMdvPrhiCEa0Q= Original-Received: by 10.229.227.202 with SMTP id jb10mr2619066qcb.72.1319534807402; Tue, 25 Oct 2011 02:26:47 -0700 (PDT) Original-Received: by 10.229.215.81 with HTTP; Tue, 25 Oct 2011 02:26:47 -0700 (PDT) In-Reply-To: <4EA5B147.3060805@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.216.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: 0bFMVqMDS - df50f51d1408 - 20111025 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:71933 Archived-At: On Mon, Oct 24, 2011 at 20:41, Hans Hagen wrote: > On 24-10-2011 19:41, Mojca Miklavec wrote: >> >> Hello, >> >> The following code >> >> \setuplabeltext[test=] >> test is \doifemptyelse{\labeltext{test}}{empty}{not empty} >> >> doesn't work as intended for the reasons that I approximately >> understand (not exactly, but I understand that there might be a lot of >> weird stuff returned when I ask for labeltext). However I have no idea >> how to check if text is empty or not. >> >> As an exception :) :) :), MKIV hints should be highly appreciated and >> enough for this particular application. > > an empty test is always somewhat special as there can be an unexpandable > macro inside that eventually expands to nothing > > you can try \doiftextelse instead Thank you very much. This works fine. This should probably be added to http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions at least (possibly to reference next to labels as well), but I'm not sure how to describe it. Mojca ___________________________________________________________________________________ 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 ___________________________________________________________________________________