[NTG-context] counter reseting at every heading

2012-09-30 Thread Peter Schorsch
Hi, 

few months ago (18th may) I asked about how to setup a counter that
resets after each heading (chapter, section, subsection, subsubsection
and so on.

I got three possibilities then but none of them was implemented (and
still is not):

1)
\definecounter[ParagraphNumber][prefix=no,way={bychapter,bysection,bysubsection,bysubsubsection}]

2)
\definecounter[ParagraphNumber][prefix=no,way=byheader]

3)
\setuphead[chapter,section,subsection,subsubsection][after={\resetcounter[ParagraphNumber]}]
as soon the spaces are defined over spaceafter instead of after.

Is there a forth option out? Or can anyone tell me
what the defaults spaces are so that I can copy them manually? 

Thanks
P.
___
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
___


Re: [NTG-context] counter reseting at every heading

2012-09-30 Thread Wolfgang Schuster

Am 30.09.2012 um 22:29 schrieb Peter Schorsch :

> Hi, 
> 
> few months ago (18th may) I asked about how to setup a counter that
> resets after each heading (chapter, section, subsection, subsubsection
> and so on.
> 
> I got three possibilities then but none of them was implemented (and
> still is not):
> 
> 1)
> \definecounter[ParagraphNumber][prefix=no,way={bychapter,bysection,bysubsection,bysubsubsection}]
> 
> 2)
> \definecounter[ParagraphNumber][prefix=no,way=byheader]
> 
> 3)
> \setuphead[chapter,section,subsection,subsubsection][after={\resetcounter[ParagraphNumber]}]
> as soon the spaces are defined over spaceafter instead of after.
> 
> Is there a forth option out?

When you use the start/stop commands for the headings you can use the inside 
section key to reset the counter, e.g. 
\setuphead[insidesection={\resetcounter[…]}]

> Or can anyone tell me what the defaults spaces are so that I can copy them 
> manually? 


Here are the default values taken from strc-def.mkiv, the subsection etc. 
inherit the settings from section.

part, chapter:

  before = \blank[2*big]
  after  = \blank[2*big]

section:

  before = \blank[2*big]
  after  = \blank

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
___