From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76191 Path: news.gmane.org!not-for-mail From: "Rogers, Michael K" Newsgroups: gmane.comp.tex.context Subject: Re: atpage || number comparing Date: Tue, 15 May 2012 13:30:36 +0000 Message-ID: References: <20120515142830.535eb5e7@freenet.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1337088658 5291 80.91.229.3 (15 May 2012 13:30:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 May 2012 13:30:58 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 15 15:30:55 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SUHq2-0003Pr-Fr for gctc-ntg-context-518@m.gmane.org; Tue, 15 May 2012 15:30:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 68993101E4; Tue, 15 May 2012 15:30:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9F2IqCsW3wMs; Tue, 15 May 2012 15:30:51 +0200 (CEST) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C6F47101E0; Tue, 15 May 2012 15:30:51 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 230C7101E0 for ; Tue, 15 May 2012 15:30:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CFX5bSrveO0o for ; Tue, 15 May 2012 15:30:44 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id C1A30101DF for ; Tue, 15 May 2012 15:30:44 +0200 (CEST) Original-Received: from ws-mr3.cc.emory.edu (ws-mr3.cc.emory.edu [170.140.50.233]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q4FDUgiR027982 for ; Tue, 15 May 2012 15:30:43 +0200 Original-Received: from e14edge1n.Emory.Edu (emoryfloatdmz.cc.emory.edu [170.140.52.254]) by ws-mr3.cc.emory.edu (8.13.8/8.13.1) with ESMTP id q4FDUb2n007969 for ; Tue, 15 May 2012 09:30:37 -0400 Original-Received: from E14CH2N.Enterprise.emory.net (10.240.8.114) by e14edge1n.Emory.Edu (170.140.52.18) with Microsoft SMTP Server (TLS) id 14.2.283.3; Tue, 15 May 2012 09:30:37 -0400 Original-Received: from E14MBX20N.Enterprise.emory.net ([fe80::e9ea:8c9d:f94e:7cd3]) by e14ch2n.Enterprise.emory.net ([::1]) with mapi id 14.02.0283.003; Tue, 15 May 2012 09:30:36 -0400 Thread-Topic: [NTG-context] atpage || number comparing Thread-Index: AQHNMparBYl+wAl2k02H4+nl7SrLCJbLG7GA In-Reply-To: <20120515142830.535eb5e7@freenet.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [170.140.30.131] Content-ID: <77819876D583A84D8D13A6F5D7C4C7F0@Enterprise.emory.net> X-Emory-MailScanner-Information: Please contact the ISP for more information X-Emory-MailScanner-ID: q4FDUb2n007969 X-Emory-MailScanner: Found to be clean X-Emory-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.01, required 8, autolearn=disabled, T_RP_MATCHES_RCVD -0.01) X-Emory-MailScanner-From: mroge02@emory.edu X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=170.140.50.233; country=US; region=GA; city=Atlanta; postalcode=30322; latitude=33.7952; longitude=-84.3248; metrocode=524; areacode=404; http://maps.google.com/maps?q=33.7952,-84.3248&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03HaduGwi - 3cb08cbbb593 - 20120515 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 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:76191 Archived-At: Hi, I'm a neophyte using last year's TeXLive context. An expert can probably improve my answer. Does this work for you?: \def\atPage[#1]% {\doifnot{\doifreferencefoundelse{#1}{\currentreferencepage}{?}}{\currentpage}% {\at[#1]}% } I adapted it from code in strc-ref.mkiv. The \doifreferencefoundelse seems to set up \currentreferencepage properly. I don't understand it any deeper than that. As for testing for adjacent pages, TeX has count registers (through \newcount) and ConTeXt has counters (see wiki). In TeX one can do arithmetic on registers with \advance, \multiply, \divide and test results with \ifnum, \ifodd. One can do some arithmetic with ConTeXT counters, but I haven't figured it all out yet; and of course, one can use Lua. Michael On May 15, 2012, at 8:28 AM, Peter Schorsch wrote: > Hi, > > it tried to do a \atpage command that results > a) some page => nothing > b) different page => pagenumber with some text (e.g. "auf Seite XY") > > \def\atPage[#1]% > {\doifnot{\at[#1]}{\currentpage}% > {\at[#1]}% > } > > My problem with this is, that the \doifnot always results as not equal; > it is like the types mismatch as if I exchange \at[#1] with a pure > number the comparing works. If so, how can the types be corrected? > > Additionally - if possible - I would like to add case that the referred > page is on the other page but in duplex mode adjacent to the actual > page. Is that possible to do this? I unluckily dont know how to make > working simple calculation in tex code. > > To be complete I found in the file strc-ref.mkiv some notes about a > planed \atpage command: > > %D A still very rudimentary|/|experimental forward|/|backward > %D reference mechanism is provided by the macro \type{\atpage}: > %D > %D \starttyping > %D ... \somewhere{backward text}{forward text}[someref] ... > %D ... \atpage[someref] ... > %D \stoptyping > %D > %D In future versions there will be more sophisticated > > % 0 = no page reference > % 1 = same page > % 2 = preceding page > % 3 = following page > % 4 = backward, same page (todo) > % 5 = forward, same page (todo) > > But that level of the ambient tex is still out of my scope. > > Thanks > P. > ___________________________________________________________________________________ > 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-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ ________________________________ This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments). ___________________________________________________________________________________ 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-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________