ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* referencing figures with \in
@ 2007-06-24 12:38 Hans van der Meer
  2007-06-24 14:02 ` Taco Hoekwater
  2007-06-24 15:37 ` Wolfgang Schuster
  0 siblings, 2 replies; 8+ messages in thread
From: Hans van der Meer @ 2007-06-24 12:38 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 966 bytes --]

I used to place references to figures and tables in the following way:

\placefigure[][fig:myfig]{Title}{\useMPgraphic{myfig}{parameters}}
     \in{figure}[fig:myfig]

This however printed a dot instead of the expected "figure #".
Changing to
     \at{figure}[fig:myfig]
again printed the correct reference.

Looking further into this I found:
     \meaning\in --> \protected macro:->\dohandlemathtoken {in}
     \meaning\at  --> macro:->\dohandlecommand {at}

Still, the ConText manual tells me that
     \in{.1}{.2.}[ref] (with {.2.} optional)
should work.

In file core-ref.tex at line 2118 (2007-04-17 version) I find:
%\def\in%
%  {\ifmmode
%     \expandafter\donormalin
%   \else
%     \expandafter\doinatreference\expandafter\currenttextreference
%   \fi}
But I am definitely not in math mode when calling \in.
I did some further experimentation but nothing helped.

Has something changed here or is there something I do obviously wrong?

Hans van der Meer



