On Mon, 7 May 2012 22:25:37, Wolfgang Schuster
Am 07.05.2012 um 15:03 schrieb Robert Blackstone:
On Mon, May 7, 2012 at 12:00 PM, Hans Hagen
wrote On 6-5-2012 23:18, Robert Blackstone wrote:
Sometimes however the example is placed at the same page as the text discussing it. Is there any trick to adapt the reference to this situation, so that, instead of saying, for instance, "ex. 3.4 on page 12", it just says "ex. 3.4", or "ex. 3.4 below" or even "ex. 3.4 on this page"?
you can try \atpage[ref]
The best way is to define your own command for this.
\starttext
<\somewhere{above}{below}[fig:test]>
\page
<\somewhere{above}{below}[fig:test]>
\placefigure[][fig:test]{Test}{\framed{test}}
\page
<\somewhere{above}{below}[fig:test]>
\stoptext
Wolfgang
Thank you, Wolfgang, for your help. Though this command works perfectly and is nicely adaptable, in the end it does not give me what I would have liked. Perhaps my description of what I want was not clear enough. For me, both commands, \somewhere{}{}[ref] and \atpage[ref], have in common that they are imprecise when I want precision, namely when the float is not at the same page as its reference, and precise when they are in fact redundant, that is, when float and reference are on the same page, where the reader will see it at one glance, whether it is above or below. Writing, for instance, on page 20: "See example 2 on page 20" is not wrong but somehow it looks clumsy and unprofessional to me, and unworthy of ConTeXt, if I may say so. The challenge would seem "to pick ConTeXt's brain" just before the final processing run, when it knows whether float and reference will be on the same page or not. Could this perhaps be solvable by some Lua-code? Anyway, for lack of a better solution, I will for the time being refer to each float with "\in{ex.}[ref] on \at{page}[ref] \somewhere{on the previous page}{on the next page}[ref] \somewhere{above}{below}[ref]" and manually comment out, after the final processing run, what I cannot use. Not very elegant, to put it mildly, and I hope that someone on this list has a better solution. Kind regards, Robert Blackstone