From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/65314 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Conditional cross references to floats Date: Mon, 17 Jan 2011 16:22:03 +0100 Message-ID: <5FD1218A-B2C4-41E6-82F7-9285F1677EF7@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1295279325 9919 80.91.229.12 (17 Jan 2011 15:48:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 17 Jan 2011 15:48:45 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 17 16:48:40 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 1PerJv-0004JW-Pe for gctc-ntg-context-518@m.gmane.org; Mon, 17 Jan 2011 16:48:39 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C970BCA9F7; Mon, 17 Jan 2011 16:48:38 +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 mJhjGPaMCZO9; Mon, 17 Jan 2011 16:48:27 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9D24ECA9C5; Mon, 17 Jan 2011 16:48:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 63E4DC9A8A for ; Mon, 17 Jan 2011 16:48:25 +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 ypkh+G1iBwf9 for ; Mon, 17 Jan 2011 16:48:14 +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 91F79CA95C for ; Mon, 17 Jan 2011 16:48:14 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p0HFmDvi010875 for ; Mon, 17 Jan 2011 16:48:13 +0100 Original-Received: by fxm12 with SMTP id 12so6297736fxm.14 for ; Mon, 17 Jan 2011 07:48:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to :x-mailer; bh=nL6EH97r5f1SBQmLamQwcr0f9SjntV8i1wOme9hLx1c=; b=GztwwIIClNcpazWgOC17DHOKsd2+ll57ZJXcIhfvzK4TneyU4T4n/e0iW9e0XhcI+4 RnEWvFD6Yc1xGga13ILEoEyEeK50GAGkkCjhKNet6Ds2x/ksyjtZEpt/oLr0IXLzTEm1 NyJSjjdKbMhblSezOI9CgsGGgwmXNAtQGs9K4= DomainKey-Signature: a=rsa-sha1; c=nofws; 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; b=doE0u80KDrCB5lt1h1AzGrVvMuawN3OvVViztaX1NYAg4U1NTpkSiM/EMxtrpQAeES Kk4GBfIDrIO/lYTtAoXVedJLhNrRtcjftm3sJO5oKb8yjTpTHEW5Qq+GDLs98YdzAnHO BInX6EpT7bb0awv4LPqdObCQK6kDKUuuy5p5g= Original-Received: by 10.223.71.197 with SMTP id i5mr4891369faj.127.1295279293078; Mon, 17 Jan 2011 07:48:13 -0800 (PST) Original-Received: from [192.168.2.23] (p5B294F88.dip.t-dialin.net [91.41.79.136]) by mx.google.com with ESMTPS id n15sm1690815fam.36.2011.01.17.07.48.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 Jan 2011 07:48:12 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.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: 03DUDMdcO - e5779835702f - 20110117 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 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:65314 Archived-At: Am 16.01.2011 um 20:58 schrieb Robert Blackstone: > Hi all, > = > I wonder if it is already possible to perform the following task: > = > I have to typeset documents that contain many pictures of various > sizes. Due to lack of space, some may pictures may not appear on the > page on which they are discussed. And also in the course of revising > the document, adding text may push them to another page. Therefore I > always refer to every picture with \in and \at. On the other hand, > changing or deleting text may unexpectedly land them on the correct > page. > = > So sometimes it may happen that the reader, for instance on page 23, > will be referred to a figure on page 23, which looks rather silly. > = > Is there a trick to let ConTeXt automatically omit the reference when > the picture happens to appear on the correct page (or change the > reference to =AB on this page =BB). In other words, can one make a sort of > conditional reference that only mentions the page if it is not the > present page? ConTeXt has a \atpage and a \somewhere command but none of them can be used to omit the reference when the float and the reference are on the same page but it=92s not impossible. As you can see from this example: \starttext 1. \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencep= agestate\relax\or this page\or above\or below\fi}{} \page 2. \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencep= agestate\relax\or this page\or above\or below\fi}{} \placefigure[force][test]{First}{\framed{One}} 3. \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencep= agestate\relax\or this page\or above\or below\fi}{} \page 4. \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencep= agestate\relax\or this page\or above\or below\fi}{} \stoptext one can set conditional texts but these are internal macros (which can change) and meant for users. 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 ___________________________________________________________________________= ________