ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl
Subject: Re: Problem with understanding \doifemptyelse
Date: Sat, 23 Mar 2002 10:55:47 +0100	[thread overview]
Message-ID: <5.1.0.14.1.20020323105011.02e2a220@server-1> (raw)
In-Reply-To: <B3A95C8C-3D87-11D6-A5F5-000A27B468AA@univ-montp3.fr>

At 12:26 PM 3/22/2002 +0100, Gilles Pérez-Lambert wrote:
>Hello,
>
>I'm trying to setup headers in such a manner that on the left pages I have 
>the chapter title and on the right the section one; but if there's no 
>section, I want the chapter one...
>
>I tried:
>%%%%%%%%
>\setupheadertexts
>[][{%
>\inframed[align=middle,frame=off,bottomframe=on,width=\makeupwidth]%
>{\itx\hfill%
>\doifemptyelse{\getmarking[section]}%%% If section header is empty
>{\getmarking[chapter]}% Take the chapter one
>{\getmarking[section]}}% else we take the section header
>}]
>[{\inframed[align=middle,frame=off,bottomframe=on,width=\makeupwidth]{\itx\
>getmarking[chapter]\hfill\null}}][]
>%%%%%%%%
>
>I know I must miss something: \getmarking[section] is surely not that 
>empty when there's nothing but my TeX knowledge is not that deep.

you're right, since \getmarking is doing a couple of things, it's never 
empty (for instance there is the test macro in there), instead use the low 
level fetcher:

\fetchmark[chapter][first]

(in supp-box (texexec --modu --pdf supp-box) you will find macros like 
\doifcontent that you can also use for such purposes)

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


  reply	other threads:[~2002-03-23  9:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-22 11:26 Gilles Pérez-Lambert
2002-03-23  9:55 ` Hans Hagen [this message]
2002-03-25 11:22   ` texexec --module problem (was Re: Problem with understanding\doifemptyelse) Daniel Pittman
2002-03-24  0:30     ` texexec --module problem (was Re: Problem with understanding \doifemptyelse) Hans Hagen
2002-03-25 13:57     ` Patrick Gundlach

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=5.1.0.14.1.20020323105011.02e2a220@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.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).