From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/7435 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Problem with understanding \doifemptyelse Date: Sat, 23 Mar 2002 10:55:47 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20020323105011.02e2a220@server-1> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035397899 19234 80.91.224.250 (23 Oct 2002 18:31:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:31:39 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: Gilles =?iso-8859-1?Q?P=E9rez-Lambert?= In-Reply-To: Xref: main.gmane.org gmane.comp.tex.context:7435 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:7435 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 -------------------------------------------------------------------------