From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73394 Path: news.gmane.org!not-for-mail From: Willi Egger Newsgroups: gmane.comp.tex.context Subject: Re: CLD: setupheadertexts Date: Mon, 26 Dec 2011 13:49:57 +0100 Message-ID: <24888C9C-262E-4F25-9E79-357495A3F805@boede.nl> 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> <5D2CE66A-5362-42F8-AA9F-221BA3D0CD05@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1324903830 22377 80.91.229.12 (26 Dec 2011 12:50:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2011 12:50:30 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 26 13:50:24 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 1RfA0U-00023i-4q for gctc-ntg-context-518@m.gmane.org; Mon, 26 Dec 2011 13:50:22 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7FA0CCB1A9; Mon, 26 Dec 2011 13:50:20 +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 EiQIimx7f778; Mon, 26 Dec 2011 13:50:17 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7B1FECB1A2; Mon, 26 Dec 2011 13:50:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CC0EECB1A2 for ; Mon, 26 Dec 2011 13:50:15 +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 4+TWpWqx9S5p for ; Mon, 26 Dec 2011 13:50:00 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id D0D5DCB19E for ; Mon, 26 Dec 2011 13:50:00 +0100 (CET) Original-Received: from mars.digitpaint.nl (mars.digitpaint.nl [83.98.197.63]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pBQCnxrX021795 for ; Mon, 26 Dec 2011 13:50:00 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by mars.digitpaint.nl (Postfix) with ESMTP id 082E01B43E2 for ; Mon, 26 Dec 2011 13:49:53 +0100 (CET) Original-Received: from mars.digitpaint.nl ([127.0.0.1]) by localhost (mail.digitpaint.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FEwvqn7ywIRe for ; Mon, 26 Dec 2011 13:49:52 +0100 (CET) Original-Received: from willis-computer.fritz.box (a83-161-249-79.adsl.xs4all.nl [83.161.249.79]) by mars.digitpaint.nl (Postfix) with ESMTPA id C77281B43E1 for ; Mon, 26 Dec 2011 13:49:52 +0100 (CET) In-Reply-To: <5D2CE66A-5362-42F8-AA9F-221BA3D0CD05@googlemail.com> X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=83.98.197.63; country=NL; latitude=52.5000; longitude=5.7500; http://maps.google.com/maps?q=52.5000,5.7500&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0bGdMNX4m - 218405802766 - 20111226 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:73394 Archived-At: Hello Wolfgang, On 25 Dec 2011, at 10:21, Wolfgang Schuster wrote: > = > 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 a= rguments and I was curious about how this would be solved in context/setuph= eadertexts. >> I will look into your solution. I am not sure whether it will fit into t= he cld-project. > = > = > Can=92t you do stuff like this in a style file where you can use TeX macr= os. A alternative to the \doifoddpageelse macro is to test whether the page= counter is or even with the math.odd function. Hm, the struggle is, that the given example is very much simpler than in th= e real environment. There I need to change the setupheadertexts according t= o events being determined in lua-calculations. Therefore I doubt whether I = will be able to use a style-file with TeX-macros. = > \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 This is indeed a very good approach. I will try it! Thank you very much for= your support! > = > Wolfgang Willi > = > _________________________________________________________________________= __________ > 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-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________