ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Chapter number retrieval
@ 2022-03-21 20:47 Willi Egger via ntg-context
  2022-03-21 21:33 ` jbf via ntg-context
  2022-03-22  2:29 ` śrīrāma via ntg-context
  0 siblings, 2 replies; 10+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-21 20:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Willi Egger

Hello everybody!


I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?

Kind regards

Willi
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-21 20:47 Chapter number retrieval Willi Egger via ntg-context
@ 2022-03-21 21:33 ` jbf via ntg-context
  2022-03-21 23:19   ` Willi Egger via ntg-context
  2022-03-22  2:29 ` śrīrāma via ntg-context
  1 sibling, 1 reply; 10+ messages in thread
From: jbf via ntg-context @ 2022-03-21 21:33 UTC (permalink / raw)
  To: Willi Egger via ntg-context, mailing list for ConTeXt users; +Cc: jbf

Willi,

I see a comment by yourself back in 2011 at 
https://wiki.contextgarden.net/Last_Head_Number

I wonder if this helps?

Julian

On 22/3/22 07:47, Willi Egger via ntg-context wrote:
> Hello everybody!
>
>
> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
>
> Kind regards
>
> Willi
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-21 21:33 ` jbf via ntg-context
@ 2022-03-21 23:19   ` Willi Egger via ntg-context
  2022-03-21 23:32     ` jbf via ntg-context
  0 siblings, 1 reply; 10+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-21 23:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Willi Egger


Hi Julian,

:-) I am confronted with my own comments :-)

However, this is precisely what I am using in my attempt to get this hidden number. But no it does not appear…

Thank you!
Willi

> On 21 Mar 2022, at 22:33, jbf via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Willi,
> 
> I see a comment by yourself back in 2011 at https://wiki.contextgarden.net/Last_Head_Number
> 
> I wonder if this helps?
> 
> Julian
> 
> On 22/3/22 07:47, Willi Egger via ntg-context wrote:
>> Hello everybody!
>> 
>> 
>> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
>> 
>> Kind regards
>> 
>> Willi
>> ___________________________________________________________________________________
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-21 23:19   ` Willi Egger via ntg-context
@ 2022-03-21 23:32     ` jbf via ntg-context
  2022-03-22  0:21       ` Adam Reviczky via ntg-context
  0 siblings, 1 reply; 10+ messages in thread
From: jbf via ntg-context @ 2022-03-21 23:32 UTC (permalink / raw)
  To: Willi Egger via ntg-context; +Cc: jbf

Willi, offlist: Have to admit I didn't actually try your own comment, 
but if it doesn't work, I'll be interested in the eventual answer. I 
recently had to do something similar for the TOC, and Hraban pointed me 
to \currentlistentrynumber. There probably has to be a command along 
those lines (which led me to your 2011 comment, sorry 😁) for non-list 
retrieval. \structurenumber? \currentstructurenumber? Something along 
those lines? There seem to be a number of these but as yet undocumented 
as far as I can see.

Julian

On 22/3/22 10:19, Willi Egger via ntg-context wrote:
> Hi Julian,
>
> :-) I am confronted with my own comments :-)
>
> However, this is precisely what I am using in my attempt to get this hidden number. But no it does not appear…
>
> Thank you!
> Willi
>
>> On 21 Mar 2022, at 22:33, jbf via ntg-context <ntg-context@ntg.nl> wrote:
>>
>> Willi,
>>
>> I see a comment by yourself back in 2011 at https://wiki.contextgarden.net/Last_Head_Number
>>
>> I wonder if this helps?
>>
>> Julian
>>
>> On 22/3/22 07:47, Willi Egger via ntg-context wrote:
>>> Hello everybody!
>>>
>>>
>>> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
>>>
>>> Kind regards
>>>
>>> Willi
>>> ___________________________________________________________________________________
>>> 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://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-21 23:32     ` jbf via ntg-context
@ 2022-03-22  0:21       ` Adam Reviczky via ntg-context
  2022-03-22 23:13         ` Willi Egger via ntg-context
  0 siblings, 1 reply; 10+ messages in thread
From: Adam Reviczky via ntg-context @ 2022-03-22  0:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Adam Reviczky


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

Hi,

There is a good overview of accessible variables at:
https://tex.stackexchange.com/questions/134474/context-part-chapter-section-and-subsection-names

Maybe you want something like this?

