ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Willi Egger via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Willi Egger <context@boede.nl>
Subject: Re: Chapter number retrieval
Date: Tue, 22 Mar 2022 23:55:13 +0100	[thread overview]
Message-ID: <8C11264C-3533-4394-AAA1-4BE3081878A1@boede.nl> (raw)
In-Reply-To: <2628758.mvXUDI8C0e@sreeramtplt>

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
___________________________________________________________________________________

      reply	other threads:[~2022-03-22 22:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 20:47 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8C11264C-3533-4394-AAA1-4BE3081878A1@boede.nl \
    --to=ntg-context@ntg.nl \
    --cc=context@boede.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).