ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Referencing a figure
@ 2013-01-22 10:06 Devendra Ghate
  2013-01-22 10:18 ` Philipp Gesang
  0 siblings, 1 reply; 7+ messages in thread
From: Devendra Ghate @ 2013-01-22 10:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

I have written a macro to include figures. I pass the label name and
the caption as the two arguments. But when I try to refer to the figure,
it shows ??.

Surely, my macro does not define the figure label as intended by me.
What am I doing wrong? Also, while trying to debug this problem, I tried
using *\version[temporary]* to see the labels as suggested in the Context
manual (chapter on Cross References (page 207) of cont-ini.pdf). But it
didn't show many the label of the figure.

MWE:

\useMPlibrary[dum]
\unprotect
\define[2]\dincludefigure{%
    \placefigure[fig:#1]{#2}{\externalfigure[dummy][width=10cm]}%
  }%
\protect

\starttext
   \dincludefigure{one}{A figure}
   I am refering to \in{Figure}[fig:one].
\stoptext


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

[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Referencing a figure
  2013-01-22 10:06 Referencing a figure Devendra Ghate
@ 2013-01-22 10:18 ` Philipp Gesang
  2013-01-22 10:48   ` Devendra Ghate
  0 siblings, 1 reply; 7+ messages in thread
From: Philipp Gesang @ 2013-01-22 10:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi!

···<date: 2013-01-22, Tuesday>···<from: Devendra Ghate>···

> I have written a macro to include figures. I pass the label name and
> the caption as the two arguments. But when I try to refer to the figure,
> it shows ??.
> 
> Surely, my macro does not define the figure label as intended by me.
> What am I doing wrong?

If you specify only one optional argument of \placefloat, then
leftmost in the list is assumed, i.e. the location. To get around
this, either specify a location or add empty brackets if you’re
content with the default:

    \define[2]\dincludefigure{%
      \placefigure[][fig:#1]{#2}{\externalfigure[dummy][width=10cm]}%
    }%

Regards
Philipp


>                        Also, while trying to debug this problem, I tried
> using *\version[temporary]* to see the labels as suggested in the Context
> manual (chapter on Cross References (page 207) of cont-ini.pdf). But it
> didn't show many the label of the figure.
> 
> MWE:
> 
> \useMPlibrary[dum]
> \unprotect
> \define[2]\dincludefigure{%
>    \placefigure[fig:#1]{#2}{\externalfigure[dummy][width=10cm]}%
>  }%
> \protect
> 
> \starttext
>   \dincludefigure{one}{A figure}
>   I am refering to \in{Figure}[fig:one].
> \stoptext
> 

> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Referencing a figure
  2013-01-22 10:18 ` Philipp Gesang
@ 2013-01-22 10:48   ` Devendra Ghate
  0 siblings, 0 replies; 7+ messages in thread
From: Devendra Ghate @ 2013-01-22 10:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


On 01/22/2013 03:48 PM, Philipp Gesang wrote:
> Hi!
>
> ···<date: 2013-01-22, Tuesday>···<from: Devendra Ghate>···
>
>> I have written a macro to include figures. I pass the label name and
>> the caption as the two arguments. But when I try to refer to the figure,
>> it shows ??.
>>
>> Surely, my macro does not define the figure label as intended by me.
>> What am I doing wrong?
> If you specify only one optional argument of \placefloat, then
> leftmost in the list is assumed, i.e. the location. To get around
> this, either specify a location or add empty brackets if you're
> content with the default:
>
>      \define[2]\dincludefigure{%
>        \placefigure[][fig:#1]{#2}{\externalfigure[dummy][width=10cm]}%
>      }%
>
> Regards
> Philipp
>
Thank you Philipp.

Devendra




>>                         Also, while trying to debug this problem, I tried
>> using *\version[temporary]* to see the labels as suggested in the Context
>> manual (chapter on Cross References (page 207) of cont-ini.pdf). But it
>> didn't show many the label of the figure.
>>
>> MWE:
>>
>> \useMPlibrary[dum]
>> \unprotect
>> \define[2]\dincludefigure{%
>>     \placefigure[fig:#1]{#2}{\externalfigure[dummy][width=10cm]}%
>>   }%
>> \protect
>>
>> \starttext
>>    \dincludefigure{one}{A figure}
>>    I am refering to \in{Figure}[fig:one].
>> \stoptext
>>
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


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

[-- Attachment #2: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Referencing a Figure
  2010-04-30  1:45 Referencing a Figure Troy Henderson
  2010-04-30  2:08 ` Aditya Mahajan
