From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88193 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: Leave out reference to page if on the same page? Date: Wed, 23 Jul 2014 20:01:06 +0200 Message-ID: References: <9B2F0029-A808-473D-99C1-D3CC9AAE5A7C@rna.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="===============0859188470==" X-Trace: ger.gmane.org 1406138496 29022 80.91.229.3 (23 Jul 2014 18:01:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jul 2014 18:01:36 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 23 20:01:31 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XA0r4-00087W-9H for gctc-ntg-context-518@m.gmane.org; Wed, 23 Jul 2014 20:01:30 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BCAF9102B6 for ; Wed, 23 Jul 2014 20:01:29 +0200 (CEST) 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 ufnCMCYmbDna for ; Wed, 23 Jul 2014 20:01:29 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 1BFEB10227 for ; Wed, 23 Jul 2014 20:01:21 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 852AC101EE for ; Wed, 23 Jul 2014 20:01:17 +0200 (CEST) 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 lBnc3+baTxF7 for ; Wed, 23 Jul 2014 20:01:12 +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 4EF1D101EC for ; Wed, 23 Jul 2014 20:01:12 +0200 (CEST) Original-Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s6NI1AYd018172 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 23 Jul 2014 20:01:11 +0200 Original-Received: by mail-wg0-f44.google.com with SMTP id m15so1545645wgh.15 for ; Wed, 23 Jul 2014 11:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=usBfh9NYPoVIGHGksq5d0FQGvOIVNsPExA0RED6OrQU=; b=fiIIJJ/NvRCDaF/EqcXBBxdQZ9xgvBLeIo3/tPf/n/fNRzY7wWHdH83t4G6XpeHFpI cSX8MWs3saclZTitQ7kkfFRQY6HkBKrbVI+DzJBE3WQ/NWltn/7bhsQIHD1Hux/NHfkq QLv46NtFXTs5DyoY/9orOCT/2F5LSebgFDawxm2NiqlhIUxqZBZA64yFhGmb+8PbFeEQ bcaF+gBR8JUuahudz/5ZNh94UIPPt4ygserAUqQeYs98gf1j/Xeoz06DIauwt34HLniU PAkzK6xVwl5MhQ3Qb3ILSfrVuY9I2M75R4Q+08YbXSD9RaEbCSLO5ErQhlsSU7TfGui0 ytSw== X-Received: by 10.180.87.199 with SMTP id ba7mr5135973wib.49.1406138470846; Wed, 23 Jul 2014 11:01:10 -0700 (PDT) Original-Received: from [192.168.0.101] (lns-bzn-53-82-65-47-208.adsl.proxad.net. [82.65.47.208]) by mx.google.com with ESMTPSA id cd1sm8164425wjc.19.2014.07.23.11.01.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 11:01:09 -0700 (PDT) In-Reply-To: <9B2F0029-A808-473D-99C1-D3CC9AAE5A7C@rna.nl> X-Mailer: Apple Mail (2.1878.6) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c00::22c; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03MtS1bQq - adac0fe8c21c - 20140723 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:88193 Archived-At: --===============0859188470== Content-Type: multipart/alternative; boundary="Apple-Mail=_5268D04E-EC55-443A-9A06-F9AEB05DBC38" --Apple-Mail=_5268D04E-EC55-443A-9A06-F9AEB05DBC38 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi,=20 In my ConTeXt archives I found the following example from a discussion = on the mailing list: Wolfgang S. gave an answer which may help you: Best regards: OK %%%%%% begin test-ref.tex % %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\referencepag= estate\relax\or this page\or above\or below\fi}{} \page 2. = \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencepag= estate\relax\or this page\or above\or below\fi}{} \placefigure[force][test]{First}{\framed{One}} 3. = \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencepag= estate\relax\or this page\or above\or below\fi}{} \page 4. = \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencepag= estate\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 %%%% end test-ref.tex On 23 Jul 2014, at 17:46, Gerben Wierda wrote: > Suppose I have this fragment: >=20 > is shown in \in{figure}[foo] on \at{page}[foo]. > \placefigure > [] > [foo] >=20 > I would like to leave the fragment =93on \at{page}[foo]=94 out of the = text if the figure ends up on the same page as the \at. Is that doable = or is this a matter of manual tweaking at the end? >=20 > G >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_5268D04E-EC55-443A-9A06-F9AEB05DBC38 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 Hi, 

In my ConTeXt archives = I found the following example from a discussion on the mailing list: = Wolfgang S. gave an answer which may help you:
Best regards: = OK

%%%%%% begin = test-ref.tex

%
%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\referencepag= estate\relax\or this page\or above\or = below\fi}{}

\page

2. = \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencepag= estate\relax\or this page\or above\or = below\fi}{}

\placefigure[force][test]{First}{\fra= med{One}}

3. = \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencepag= estate\relax\or this page\or above\or = below\fi}{}

\page

4. = \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencepag= estate\relax\or this page\or above\or = below\fi}{}

\stoptext

on= e can set conditional texts but these are internal = macros
(which can change) and meant for = users.

Wolfgang
%%%% end = test-ref.tex

On 23 Jul 2014, at 17:46, Gerben = Wierda <gerben.wierda@rna.nl> = wrote:

Suppose I have this = fragment:

is shown in \in{figure}[foo] on = \at{page}[foo].
\placefigure
[]
= [foo]

I would like to leave the = fragment =93on = \at{page}[foo]=94 out of the text if the figure ends up on the = same page as the \at. Is that doable or is this a matter of manual = tweaking at the = end?

G

________________= ___________________________________________________________________
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.sup= elec.fr/projects/contextrev/
wiki     : http://contextgarden.net
________= __________________________________________________________________________= _

= --Apple-Mail=_5268D04E-EC55-443A-9A06-F9AEB05DBC38-- --===============0859188470== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0859188470==--