From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73390 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: CLD: setupheadertexts Date: Sun, 25 Dec 2011 10:21:16 +0100 Message-ID: <5D2CE66A-5362-42F8-AA9F-221BA3D0CD05@googlemail.com> References: <8B38AF34-57D6-4847-BCAC-AAF271CF8D4A@boede.nl> <4481C234-991A-4B87-BF3B-AECA8D034033@googlemail.com> <5FF321E5-E1F0-4629-B9AE-D70AD662754B@boede.nl> <47F3F7AE-CB70-4895-9FBB-7CF4063CC726@boede.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1324804911 20653 80.91.229.12 (25 Dec 2011 09:21:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 25 Dec 2011 09:21:51 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Dec 25 10:21:44 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 1RekH2-0004rk-9C for gctc-ntg-context-518@m.gmane.org; Sun, 25 Dec 2011 10:21:44 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B9EE7CB1AE; Sun, 25 Dec 2011 10:21:42 +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 yuBQmR2OdMm7; Sun, 25 Dec 2011 10:21:39 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1B7CCCB1A1; Sun, 25 Dec 2011 10:21:39 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 852A0CB1A1 for ; Sun, 25 Dec 2011 10:21:37 +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 0ehx9WaP3MNl for ; Sun, 25 Dec 2011 10:21:25 +0100 (CET) Original-Received: from filter4-nij.mf.surf.net (filter4-nij.mf.surf.net [195.169.124.155]) by balder.ntg.nl (Postfix) with ESMTP id 08926CB199 for ; Sun, 25 Dec 2011 10:21:24 +0100 (CET) Original-Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by filter4-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pBP9LLLT005253 for ; Sun, 25 Dec 2011 10:21:21 +0100 Original-Received: by eekc41 with SMTP id c41so12035273eek.14 for ; Sun, 25 Dec 2011 01:21:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=Xb8LonXf7n1ixFA1fBN4U2lbJCUWeTos6AoHkM97qbE=; b=Cd2ThME/BgiwAsriU5tpdQjNPYolgI3PXyaLp3mnIj1B3dMMs/kBRDsZhZkvl5BVG/ s/vetSZIm6rIF5m2M/ZyV0a1RJvDZb6qehdh+TzT5CwwPxsDbwaLzwVDeHb1K9hJFQGl P+yzmLtol+4IuimtUSJaHp3zEHnkfn4NLKcZg= Original-Received: by 10.213.2.131 with SMTP id 3mr7285020ebj.102.1324804881116; Sun, 25 Dec 2011 01:21:21 -0800 (PST) Original-Received: from [192.168.2.35] (p57AFC69E.dip.t-dialin.net. [87.175.198.158]) by mx.google.com with ESMTPS id t59sm74734991eeh.10.2011.12.25.01.21.18 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Dec 2011 01:21:19 -0800 (PST) In-Reply-To: <47F3F7AE-CB70-4895-9FBB-7CF4063CC726@boede.nl> X-Mailer: Apple Mail (2.1251.1) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.83.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: 04Gdlllsh - a7bfa1757842 - 20111225 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.155 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:73390 Archived-At: Am 24.12.2011 um 18:09 schrieb Willi Egger: > Hi Wolfgang, > = > thank you. > = > The reason why I ask this question is, because \setupheadertexts has 4 ar= guments and I was curious about how this would be solved in context/setuphe= adertexts. > I will look into your solution. I am not sure whether it will fit into th= e cld-project. Can=92t you do stuff like this in a style file where you can use TeX macros= . A alternative to the \doifoddpageelse macro is to test whether the page c= ounter is or even with the math.odd function. \startluacode userdata =3D userdata or { } function userdata.myheadertext(rightpage,leftpage) local rightpage =3D rightpage local leftpage =3D leftpage if not leftpage or leftpage =3D=3D "" then leftpage =3D rightpage end context.setupheadertexts{ function() if math.odd(tex.count["realpageno"]) then context(rightpage) else context(leftpage) end return true end } end = \stopluacode \starttext \ctxlua{userdata.myheadertext("Right page")} \dorecurse{4}{\dontleavehmode\page} \ctxlua{userdata.myheadertext("Right page","Left page")} \dorecurse{4}{\dontleavehmode\page} \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 ___________________________________________________________________________= ________