I’m trying to create something (like varioref in latex) that suppresses \at output if the referenced item is on the current page. The main decision point is with \doifelse{\at[ref2]}{\rawcountervalue[page]}{ same page }{ different page } no matter what I try (expdoifelse and other ways to get the current page) the values never match. \doifelse{\at[ref2]}{\at[ref1]}….. (ref1 and ref2 are on the same page but don’t match \doifelse{\rawcountervalue[page]}{1}… it is page 1 but always fails. The only match I get is with \doifelse{\at[ref2]}{\at[ref2]}…. which is pretty useless Presumably I’m doing something stupid. Or do i have to go for a much lower level approach
Aidan Nichol mailto:aidan@nicholware.co.uk 24. Februar 2016 um 12:47 I’m trying to create something (like varioref in latex) that suppresses \at output if the referenced item is on the current page. The main decision point is with
\doifelse{\at[ref2]}{\rawcountervalue[page]}{ same page }{ different page }
no matter what I try (expdoifelse and other ways to get the current page) the values never match.
\doifelse{\at[ref2]}{\at[ref1]}….. (ref1 and ref2 are on the same page but don’t match
\doifelse{\rawcountervalue[page]}{1}… it is page 1 but always fails.
The only match I get is with
\doifelse{\at[ref2]}{\at[ref2]}…. which is pretty useless
Presumably I’m doing something stupid. Or do i have to go for a much lower level approach \startsetups[referenceformat:thispage] \doifelse{\filterreference{page}}{\rawcountervalue[userpage]} {{\tttf !?}} {\filterreference{page}} \stopsetups
\definereferenceformat[thispage][setups=referenceformat:thispage] \starttext \chapter[one]{First chapter} First: \thispage[one] Second: \thispage[two] \chapter[two]{Second chapter} First: \thispage[one] Second: \thispage[two] \stoptext Wolfgang
participants (2)
-
Aidan Nichol
-
Wolfgang Schuster