On Tue, 08 Aug 2017 22:14:15 -0600, Idris Samawi Hamid ادريس سماوي حامد <idris.ha...@colostate.edu> wrote:

Wikified by Pablo:

http://wiki.contextgarden.net/Paragraph_Enumeration#Using_Section_Numbering_to_Improve_Paragraph_Numbering

And coming soon to a beta near you:

http://wiki.contextgarden.net/Titles#Complete_Section_Numbering

Much improved version, with optional titles - updated the wiki:

==============
\defineseparatorset [ParagraphNumber][.,] % no second decimal for susubparagraphs % \defineseparatorset [ParagraphNumber][.,.] % second decimal for susubparagraphs

\definecounter[ParagraphNumber][numberseparatorset=ParagraphNumber,criterium=all]

\define\ParagraphNumber
  {{\bf \incrementcounter[ParagraphNumber]%
   \convertedcounter[ParagraphNumber][numbersegments=1]}\quad}

\define\subParagraphNumber
  {{\bf \incrementcounter[ParagraphNumber][2]%
   \convertedcounter[ParagraphNumber][numbersegments=1:2]}\quad}

\define\subsubParagraphNumber
  {{\bf \incrementcounter[ParagraphNumber][3]%
   \convertedcounter[ParagraphNumber][numbersegments=1:3]}\quad}

\setuphead[section]
   [style=\bf,
    alternative=text,
    criterium=all,
    number=no,
    textcommand=\ParagraphNumber,
    insidesection=\hskip-0.49em] % adjust space after title

\setuphead[subsection]
   [style=\bf,
    alternative=text,
    criterium=all,
    number=no,
    textcommand=\subParagraphNumber,
    insidesection=\hskip-0.49em] % adjust space after title

\setuphead[subsubsection]
   [style=\bf,
    alternative=text,
    criterium=all,
    number=no,
    textcommand=\subsubParagraphNumber,
    insidesection=\hskip-0.49em] % adjust space after title

\setupwhitespace[line]

\starttext
\startsection[title={Text.}]
\input ward
\startsubsection
\input ward
\startsubsubsection[title={Text.}]
\input ward
\stopsubsubsection
\stopsubsection
\stopsection

\startsection
\input ward
\startsubsubsection
\input ward
\stopsubsubsection
\stopsection
\stoptext
==============

Any further suggestions for improvement?

Many thanks to Wolfgang, Pablo, and of course Hans.

Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
___________________________________________________________________________________
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 via email to