\starttext
\setuphead[chapter][number=no]
\startchapter[title={My Chapter}]
Hello world!
\startMPcode
label("\currentstructurelistnumber\ \currentstructuretitle", origin);
draw fullcircle scaled 3cm;
\stopMPcode
\stopchapter
\stoptext

Adam

On Mon, Mar 21, 2022 at 11:46 PM jbf via ntg-context <ntg-context@ntg.nl>
wrote:

> Willi, offlist: Have to admit I didn't actually try your own comment,
> but if it doesn't work, I'll be interested in the eventual answer. I
> recently had to do something similar for the TOC, and Hraban pointed me
> to \currentlistentrynumber. There probably has to be a command along
> those lines (which led me to your 2011 comment, sorry 😁) for non-list
> retrieval. \structurenumber? \currentstructurenumber? Something along
> those lines? There seem to be a number of these but as yet undocumented
> as far as I can see.
>
> Julian
>
> On 22/3/22 10:19, Willi Egger via ntg-context wrote:
> > Hi Julian,
> >
> > :-) I am confronted with my own comments :-)
> >
> > However, this is precisely what I am using in my attempt to get this
> hidden number. But no it does not appear…
> >
> > Thank you!
> > Willi
> >
> >> On 21 Mar 2022, at 22:33, jbf via ntg-context <ntg-context@ntg.nl>
> wrote:
> >>
> >> Willi,
> >>
> >> I see a comment by yourself back in 2011 at
> https://wiki.contextgarden.net/Last_Head_Number
> >>
> >> I wonder if this helps?
> >>
> >> Julian
> >>
> >> On 22/3/22 07:47, Willi Egger via ntg-context wrote:
> >>> Hello everybody!
> >>>
> >>>
> >>> I would like to typeset the chapter title without number in the text.
> — However I still would need to retrieve the number for a calculation in a
> MetaFun graphic. I assume, that even though this number is not typeset, it
> is kept in the background. How to retrieve it?
> >>>
> >>> Kind regards
> >>>
> >>> Willi
> >>>
> ___________________________________________________________________________________
> >>> 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://context.aanhet.net
> >>> archive  : https://bitbucket.org/phg/context-mirror/commits/
> >>> 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://context.aanhet.net
> >> archive  : https://bitbucket.org/phg/context-mirror/commits/
> >> 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-21 20:47 Chapter number retrieval Willi Egger via ntg-context
  2022-03-21 21:33 ` jbf via ntg-context
@ 2022-03-22  2:29 ` śrīrāma via ntg-context
  2022-03-22 22:55   ` Willi Egger via ntg-context
  1 sibling, 1 reply; 10+ messages in thread
From: śrīrāma via ntg-context @ 2022-03-22  2:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Willi Egger; +Cc: śrīrāma

On Tuesday, March 22, 2022 2:17 AM Willi Egger via ntg-context wrote:
> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
> 

Hi,
On Tuesday, March 22, 2022 2:17 AM Willi Egger via ntg-context wrote:
>
> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
>

Hi,

You can define a custom command for the chapter, where the first argument (i.e, the number) is 'ignored' –

  \define[2]\ChapterTitle{#2}
  \setuphead[chapter][command=\ChapterTitle]

It will still appeared as numbered in any lists (ToC, etc). Also, it can be accessed using \headnumber[...][...]. An example graphic – 

  \startuseMPgraphic {graphic:chapter}
  picture cg;
  cg := outlinetext.d
        ("\ssbfd \headnumber[chapter]")
        (withcolor transparent(1,0.5,blue));
  fill boundingcircle cg withcolor transparent(1, 0.5, lightgray);
  draw cg;
  \stopuseMPgraphic

Using \headnumber[..][..] any 'conversion' applied to the chapter number (romannumerals, words, etc) are also preserved.

Best,
Sreeram


___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-22  2:29 ` śrīrāma via ntg-context
@ 2022-03-22 22:55   ` Willi Egger via ntg-context
  0 siblings, 0 replies; 10+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-22 22:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Willi Egger

Hello Sreeram!

What a nice and simple solution. After fiddling a bit I got it working also in my environment for the book! — Thank you so much for the support.

Kind regrards

Willi

> On 22 Mar 2022, at 03:29, śrīrāma via ntg-context <ntg-context@ntg.nl> wrote:
> 
> On Tuesday, March 22, 2022 2:17 AM Willi Egger via ntg-context wrote:
>> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
>> 
> 
> Hi,
> On Tuesday, March 22, 2022 2:17 AM Willi Egger via ntg-context wrote:
>> 
>> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
>> 
> 
> Hi,
> 
> You can define a custom command for the chapter, where the first argument (i.e, the number) is 'ignored' –
> 
> \define[2]\ChapterTitle{#2}
> \setuphead[chapter][command=\ChapterTitle]
> 
> It will still appeared as numbered in any lists (ToC, etc). Also, it can be accessed using \headnumber[...][...]. An example graphic – 
> 
> \startuseMPgraphic {graphic:chapter}
> picture cg;
> cg := outlinetext.d
>       ("\ssbfd \headnumber[chapter]")
>       (withcolor transparent(1,0.5,blue));
> fill boundingcircle cg withcolor transparent(1, 0.5, lightgray);
> draw cg;
> \stopuseMPgraphic
> 
> Using \headnumber[..][..] any 'conversion' applied to the chapter number (romannumerals, words, etc) are also preserved.
> 
> Best,
> Sreeram
> 
> 
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-22  0:21       ` Adam Reviczky via ntg-context
@ 2022-03-22 23:13         ` Willi Egger via ntg-context
  2022-03-22 23:41           ` Adam Reviczky via ntg-context
  0 siblings, 1 reply; 10+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-22 23:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Willi Egger

