[NTG-context] Leave out reference to page if on the same page?

Rik Kabel context at rik.users.panix.com
Fri Jul 25 16:34:27 CEST 2014


On 2014-07-25 07:06, Hans Hagen wrote:
> On 7/24/2014 2:03 PM, Otared Kavian wrote:
>> Hi,
>>
>> Thanks for your attention, Wolfgang: indeed removing
>>     \analyzecurrentreference
>> from your example allows mkiv to typeset correctly and obtain the 
>> expected result.
>
> > ....
>
> yet another sparsely documented feature ... in beta:
>
> % tests/mkiv/pagestate-001.tex
>
> \useMPlibrary[dum]
>
> \setuppagenumbering
>   [alternative=doublesided]
>
> % new: \setupreferencing[doublesided=no]
>
> % old: \somewhere{backward}{foreward}[label]
> % new: 
> \someplace{preceding}{backward}{current}{foreward}{following}[label]
> % old: \atpage[#label]
> % new: 
> \doifcheckedpagestate{label}{preceding}{backward}{current}{foreward}{following}{otherwise}
>
> \starttext
>
> \dorecurse {20} {
>     \placefigure
>       [here]
>       [fig:#1]
>       {}
>       {\externalfigure[dummy]}
>     \dorecurse {20} {
>         ##1: \atpage[fig:##1] /
>         \doifcheckedpagestate{fig:##1}
>          {preceding}
>          {backward}
>          {current}
>          {foreward}
>          {following}
>          {otherwise}
>     }
> }
>
> \stoptext
>
> if okay, then it's something to wikify ... should 
> \setupreferencing[doublesided=no] be default? (currently yes i.e. 
> spread aware)
>
> keep in mind that this kind of functionality once it kicks in (is 
> used) can result in a few more runs to get thing right and that 
> there's always the danger of oscillation as the text injected is 
> dependent on the situation
>
> Hans

This looks very promising. When I test it with today's beta, I see that 
"current" is set in some iterations, but never shows up in the final 
version of the page, so references on the same page always come out as 
"backward" or "forward".

I would think that the default should match the default for 
\setuppagenumbering[alternative=], and perhaps be tied to that.

-- 
Rik Kabel



More information about the ntg-context mailing list