# Line numbering in ConTeXt outside of verbatim

Basically, I would like a way to number the lines in a block of text, without resorting to verbatim mode.

I have tried

``````\definetyping[code][numbering=line,style=\tf]
\startcode[step=5]
Thus, I came to the conclusion that
the designer of a new system must not
only be the implementer and first
large-scale user; the designer should
also write the first user manual.
\stopcode
``````

but this preserves the whitespace; I would like ConTeXt to lay out the paragraph normally and then number the lines. The numbering does not need to be in the margin, but I would like to be able to skip every n numbers and use columns. The solution with `definetyping` is quite close; I simply would like to avoid having to manually adjust line breaks and possibly have hyphenation.

I found Show the number of lines in margin for LaTeX, but that doesn't apply here, unless there is a ConTeXt equivalent (the wiki does not mention one and Google turns up nothing).

-

Use `\startlinenumbering`, it re-wraps the text and does not preserve the line endings. The `step` key and hyphenation work as well.

``````\starttext
\startlinenumbering [step=5]
\input knuth
\stoplinenumbering
\stoptext
``````

For further information see the ConTeXT wiki - \startlinenumbering.

-
Thanks! I can't believe I didn't see that searching the wiki... – li.davidm Jan 28 '13 at 23:42