Changes

Jump to navigation Jump to search
2,108 bytes added ,  21:32, 10 May 2006
no edit summary
Last line after an empty line
\stopcode
</context>
 
=== Continuing the numbering ===
Another handy feature is the ability to continue the numbering from one portion of code to another. Use the option <tt>continue</tt> for this.
 
<texcode>
\startcode
This is the first line
This is a rather long line that is wrapped, so look how the line numbering is done
Another line
 
Last line after an empty line
\stopcode
 
Some normal text to explain the first piece of code,
and introduce the following lines.
 
\startcode[continue]
This is the first continuing line
This is a rather long line that is wrapped, so look how the line numbering is done
Another line
Last line
\stopcode
</texcode>
 
<context>
\defineframedtext
[framedcode]
[strut=yes,
offset=2mm,
width=7cm,
align=right]
 
\definetyping[code][numbering=line,
bodyfont=small,
before={\startframedcode},
after={\stopframedcode}]
 
\startcode
This is the first line
This is a rather long line that is wrapped, so look how the line numbering is done
Another line
 
Last line after an empty line
\stopcode
 
Some normal text to explain the first piece of code, and introduce the following lines.
 
\startcode[continue]
This is the first continuing line
This is a rather long line that is wrapped, so look how the line numbering is done
Another line
Last line
\stopcode
</context>
 
=== Arbitrary starting line number ===
You can also decide what the starting line number is. Use the option <tt>start=number</tt> for this.
 
<texcode>
\startcode[start=200]
This is the first line
This is a rather long line that is wrapped, so look how the line numbering is done
Another line
Last line
\stopcode
</texcode>
 
<context>
\defineframedtext
[framedcode]
[strut=yes,
offset=2mm,
width=7cm,
align=right]
 
\definetyping[code][numbering=line,
bodyfont=small,
before={\startframedcode},
after={\stopframedcode}]
 
\startcode[start=200]
This is the first line
This is a rather long line that is wrapped, so look how the line numbering is done
Another line
Last line
\stopcode
</context>
Anonymous user

Navigation menu