@ 2010-04-30  6:47 ` Albrecht Kauffmann
  1 sibling, 0 replies; 7+ messages in thread
From: Albrecht Kauffmann @ 2010-04-30  6:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users



On Thu, 29 Apr 2010, Troy Henderson wrote:

> I am trying to reference a figure, and the results are not as
> expected.  Here is my snippet.
>
> \placefigure[fig:myfigure]{A beautiful circle}{
>    \startMPcode
>       draw fullcircle scaled 72;
>    \stopMPcode
> }
> Isn't Figure \in[fig:myfigure] beautiful?

Try \placefigure[here][fig:myfigure]{A beautiful circle}{
...


Greetings

Albrecht


>
>
> When this code renders, the text says "Isn't Figure ?? beautiful?"
> How can I get the correct figure number?
>
> Thanks,
>
> Troy
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Referencing a Figure
  2010-04-30  2:08 ` Aditya Mahajan
@ 2010-04-30  2:54   ` Troy Henderson
  0 siblings, 0 replies; 7+ messages in thread
From: Troy Henderson @ 2010-04-30  2:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Beautiful. Thanks.
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Referencing a Figure
  2010-04-30  1:45 Referencing a Figure Troy Henderson
@ 2010-04-30  2:08 ` Aditya Mahajan
  2010-04-30  2:54   ` Troy Henderson
  2010-04-30  6:47 ` Albrecht Kauffmann
  1 sibling, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2010-04-30  2:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 29 Apr 2010, Troy Henderson wrote:

> I am trying to reference a figure, and the results are not as
> expected.  Here is my snippet.
>
> \placefigure[fig:myfigure]{A beautiful circle}{

\placefigure[][fig:myfigure]{...}{...}

>   \startMPcode
>      draw fullcircle scaled 72;
>   \stopMPcode
> }
> Isn't Figure \in[fig:myfigure] beautiful?
>
>
> When this code renders, the text says "Isn't Figure ?? beautiful?"
> How can I get the correct figure number?

When \placefigure is used with only one optional argument, the optional 
argument is interpreted as the placement specifier (here, left, right, 
top, bottom), rather than the label.

Aditya
___________________________________________________________________________________
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] 7+ messages in thread

* Referencing a Figure
@ 2010-04-30  1:45 Troy Henderson
  2010-04-30  2:08 ` Aditya Mahajan
  2010-04-30  6:47 ` Albrecht Kauffmann
  0 siblings, 2 replies; 7+ messages in thread
From: Troy Henderson @ 2010-04-30  1:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I am trying to reference a figure, and the results are not as
expected.  Here is my snippet.

\placefigure[fig:myfigure]{A beautiful circle}{
   \startMPcode
      draw fullcircle scaled 72;
   \stopMPcode
}
Isn't Figure \in[fig:myfigure] beautiful?


When this code renders, the text says "Isn't Figure ?? beautiful?"
How can I get the correct figure number?

Thanks,

Troy
___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2013-01-22 10:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22 10:06 Referencing a figure Devendra Ghate
2013-01-22 10:18 ` Philipp Gesang
2013-01-22 10:48   ` Devendra Ghate
  -- strict thread matches above, loose matches on Subject: below --
2010-04-30  1:45 Referencing a Figure Troy Henderson
2010-04-30  2:08 ` Aditya Mahajan
2010-04-30  2:54   ` Troy Henderson
2010-04-30  6:47 ` Albrecht Kauffmann

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