![](https://secure.gravatar.com/avatar/b12df59411515e6737a4d3b35c3ee642.jpg?s=120&d=mm&r=g)
Dear all, how can one compare the locations of two pagereferences for conditional processing? I tried it with this (mkiv, 2011.01.10): \starttext \pagereference[page:a]bla \pagereference[page:b]bla \at[page:a] % 1 \at[page:b] % also 1 \doifsamestringelse{\at[page:a]}{\at[page:b]}{same page}{different page} % yet, the else-branch gets executed \stoptext Of course this is clumsy, but although I tried to peek into strc-ref I couldn't quite sort out how to directly access the results of \at. Thanks Daniel
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 02.03.2011 um 18:05 schrieb Daniel Schopper:
Dear all, how can one compare the locations of two pagereferences for conditional processing? I tried it with this (mkiv, 2011.01.10):
There is nothing predefined in the core but it’s not so hard to write your own command: \def\doifelsesamepagereference#1#2% {\doifelse {\doifreferencefoundelse{#1}{\currentreferencepage}{-}} {\doifreferencefoundelse{#2}{\currentreferencepage}{+}}} \starttext A\pagereference[page:a]\par B\pagereference[page:b] \page[yes] C\pagereference[page:c] A+B: \doifelsesamepagereference{page:a}{page:b}{YES}{NO} B+C: \doifelsesamepagereference{page:b}{page:c}{YES}{NO} \stoptext Wolfgang
participants (2)
-
Daniel Schopper
-
Wolfgang Schuster