From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86392 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \doifemptyelse Date: Thu, 20 Feb 2014 23:23:24 +0100 Message-ID: References: <53066196.1060602@gmx.es> <3209BA49-0315-4A77-A57C-1D9CED9C58B7@gmail.com> <53067D34.4020903@gmx.es> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1392935015 3336 80.91.229.3 (20 Feb 2014 22:23:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Feb 2014 22:23:35 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Feb 20 23:23:44 2014 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 1WGc1w-0003Wp-B3 for gctc-ntg-context-518@m.gmane.org; Thu, 20 Feb 2014 23:23:44 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9B724101EE; Thu, 20 Feb 2014 23:23:43 +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 4yhfIHQBd6w1; Thu, 20 Feb 2014 23:23:41 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 9C423101E6; Thu, 20 Feb 2014 23:23:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 33827101E6 for ; Thu, 20 Feb 2014 23:23: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 qyi67cpHAglP for ; Thu, 20 Feb 2014 23:23:39 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 37245101E2 for ; Thu, 20 Feb 2014 23:23:29 +0100 (CET) Original-Received: from mail-bk0-x22f.google.com (mail-bk0-x22f.google.com [IPv6:2a00:1450:4008:c01::22f]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s1KMcX9e030150 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 20 Feb 2014 23:38:33 +0100 Original-Received: by mail-bk0-f47.google.com with SMTP id d7so814353bkh.34 for ; Thu, 20 Feb 2014 14:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=s3nFrzA4ClC7m8umJc17CwIrUxLdvYcZH3EhDUt8jP4=; b=w/sIkWmPywYowcQj1ysUZZwjO169lNpgDAXmgqFMEV0UeqXbR9Kiof/6yE36YIB4F6 nyhsgDvBEEcr/nD1BPxxrlmmTUlfFFNZu9rvyQyhDTAry7YVzxTpTsnU64weeZxERsEt k16WQpp2VT07+sOygdplGOOMxAD3duUROzLQ0LbP5ISpW5ZAVb7Xlhdj4zEnGqT2v0+3 3wZVEIzSk65Kt+og+X+HUaVDdo8h+SYnJLSh6/O9EEoLi20kRsJHFhOo8tiZ4cHrEr1+ dKPMRvKx5EmYREdyymXQEs5bi3m0FFB39iVzfwFgp8Sv+kvMdmag4n1E5Th/BDISor1j 9qBA== X-Received: by 10.204.102.7 with SMTP id e7mr1212036bko.84.1392935008451; Thu, 20 Feb 2014 14:23:28 -0800 (PST) Original-Received: from keima.localdomain (x2f21ea6.dyn.telefonica.de. [2.242.30.166]) by mx.google.com with ESMTPSA id dj6sm4939277bkc.5.2014.02.20.14.23.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 14:23:26 -0800 (PST) In-Reply-To: <53067D34.4020903@gmx.es> X-Mailer: Apple Mail (2.1827) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:4008:c01::22f; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01LsKCxkr - 103ee473fd07 - 20140220 (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:86392 Archived-At: Am 20.02.2014 um 23:09 schrieb Pablo Rodriguez : > On 02/20/2014 09:39 PM, Wolfgang Schuster wrote: >> Am 20.02.2014 um 21:12 schrieb Pablo Rodriguez: >>> [...] >>> How can I make the first conditional work? >> = >> You can=92t, markings are only reliable when you use them in the >> header of footer of the page. >> = >> To access the values of a heading you can use the \structurevariable >> and \namedstructurevariable commands. > = > Many thanks for your reply, Wolfgang. > = > My question was about headers, but I didn=92t mention it to make a shorte= r sample. In this case this was a important part for the solution because it makes a = difference when you use \getmarking in \setupheadertexts or in the text. > The code now is the following: > = > \setupheadertexts[\hfill\namedstructurevariable{chapter}{title}\hfill] > [] [] > [\hfill\doifsomethingelse{\namedstructurevariable{section}{title}} > {\namedstructurevariable{section}{title}} > {\namedstructurevariable{chapter}{title}}\hfill] > = > = > Only a minor detail: is there a more proper way to center both headings? You can use the simple version of \setupheadertexts and use \doifoddpageelse to check whether you=92re on a left or right page. When you make a test for= content of a \getmarking command you have to use \doiftext because the \doifempty e= tc. checks don=92t work in this case. \startsetups[header] \doifoddpageelse { \getmarking[chapter] } { \doiftextelse { \getmarking[section] } { \getmarking[section] } { \getmarking[chapter] } } \stopsetups \setupheadertexts[\directsetup{header}] \setupfootertexts[pagenumber] \starttext \chapter{Chapter A} \page \chapter{Chapter B} \page \dorecurse{5} {\chapter{Chapter #1} \dorecurse{10} {\section{Section #1.##1} \dorecurse{3}{\input knuth\par}}} \stoptext Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________