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.
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
Thanks Wolfgang, the solution with \startchapter and insidesection works fine. I wasn't aware of that \startchapter-stucture at all. Regarding to "The \startchapter command is recommended over \bookmark as the latter might become obsolete" from http://wiki.contextgarden.net/PDF_Bookmarks_and_Headers is that also the new recommended way of defining chapters instead of \chapter{..}? P.
Am 01.10.2012 um 10:48 schrieb Peter Schorsch
Thanks Wolfgang,
the solution with \startchapter and insidesection works fine.
I wasn't aware of that \startchapter-stucture at all. Regarding to
"The \startchapter command is recommended over \bookmark as the latter might become obsolete" from http://wiki.contextgarden.net/PDF_Bookmarks_and_Headers
With \startchapter etc. it’s easier to set different texts for the heading, header, bookmarks and table of contents because there is a key for each of them while for \chapter you can only set one text for all of them. Only with the \bookmark command you can at least set a different text for the bookmarks.
is that also the new recommended way of defining chapters instead of \chapter{..}?
You can use them but you don’t have to, the old commands while stay but the new ones but they are helpful when you want endnotes end the end of each chapter etc. When you have a simple structure in your document you can use \startsectionlevel instead of \startchapter, \startsection etc. for your headings because the command switches always to the next heading (chapter -> section -> subsection). Wolfgang
participants (2)
-
Peter Schorsch
-
Wolfgang Schuster