ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* References to floats.
@ 2012-05-06 21:18 Robert Blackstone
  2012-05-07  7:41 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Blackstone @ 2012-05-06 21:18 UTC (permalink / raw)
  To: ntg-context

Dear list,

Presently I am working on a book that contains many musical examples, some of them rather large (even page-filling). It is difficult to predict where they will finally be placed, at least  when I do not want to spoil the layout too much by forcing every example to be placed at the point where it occurs in the .tex-file.

So when dicussing an example I always refer to it with \in{ex.}{ref} and \at{page}[ref].

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"?

(One imagines that in the last stage of typesetting the file ConTeXt "knows" that the reference and the referenced float will be on the same page, but I have no clue how I could use this knowledge.)
Thanks in advance for any help.

Robert Blackstone
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: References to floats.
  2012-05-06 21:18 References to floats Robert Blackstone
@ 2012-05-07  7:41 ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2012-05-07  7:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Robert Blackstone

On 6-5-2012 23:18, Robert Blackstone wrote:
> Dear list,
>
> Presently I am working on a book that contains many musical examples, some of them rather large (even page-filling). It is difficult to predict where they will finally be placed, at least  when I do not want to spoil the layout too much by forcing every example to be placed at the point where it occurs in the .tex-file.
>
> So when dicussing an example I always refer to it with \in{ex.}{ref} and \at{page}[ref].
>
> 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"?
>
> (One imagines that in the last stage of typesetting the file ConTeXt "knows" that the reference and the referenced float will be on the same page, but I have no clue how I could use this knowledge.)
> Thanks in advance for any help.

you can try \atpage[ref]

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: References to floats
@ 2012-05-09 15:24 Alan BRASLAU
  0 siblings, 0 replies; 6+ messages in thread
From: Alan BRASLAU @ 2012-05-09 15:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> On Mon, May 7, 2012 at 15:03, Robert Blackstone wrote:
> 
> Thank you, Hans, for your quick reply. Unfortunately it does not help
> me. The result is basically the same as when I write "on
> \at{page}[ref]", except that, instead of "on page 20", I get "at page
> 20", (with the float sitting on page 20).
> Frankly, I'm rather surprised that this wish of mine seems not to have
> come up before.
> 

Indeed, something clean and automatic should be easy -
after all the color of the reference is different (contrastcolor)
when it is to be found on the same page or on a different page.

\at{page}[ref] could be smart enough...

What should the behavior be?
"on \at{page}[ref]" could return "on ",
but this would not be right.
"\at{on page}[ref]" could return "",
but otherwise "on page" would be a (colored) active link.
I might try
"\in{figure}[ref] \at{(page }{)}[ref]"
and hope/expect "(page xx)" to be replaced by ""
when referring to the current page.
Maybe Wolfgang is right in suggesting writing a custom macro.

I haven't looked at the code, though.

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: References to floats
@ 2012-05-09 14:16 Robert Blackstone
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Blackstone @ 2012-05-09 14:16 UTC (permalink / raw)
  To: ntg-context

On Mon, 7 May 2012 22:25:37, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:

> Am 07.05.2012 um 15:03 schrieb Robert Blackstone:
>
>> On Mon, May 7, 2012 at 12:00 PM,   Hans Hagen <pragma@wxs.nl>
>> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: References to floats
  2012-05-07 13:03 Robert Blackstone
@ 2012-05-07 20:25 ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2012-05-07 20:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.05.2012 um 15:03 schrieb Robert Blackstone:

> On Mon, May 7, 2012 at 12:00 PM,   Hans Hagen <pragma@wxs.nl>
> 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]
>> 
> 
> Thank you, Hans, for your quick reply. Unfortunately it does not help me.
> The result is basically the same as when I write "on \at{page}[ref]",
> except that, instead of "on page 20", I get "at page 20", (with the
> float sitting on page 20).
> Frankly, I'm rather surprised that this wish of mine seems not to have
> come up before.

The mechanism to check if float and reference are on the same page is available
as Hans has shown with \atpage but there are to many ways to format the output.

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: References to floats
@ 2012-05-07 13:03 Robert Blackstone
  2012-05-07 20:25 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Blackstone @ 2012-05-07 13:03 UTC (permalink / raw)
  To: ntg-context

On Mon, May 7, 2012 at 12:00 PM,   Hans Hagen <pragma@wxs.nl>
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]
>

Thank you, Hans, for your quick reply. Unfortunately it does not help me.
The result is basically the same as when I write "on \at{page}[ref]",
except that, instead of "on page 20", I get "at page 20", (with the
float sitting on page 20).
Frankly, I'm rather surprised that this wish of mine seems not to have
come up before.

Kind regards,
Robert
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-09 15:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-06 21:18 References to floats Robert Blackstone
2012-05-07  7:41 ` Hans Hagen
2012-05-07 13:03 Robert Blackstone
2012-05-07 20:25 ` Wolfgang Schuster
2012-05-09 14:16 Robert Blackstone
2012-05-09 15:24 Alan BRASLAU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).