<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On 26 Jul 2014, at 10:43, Hans Hagen <<a href="mailto:pragma@wxs.nl">pragma@wxs.nl</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On 7/25/2014 4:31 PM, Gerben Wierda wrote:<br><blockquote type="cite">Thanks all for the discussion. As a simple user, I think I must pass. All this complexity in my document text and setup is too much trouble and it seems risky (wjhat am I going to break?). Far less work to do a small check at the end.<br></blockquote><br>Well, that kind of decisions demand injecting a node so there could be potential interference (as with more mechanisms that carry status info around for a second pass).<br><br>Anyway, maybe someone else benefits from the extension.<br><br><blockquote type="cite">What I was looking for was something simple that made for instance \at{page][foo] conditional, e.g.<br><br>\conditionalat[when]{page}[foo]<br><br>with ‘when’ is something like<br><span class="Apple-tab-span" style="white-space: pre;">     </span>always<br><span class="Apple-tab-span" style="white-space: pre;">  </span>onpage<br><span class="Apple-tab-span" style="white-space: pre;">  </span>offpage<br><span class="Apple-tab-span" style="white-space: pre;"> </span>onspread<br><span class="Apple-tab-span" style="white-space: pre;">        </span>offspread<br><span class="Apple-tab-span" style="white-space: pre;">       </span>never<br><br>Typing \conditionalat instead of \at is what I as a simpleton user can handle…<br></blockquote><br>\unprotect<br><br>\unexpanded\def\strc_references_conditional#1#2[#3]#4[#5]% {text}[condition][reference]<br> {\doifcheckedpagestate{#5}%<br>    {\doifelse{#3}\v!precedingpage{#1{#2}[#5]}\ignorespaces}%<br>    {\doifelse{#3}\v!hencefore    {#1{#2}[#5]}\ignorespaces}%<br>    {\doifelse{#3}\v!current      {#1{#2}[#5]}\ignorespaces}%<br>    {\doifelse{#3}\v!hereafter    {#1{#2}[#5]}\ignorespaces}%<br>    {\doifelse{#3}\v!followingpage{#1{#2}[#5]}\ignorespaces}%<br>    {}}<br><br>\unexpanded\def\conditionalat   {\strc_references_conditional\at}<br>\unexpanded\def\conditionalin   {\strc_references_conditional\in}<br>\unexpanded\def\conditionalabout{\strc_references_conditional\about}<br><br>\protect<br><br>But I'll not enable it to the code as it's not used anyway (maybe sometime a module).<br></div></blockquote><div><br></div><div>I’ve tried to add this to my environment and product file, but even without using it, it ends in an error:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(213, 59, 211);">(/usr/local/texlive/2014/texmf-dist/tex/context/base/spec-tpd.mkii</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(213, 59, 211);">specials        : loading definition file fdf</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(213, 59, 211);">(/usr/local/texlive/2014/texmf-dist/tex/context/base/spec-fdf.mkii))</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(213, 59, 211);">! Undefined control sequence.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(213, 59, 211);">l.5  {\doifcheckedpagestate</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">                           <span style="color: #d53bd3">{#5}%</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(213, 59, 211);">?</div><div><br></div></div><div>G</div><br><blockquote type="cite"><div style="font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><blockquote type="cite">G<br><br>On 25 Jul 2014, at 13:06, Hans Hagen <<a href="mailto:pragma@wxs.nl">pragma@wxs.nl</a>> wrote:<br><br><blockquote type="cite">On 7/24/2014 2:03 PM, Otared Kavian wrote:<br><blockquote type="cite">Hi,<br><br>Thanks for your attention, Wolfgang: indeed removing<br><span class="Apple-tab-span" style="white-space: pre;">      </span>\analyzecurrentreference<br>from your example allows mkiv to typeset correctly and obtain the expected result.<br></blockquote><br><blockquote type="cite">....<br></blockquote><br>yet another sparsely documented feature ... in beta:<br><br>% tests/mkiv/pagestate-001.tex<br><br>\useMPlibrary[dum]<br><br>\setuppagenumbering<br> [alternative=doublesided]<br><br>% new: \setupreferencing[doublesided=no]<br><br>% old: \somewhere{backward}{foreward}[label]<br>% new: \someplace{preceding}{backward}{current}{foreward}{following}[label]<br>% old: \atpage[#label]<br>% new: \doifcheckedpagestate{label}{preceding}{backward}{current}{foreward}{following}{otherwise}<br><br>\starttext<br><br>\dorecurse {20} {<br>   \placefigure<br>     [here]<br>     [fig:#1]<br>     {}<br>     {\externalfigure[dummy]}<br>   \dorecurse {20} {<br>       ##1: \atpage[fig:##1] /<br>       \doifcheckedpagestate{fig:##1}<br>        {preceding}<br>        {backward}<br>        {current}<br>        {foreward}<br>        {following}<br>        {otherwise}<br>   }<br>}<br><br>\stoptext<br><br>if okay, then it's something to wikify ... should \setupreferencing[doublesided=no] be default? (currently yes i.e. spread aware)<br><br>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<br><br>Hans<br><br><br>-----------------------------------------------------------------<br>                                         Hans Hagen | PRAGMA ADE<br>             Ridderstraat 27 | 8061 GH Hasselt | The Netherlands<br>   tel: 038 477 53 69 | voip: 087 875 68 74 | <a href="http://www.pragma-ade.com">www.pragma-ade.com</a><br>                                            | <a href="http://www.pragma-pod.nl">www.pragma-pod.nl</a><br>-----------------------------------------------------------------<br>___________________________________________________________________________________<br>If your question is of interest to others as well, please add an entry to the Wiki!<br><br>maillist : <a href="mailto:ntg-context@ntg.nl">ntg-context@ntg.nl</a> / <a href="http://www.ntg.nl/mailman/listinfo/ntg-context">http://www.ntg.nl/mailman/listinfo/ntg-context</a><br>webpage  : <a href="http://www.pragma-ade.nl">http://www.pragma-ade.nl</a> / <a href="http://tex.aanhet.net">http://tex.aanhet.net</a><br>archive  : <a href="http://foundry.supelec.fr/projects/contextrev/">http://foundry.supelec.fr/projects/contextrev/</a><br>wiki     : <a href="http://contextgarden.net">http://contextgarden.net</a><br>___________________________________________________________________________________<br></blockquote><br>___________________________________________________________________________________<br>If your question is of interest to others as well, please add an entry to the Wiki!<br><br>maillist : <a href="mailto:ntg-context@ntg.nl">ntg-context@ntg.nl</a> / <a href="http://www.ntg.nl/mailman/listinfo/ntg-context">http://www.ntg.nl/mailman/listinfo/ntg-context</a><br>webpage  : <a href="http://www.pragma-ade.nl">http://www.pragma-ade.nl</a> / <a href="http://tex.aanhet.net">http://tex.aanhet.net</a><br>archive  : <a href="http://foundry.supelec.fr/projects/contextrev/">http://foundry.supelec.fr/projects/contextrev/</a><br>wiki     : <a href="http://contextgarden.net">http://contextgarden.net</a><br>___________________________________________________________________________________<br><br></blockquote><br><br>--<span class="Apple-converted-space"> </span><br><br>-----------------------------------------------------------------<br>                                         Hans Hagen | PRAGMA ADE<br>             Ridderstraat 27 | 8061 GH Hasselt | The Netherlands<br>   tel: 038 477 53 69 | voip: 087 875 68 74 |<span class="Apple-converted-space"> </span><a href="http://www.pragma-ade.com/">www.pragma-ade.com</a><br>                                            |<span class="Apple-converted-space"> </span><a href="http://www.pragma-pod.nl/">www.pragma-pod.nl</a><br>-----------------------------------------------------------------<br>___________________________________________________________________________________<br>If your question is of interest to others as well, please add an entry to the Wiki!<br><br>maillist :<span class="Apple-converted-space"> </span><a href="mailto:ntg-context@ntg.nl">ntg-context@ntg.nl</a><span class="Apple-converted-space"> </span>/<span class="Apple-converted-space"> </span><a href="http://www.ntg.nl/mailman/listinfo/ntg-context">http://www.ntg.nl/mailman/listinfo/ntg-context</a><br>webpage  :<span class="Apple-converted-space"> </span><a href="http://www.pragma-ade.nl/">http://www.pragma-ade.nl</a><span class="Apple-converted-space"> </span>/<span class="Apple-converted-space"> </span><a href="http://tex.aanhet.net/">http://tex.aanhet.net</a><br>archive  :<span class="Apple-converted-space"> </span><a href="http://foundry.supelec.fr/projects/contextrev/">http://foundry.supelec.fr/projects/contextrev/</a><br>wiki     :<span class="Apple-converted-space"> </span><a href="http://contextgarden.net/">http://contextgarden.net</a><br>___________________________________________________________________________________</div></blockquote></div><br></body></html>