Hello Adam!

Many thanks for your solution. — It works very well in your example and also in an extended version with \startfrontmatter..\stopfrontmatter \startbodymatter…\stopbodymatter. — Unfortunately It does not work to my wish in the actual setup of my book. — I am using now the solution presented by Sreeram.

Again thank you so much!
Kind regards

Willi

> On 22 Mar 2022, at 01:21, Adam Reviczky via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Hi,
> 
> There is a good overview of accessible variables at: https://tex.stackexchange.com/questions/134474/context-part-chapter-section-and-subsection-names
> 
> Maybe you want something like this?
> 
> \starttext
> \setuphead[chapter][number=no]
> \startchapter[title={My Chapter}]
> Hello world!
> \startMPcode
> label("\currentstructurelistnumber\ \currentstructuretitle", origin);
> draw fullcircle scaled 3cm;
> \stopMPcode
> \stopchapter
> \stoptext
> 
> Adam
> 
> On Mon, Mar 21, 2022 at 11:46 PM jbf via ntg-context <ntg-context@ntg.nl> wrote:
> Willi, offlist: Have to admit I didn't actually try your own comment, 
> but if it doesn't work, I'll be interested in the eventual answer. I 
> recently had to do something similar for the TOC, and Hraban pointed me 
> to \currentlistentrynumber. There probably has to be a command along 
> those lines (which led me to your 2011 comment, sorry 😁) for non-list 
> retrieval. \structurenumber? \currentstructurenumber? Something along 
> those lines? There seem to be a number of these but as yet undocumented 
> as far as I can see.
> 
> Julian
> 
> On 22/3/22 10:19, Willi Egger via ntg-context wrote:
> > Hi Julian,
> >
> > :-) I am confronted with my own comments :-)
> >
> > However, this is precisely what I am using in my attempt to get this hidden number. But no it does not appear…
> >
> > Thank you!
> > Willi
> >
> >> On 21 Mar 2022, at 22:33, jbf via ntg-context <ntg-context@ntg.nl> wrote:
> >>
> >> Willi,
> >>
> >> I see a comment by yourself back in 2011 at https://wiki.contextgarden.net/Last_Head_Number
> >>
> >> I wonder if this helps?
> >>
> >> Julian
> >>
> >> On 22/3/22 07:47, Willi Egger via ntg-context wrote:
> >>> Hello everybody!
> >>>
> >>>
> >>> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
> >>>
> >>> Kind regards
> >>>
> >>> Willi
> >>> ___________________________________________________________________________________
> >>> 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://context.aanhet.net
> >>> archive  : https://bitbucket.org/phg/context-mirror/commits/
> >>> 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://context.aanhet.net
> >> archive  : https://bitbucket.org/phg/context-mirror/commits/
> >> 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-22 23:13         ` Willi Egger via ntg-context
@ 2022-03-22 23:41           ` Adam Reviczky via ntg-context
  2022-03-23 21:44             ` Willi Egger via ntg-context
  0 siblings, 1 reply; 10+ messages in thread
From: Adam Reviczky via ntg-context @ 2022-03-22 23:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Adam Reviczky


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

Hi Willi,

You could also access the number by using the
\getmarking[chapternumber][current].
I think you have used a similar approach in the
https://wiki.contextgarden.net/Thumb_index.

Adam

On Tue, Mar 22, 2022 at 11:15 PM Willi Egger via ntg-context <
ntg-context@ntg.nl> wrote:

> Hello Adam!
>
> Many thanks for your solution. — It works very well in your example and
> also in an extended version with \startfrontmatter..\stopfrontmatter
> \startbodymatter…\stopbodymatter. — Unfortunately It does not work to my
> wish in the actual setup of my book. — I am using now the solution
> presented by Sreeram.
>
> Again thank you so much!
> Kind regards
>
> Willi
>
> > On 22 Mar 2022, at 01:21, Adam Reviczky via ntg-context <
> ntg-context@ntg.nl> wrote:
> >
> > Hi,
> >
> > There is a good overview of accessible variables at:
> https://tex.stackexchange.com/questions/134474/context-part-chapter-section-and-subsection-names
> >
> > Maybe you want something like this?
> >
> > \starttext
> > \setuphead[chapter][number=no]
> > \startchapter[title={My Chapter}]
> > Hello world!
> > \startMPcode
> > label("\currentstructurelistnumber\ \currentstructuretitle", origin);
> > draw fullcircle scaled 3cm;
> > \stopMPcode
> > \stopchapter
> > \stoptext
> >
> > Adam
> >
> > On Mon, Mar 21, 2022 at 11:46 PM jbf via ntg-context <ntg-context@ntg.nl>
> wrote:
> > Willi, offlist: Have to admit I didn't actually try your own comment,
> > but if it doesn't work, I'll be interested in the eventual answer. I
> > recently had to do something similar for the TOC, and Hraban pointed me
> > to \currentlistentrynumber. There probably has to be a command along
> > those lines (which led me to your 2011 comment, sorry 😁) for non-list
> > retrieval. \structurenumber? \currentstructurenumber? Something along
> > those lines? There seem to be a number of these but as yet undocumented
> > as far as I can see.
> >
> > Julian
> >
> > On 22/3/22 10:19, Willi Egger via ntg-context wrote:
> > > Hi Julian,
> > >
> > > :-) I am confronted with my own comments :-)
> > >
> > > However, this is precisely what I am using in my attempt to get this
> hidden number. But no it does not appear…
> > >
> > > Thank you!
> > > Willi
> > >
> > >> On 21 Mar 2022, at 22:33, jbf via ntg-context <ntg-context@ntg.nl>
> wrote:
> > >>
> > >> Willi,
> > >>
> > >> I see a comment by yourself back in 2011 at
> https://wiki.contextgarden.net/Last_Head_Number
> > >>
> > >> I wonder if this helps?
> > >>
> > >> Julian
> > >>
> > >> On 22/3/22 07:47, Willi Egger via ntg-context wrote:
> > >>> Hello everybody!
> > >>>
> > >>>
> > >>> I would like to typeset the chapter title without number in the
> text. — However I still would need to retrieve the number for a calculation
> in a MetaFun graphic. I assume, that even though this number is not
> typeset, it is kept in the background. How to retrieve it?
> > >>>
> > >>> Kind regards
> > >>>
> > >>> Willi
> > >>>
> ___________________________________________________________________________________
> > >>> 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://context.aanhet.net
> > >>> archive  : https://bitbucket.org/phg/context-mirror/commits/
> > >>> 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://context.aanhet.net
> > >> archive  : https://bitbucket.org/phg/context-mirror/commits/
> > >> 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://context.aanhet.net
> > > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > 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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Chapter number retrieval
  2022-03-22 23:41           ` Adam Reviczky via ntg-context