[-- Attachment #1.2: Type: text/html, Size: 3851 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: referencing figures with \in
  2007-06-24 12:38 referencing figures with \in Hans van der Meer
@ 2007-06-24 14:02 ` Taco Hoekwater
  2007-06-24 17:49   ` Hans van der Meer
  2007-06-24 15:37 ` Wolfgang Schuster
  1 sibling, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2007-06-24 14:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hoi Hans,

Hans van der Meer wrote:
> I used to place references to figures and tables in the following way:
> 
> \placefigure[][fig:myfig]{Title}{\useMPgraphic{myfig}{parameters}}
>     \in{figure}[fig:myfig]
> 
> This however printed a dot instead of the expected "figure #".

This needs an example file from you. I just ran:

% hans-prob.tex
\starttext

I used to place references to figures and tables in the following way:

\placefigure[][fig:myfig]{Title}{Content}

\in{figure}[fig:myfig]

This however printed a dot instead of the expected "figure ".
Changing to \at{figure}[fig:myfig] again printed the correct reference.

\stoptext


And it worked fine.

Best wishes,
Taco

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: referencing figures with \in
  2007-06-24 12:38 referencing figures with \in Hans van der Meer
  2007-06-24 14:02 ` Taco Hoekwater
@ 2007-06-24 15:37 ` Wolfgang Schuster
  1 sibling, 0 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2007-06-24 15:37 UTC (permalink / raw)
  To: ntg-context

On Sun, 24 Jun 2007 14:38:34 +0200
Hans van der Meer <hansm@science.uva.nl> wrote:

> I used to place references to figures and tables in the following way:
> 
> \placefigure[][fig:myfig]{Title}{\useMPgraphic{myfig}{parameters}}
>      \in{figure}[fig:myfig]
> 
> This however printed a dot instead of the expected "figure #".
> Changing to
>      \at{figure}[fig:myfig]
> again printed the correct reference.
> 
> Looking further into this I found:
>      \meaning\in --> \protected macro:->\dohandlemathtoken {in}
>      \meaning\at  --> macro:->\dohandlecommand {at}
> 
> Still, the ConText manual tells me that
>      \in{.1}{.2.}[ref] (with {.2.} optional)
> should work.
> 
> In file core-ref.tex at line 2118 (2007-04-17 version) I find:
> %\def\in%
> %  {\ifmmode
> %     \expandafter\donormalin
> %   \else
> %     \expandafter\doinatreference\expandafter\currenttextreference
> %   \fi}
> But I am definitely not in math mode when calling \in.
> I did some further experimentation but nothing helped.
> 
> Has something changed here or is there something I do obviously wrong?
> 
> Hans van der Meer

Hi Hans,

please post a example, the following works for me:

\starttext

\startuseMPgraphic{circle}
draw fullcircle scaled 1cm;
\stopuseMPgraphic

\placefigure
  []
  [fig:ref]
  {Text}
  {\useMPgraphic{circle}}

\in{figure}[fig:ref]

\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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: referencing figures with \in
  2007-06-24 14:02 ` Taco Hoekwater
@ 2007-06-24 17:49   ` Hans van der Meer
  2007-06-25  7:24     ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Hans van der Meer @ 2007-06-24 17:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Taco and Wolfgang,

Here is your counterexample:

\setupcaptions[number=no] % <<<<<< the culprit
\starttext

I used to place references to figures and tables in the following way:

\placefigure[][fig:myfig]{Title}{Content}

mind the {\bf setupcations}, now \type{\in{figure}[fig:myfig]}-->\in 
{figure}[fig:myfig] and does not result in the reference.

This however printed a dot instead of the expected "figure ".
Changing to \type{\at}\at{figure}[fig:myfig] again printed the  
correct reference.

\stoptext

On Jun 24, 2007, at 16:02, Taco Hoekwater wrote:

> \starttext
>
> I used to place references to figures and tables in the following way:
>
> \placefigure[][fig:myfig]{Title}{Content}
>
> \in{figure}[fig:myfig]
>
> This however printed a dot instead of the expected "figure ".
> Changing to \at{figure}[fig:myfig] again printed the correct  
> reference.
>
> \stoptext

Hans van der Meer


___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: referencing figures with \in
  2007-06-24 17:49   ` Hans van der Meer
@ 2007-06-25  7:24     ` Taco Hoekwater
  2007-06-25 16:29       ` Hans van der Meer
  0 siblings, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2007-06-25  7:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hans van der Meer wrote:
> Taco and Wolfgang,
> 
> Here is your counterexample:
> 
> \setupcaptions[number=no] % <<<<<< the culprit
> \starttext

Since you are referencing a non-existing number, I cannot say I am
very surprised get weird output.

The problem is that the reference is actually resolved, but it has
no content (thanks to number=no), and that triggers the special
handling for anonymous references. If the figure appears on a
different page, context will print a triangle pointing to the
left or right instead of the dot. In short: it is a feature.


Best wishes,
Taco


___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: referencing figures with \in
  2007-06-25  7:24     ` Taco Hoekwater
@ 2007-06-25 16:29       ` Hans van der Meer
  2007-06-26  5:39         ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Hans van der Meer @ 2007-06-25 16:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Jun 25, 2007, at 9:24, Taco Hoekwater wrote:

> Hans van der Meer wrote:
>> Taco and Wolfgang,
>>
>> Here is your counterexample:
>>
>> \setupcaptions[number=no] % <<<<<< the culprit
>> \starttext
>
> Since you are referencing a non-existing number, I cannot say I am
> very surprised get weird output.

You are right and I should not expect something sensible from  
number=no, but for my curiosity one question remains: why does \at  
gives a number that should not exist?

Anyway, it is not a problem anymore!

>
> The problem is that the reference is actually resolved, but it has
> no content (thanks to number=no), and that triggers the special
> handling for anonymous references. If the figure appears on a
> different page, context will print a triangle pointing to the
> left or right instead of the dot. In short: it is a feature.
>
>
> Best wishes,
> Taco

Hans van der Meer


___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: referencing figures with \in
  2007-06-25 16:29       ` Hans van der Meer
@ 2007-06-26  5:39         ` Wolfgang Schuster
  2007-06-26 18:10           ` Hans van der Meer
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2007-06-26  5:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2007/6/25, Hans van der Meer <hansm@science.uva.nl>:
>
> On Jun 25, 2007, at 9:24, Taco Hoekwater wrote:
>
> > Hans van der Meer wrote:
> >> Taco and Wolfgang,
> >>
> >> Here is your counterexample:
> >>
> >> \setupcaptions[number=no] % <<<<<< the culprit
> >> \starttext
> >
> > Since you are referencing a non-existing number, I cannot say I am
> > very surprised get weird output.
>
> You are right and I should not expect something sensible from
> number=no, but for my curiosity one question remains: why does \at
> gives a number that should not exist?
>
> Anyway, it is not a problem anymore!

"\in [key]" gives the running number of float, this means 1 for the
first figure,
2 for the second ... This did only work with numbered figures, you disabled
the number in your figure and got only the dummy sign (the bullet) because
there was no number to be shown.

"\at [key]" give you the pagenumber, where your figure was placed and this
was in your example the first page.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: referencing figures with \in
  2007-06-26  5:39         ` Wolfgang Schuster
@ 2007-06-26 18:10           ` Hans van der Meer
  0 siblings, 0 replies; 8+ messages in thread
From: Hans van der Meer @ 2007-06-26 18:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks, this completely satisfies my curiosity.


On Jun 26, 2007, at 7:39, Wolfgang Schuster wrote:

> 2007/6/25, Hans van der Meer <hansm@science.uva.nl>:
>>
>> On Jun 25, 2007, at 9:24, Taco Hoekwater wrote:
>>
>>> Hans van der Meer wrote:
>>>> Taco and Wolfgang,
>>>>
>>>> Here is your counterexample:
>>>>
>>>> \setupcaptions[number=no] % <<<<<< the culprit
>>>> \starttext
>>>
>>> Since you are referencing a non-existing number, I cannot say I am
>>> very surprised get weird output.
>>
>> You are right and I should not expect something sensible from
>> number=no, but for my curiosity one question remains: why does \at
>> gives a number that should not exist?
>>
>> Anyway, it is not a problem anymore!
>
> "\in [key]" gives the running number of float, this means 1 for the
> first figure,
> 2 for the second ... This did only work with numbered figures, you  
> disabled
> the number in your figure and got only the dummy sign (the bullet)  
> because
> there was no number to be shown.
>
> "\at [key]" give you the pagenumber, where your figure was placed  
> and this
> was in your example the first page.

Hans van der Meer


___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2007-06-26 18:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-24 12:38 referencing figures with \in Hans van der Meer
2007-06-24 14:02 ` Taco Hoekwater
2007-06-24 17:49   ` Hans van der Meer
2007-06-25  7:24     ` Taco Hoekwater
2007-06-25 16:29       ` Hans van der Meer
2007-06-26  5:39         ` Wolfgang Schuster
2007-06-26 18:10           ` Hans van der Meer
2007-06-24 15:37 ` Wolfgang Schuster

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).