From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76194 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: atpage || number comparing Date: Tue, 15 May 2012 16:44:47 +0200 Message-ID: <4FB26BDF.8040405@wxs.nl> 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"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1337093127 12299 80.91.229.3 (15 May 2012 14:45:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 May 2012 14:45:27 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 15 16:45:25 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 1SUJ08-0000pr-KD for gctc-ntg-context-518@m.gmane.org; Tue, 15 May 2012 16:45:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 29A63101E4; Tue, 15 May 2012 16:45:24 +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 5su5DrICgZ6P; Tue, 15 May 2012 16:45:19 +0200 (CEST) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C3DF9101DF; Tue, 15 May 2012 16:45:19 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 11FAB101DF for ; Tue, 15 May 2012 16:45:19 +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 i6nwVnWz-6JU for ; Tue, 15 May 2012 16:45:15 +0200 (CEST) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 4F220101CF for ; Tue, 15 May 2012 16:45:14 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter1-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q4FEj9MB000303 for ; Tue, 15 May 2012 16:45:14 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 5.3h2) with ESMTP (TLS) id 1332-1713362 for multiple; Tue, 15 May 2012 16:45:07 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: <20120515142830.535eb5e7@freenet.de> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=03; city=Hattem; latitude=52.4724; longitude=6.0696; http://maps.google.com/maps?q=52.4724,6.0696&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07HaeJaqu - a2c2fce1a78e - 20120515 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 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:76194 Archived-At: On 15-5-2012 14:28, 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. that comment can be deleted as \atpage is defined earlier on anyhow, you can use \startbuffer \starttabulate[|l|l|l|l|] \NC one \NC \atpage[one] \NC \somewhere{(see before)}{(see later)}[one] \NC \NR \NC two \NC \atpage[two] \NC \somewhere{(see before)}{(see later)}[two] \NC \NR \NC three \NC \atpage[three] \NC \somewhere{(see before)}{(see later)}[three] \NC \NR \stoptabulate \stopbuffer \starttext \section[one] {One} \getbuffer \page \section[two] {Two} \getbuffer \page \section[three]{Three} \getbuffer \page \stoptext the next variant (same functionality) is somewhat better \unprotect \unexpanded\def\somewhere#1#2#3[#4]% #dummy gobbles space around #2 {\doifreferencefoundelse{#4}% {\strc_references_by_reference_page_state{#4}{\goto{#1}[#4]}{}{\goto{#2}[#4]}} {[#4]}} \protect ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________