Changes

Jump to navigation Jump to search
81 bytes removed ,  05:01, 9 August 2017
→‎Using Section Numbering to Improve Paragraph Numbering: made some improvements to the code and clarifications to the wiki text
</context>
== Using Combining Section Numbering to Improve with Paragraph Numbering and Titles ==
Idris provided [https://mailman.ntg.nl/pipermail/ntg-context/2017/089454.html a modified version] of an enumerated-paragraphs sample from provided by Wolfgang to use . In the modified version, section numbering to get some paragraphs numberedis combined with paragraph enumeration, with titles optional:
<context source="yes" text="The output from the previous code is:">
\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]
 \def\startsectionpar{\startsection[title={\ParagraphNumber}]}\def\startsubsectionpar{\startsection[title={\subParagraphNumber}]}\def\startsubsubsectionpar{\startsection[title={\subsubParagraphNumber}]}\def\stopsectionpar{\stopsection}\def\stopsubsectionpar{\stopsubsection}\def\stopsubsubsectionpar{\stopsubsubsection}
\starttext
\startsectionparstartsection[title=\ParagraphNumber{Text.}]
\input ward
\startsubsectionpar[title=\subParagraphNumber]startsubsection
\input ward
\startsubsubsectionparstartsubsubsection[title=\subsubParagraphNumber{Text.}]
\input ward
\stopsubsubsectionparstopsubsubsection\stopsubsectionparstopsubsection\stopsectionparstopsection
\startsectionpar[title=\ParagraphNumber]startsection
\input ward
\startsubsubsectionpar[title=\subsubParagraphNumber]startsubsubsection
\input ward
\stopsubsubsectionparstopsubsubsection
\stopsection
\stoptext
</context>
67

edits

Navigation menu