Changes

Jump to navigation Jump to search
861 bytes added ,  07:18, 4 September 2005
m
Added some examples of the typeset output.
This code was proposed by Taco to the list:
 
<texcode>
\newcounter\Paracount
\setcounter\Paracount1
 
\def\Paragraphnumber%
{\increment\Paracount
\Paracount.~}
\def\startParagraphs%
{\par \begingroup \appendtoks \Paragraphnumber \to \everypar}
\def\stopParagraphs%
{\par \endgroup}
 
\starttext
Unnumbered text before.
 
\startParagraphs
This is the first numbered paragraph.
 
This is another paragraph. This is another
paragraph. This is another paragraph.
\stopParagraphs
 
Unnambered text after.
\stoptext
</texcode>
 
This produces the following result:
<context>
\newcounter\Paracount
\setcounter\Paracount1
{\increment\Paracount
\Paracount.~}
 
\def\startParagraphs%
{\par \begingroup \appendtoks \Paragraphnumber \to \everypar}
 
\def\stopParagraphs%
{\par \endgroup}
\starttext
 
Unnumbered text before.
Unnambered text after.
\stoptext
</texcodecontext
If you're happy with numbers in the margin, this is in-built ConTeXt way, with <cmd>setupparagraphnumbering</cmd>:
 
<texcode>
\starttext
\stoptext
</texcode>
 
<context>
\setupcolors[state=start]
\starttext
Unnumbered text before.
 
\setupparagraphnumbering[state=start,style=italic,distance=0pt]
This is the first numbered paragraph.
 
This is another paragraph. This is another
paragraph. This is another paragraph.
\setupparagraphnumbering[state=stop]
 
Unnambered text after.
\stoptext
</context>

Navigation menu