Verbatim line numbering: location intext/text, empty lines, wrapped lines
Hi, I found some issues with verbatim line numbering in MkIV. The appended examples is basically taken from the wiki. http://wiki.contextgarden.net/Verbatim_text#Line_numbering (The wiki uses MkII?) When I want the line numbers to be displayed "intext", I have to use \setuplinenumbering[location=text], although http://wiki.contextgarden.net/Verbatim_text#Line_numbering and http://wiki.contextgarden.net/Reference/en/setuplinenumbering tell me to use "location=intext". Should this be changed in the wiki? In case of "location=text" the lines are typeset over the right margin of the box. I think this is because the space used by the numbers is not subtracted from the available space considered by the word-wrapping algorithm. In the example, line 2 is wrapped over three lines and gets 3 line numbers, while IMHO it only should get one (the wiki says the same). Line 4 gets a number, which is what I would expect, but it is a different behavior as in the wiki (there, the empty line in the example gets no number). Is there an option to choose whether a blank line should be (a) numbered, (b) skipped or (c) get no number but the internal counter is still increased? Example: \starttext \defineframedtext[framedcode][strut=yes, offset=2mm, width=7cm, align=right] \definetyping[code][numbering=line, before={\startframedcode}, after={\stopframedcode}] \setuplinenumbering[location=text] \startcode This is the first line % line 1 This is a rather long line that is wrapped, so look how the line numbering is done % line 2 Another line % line 3 % line 4 Last line after an empty line % line 5 \stopcode \stoptext Thank you in advance for any hints, Stefan.
On 3-8-2010 2:50, Stefan Müller wrote:
Example:
\starttext
\defineframedtext[framedcode][strut=yes, offset=2mm, width=7cm, align=right] \definetyping[code][numbering=line, before={\startframedcode}, after={\stopframedcode}]
\setuplinenumbering[location=text] \startcode This is the first line % line 1 This is a rather long line that is wrapped, so look how the line numbering is done % line 2 Another line % line 3 % line 4 Last line after an empty line % line 5 \stopcode
\stoptext
you can test the beta (i just uploaded a zip); it's somewhat tricky as we need to determine which lines are broken and i didn't test the new hackery too well Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Patrick Gundlach
-
Stefan Müller