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 « on this page »). 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’s not impossible.
%
%As you can see from this example:

\starttext

1. \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencepagestate\relax\or this page\or above\or below\fi}{}

\page

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

\placefigure[force][test]{First}{\framed{One}}

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

\page

4. \doifreferencefoundelse{test}{\analyzecurrentreference\ifcase\referencepagestate\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 <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 “on \at{page}[foo]” 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.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________