ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: Hans Hagen <pragma@wxs.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: How do I test for empty labeltext?
Date: Tue, 25 Oct 2011 11:26:47 +0200	[thread overview]
Message-ID: <CALBOmsY+X6hCCzvLk6gv8e1cZ3R91mVoQbQRYQSL7PE9-HQfLA@mail.gmail.com> (raw)
In-Reply-To: <4EA5B147.3060805@wxs.nl>

On Mon, Oct 24, 2011 at 20:41, Hans Hagen <pragma@wxs.nl> 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
___________________________________________________________________________________


  reply	other threads:[~2011-10-25  9:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 17:41 Mojca Miklavec
2011-10-24 18:41 ` Hans Hagen
2011-10-25  9:26   ` Mojca Miklavec [this message]
2011-10-25 10:14     ` Hans Hagen
2011-10-25 16:36     ` Aditya Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALBOmsY+X6hCCzvLk6gv8e1cZ3R91mVoQbQRYQSL7PE9-HQfLA@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).