@ 2022-03-23 21:44             ` Willi Egger via ntg-context
  0 siblings, 0 replies; 10+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-23 21:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Willi Egger

Hello Adam,


What I am actually using (at least basically) is the code given in the second example on the wiki. So this moving graphic is not the problem. The problem lays in the fact, that I need the chapter number for calculating the position of the graphic along the outer edge of the page. — Because the book in question is a dictionary, it is not nice to have the chapter titles numbered, because it is only the letter of the alphabet. If I turned off the numbering, I lost the possibility to retrieve the chapter number. Through the definition of a new command \ChapterTitle, ignoring the first argument (which is the number) the title gets typeset without the number, but the number is still available in the TOC or as in my case for the calculation.

Thank you for your support and help!

Willi

> On 23 Mar 2022, at 00:41, Adam Reviczky via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Hi Willi,
> 
> You could also access the number by using the \getmarking[chapternumber][current].
> I think you have used a similar approach in the https://wiki.contextgarden.net/Thumb_index.
> 
> Adam
> 
> On Tue, Mar 22, 2022 at 11:15 PM Willi Egger via ntg-context <ntg-context@ntg.nl> wrote:
> Hello Adam!
> 
> Many thanks for your solution. — It works very well in your example and also in an extended version with \startfrontmatter..\stopfrontmatter \startbodymatter…\stopbodymatter. — Unfortunately It does not work to my wish in the actual setup of my book. — I am using now the solution presented by Sreeram.
> 
> Again thank you so much!
> Kind regards
> 
> Willi
> 
>> On 22 Mar 2022, at 01:21, Adam Reviczky via ntg-context <ntg-context@ntg.nl> wrote:
>> 
>> Hi,
>> 
>> There is a good overview of accessible variables at: https://tex.stackexchange.com/questions/134474/context-part-chapter-section-and-subsection-names
>> 
>> Maybe you want something like this?
>> 
>> \starttext
>> \setuphead[chapter][number=no]
>> \startchapter[title={My Chapter}]
>> Hello world!
>> \startMPcode
>> label("\currentstructurelistnumber\ \currentstructuretitle", origin);
>> draw fullcircle scaled 3cm;
>> \stopMPcode
>> \stopchapter
>> \stoptext
>> 
>> Adam
>> 
>> On Mon, Mar 21, 2022 at 11:46 PM jbf via ntg-context <ntg-context@ntg.nl> wrote:
>> Willi, offlist: Have to admit I didn't actually try your own comment, 
>> but if it doesn't work, I'll be interested in the eventual answer. I 
>> recently had to do something similar for the TOC, and Hraban pointed me 
>> to \currentlistentrynumber. There probably has to be a command along 
>> those lines (which led me to your 2011 comment, sorry 😁) for non-list 
>> retrieval. \structurenumber? \currentstructurenumber? Something along 
>> those lines? There seem to be a number of these but as yet undocumented 
>> as far as I can see.
>> 
>> Julian
>> 
>> On 22/3/22 10:19, Willi Egger via ntg-context wrote:
>>> Hi Julian,
>>> 
>>> :-) I am confronted with my own comments :-)
>>> 
>>> However, this is precisely what I am using in my attempt to get this hidden number. But no it does not appear…
>>> 
>>> Thank you!
>>> Willi
>>> 
>>>> On 21 Mar 2022, at 22:33, jbf via ntg-context <ntg-context@ntg.nl> wrote:
>>>> 
>>>> Willi,
>>>> 
>>>> I see a comment by yourself back in 2011 at https://wiki.contextgarden.net/Last_Head_Number
>>>> 
>>>> I wonder if this helps?
>>>> 
>>>> Julian
>>>> 
>>>> On 22/3/22 07:47, Willi Egger via ntg-context wrote:
>>>>> Hello everybody!
>>>>> 
>>>>> 
>>>>> I would like to typeset the chapter title without number in the text. — However I still would need to retrieve the number for a calculation in a MetaFun graphic. I assume, that even though this number is not typeset, it is kept in the background. How to retrieve it?
>>>>> 
>>>>> Kind regards
>>>>> 
>>>>> Willi
>>>>> ___________________________________________________________________________________
>>>>> 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://context.aanhet.net
>>>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>>>> 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://context.aanhet.net
>>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>>> 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://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2022-03-23 21:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-21 20:47 Chapter number retrieval Willi Egger via ntg-context
2022-03-21 21:33 ` jbf via ntg-context
2022-03-21 23:19   ` Willi Egger via ntg-context
2022-03-21 23:32     ` jbf via ntg-context
2022-03-22  0:21       ` Adam Reviczky via ntg-context
2022-03-22 23:13         ` Willi Egger via ntg-context
2022-03-22 23:41           ` Adam Reviczky via ntg-context
2022-03-23 21:44             ` Willi Egger via ntg-context
2022-03-22  2:29 ` śrīrāma via ntg-context
2022-03-22 22:55   ` Willi Egger via ntg-context

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