ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Verbatim line numbering: location intext/text, empty lines, wrapped lines
       [not found] <mailman.1.1280829602.10932.ntg-context@ntg.nl>
@ 2010-08-03 12:50 ` Stefan Müller
  2010-08-03 13:37   ` Patrick Gundlach
  2010-08-04 18:15   ` Hans Hagen
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Müller @ 2010-08-03 12:50 UTC (permalink / raw)
  To: ntg-context

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.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Verbatim line numbering: location intext/text, empty lines, wrapped lines
  2010-08-03 12:50 ` Verbatim line numbering: location intext/text, empty lines, wrapped lines Stefan Müller
@ 2010-08-03 13:37   ` Patrick Gundlach
  2010-08-04 18:15   ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick Gundlach @ 2010-08-03 13:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> (The wiki uses MkII?)

Yes


Patrick

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Verbatim line numbering: location intext/text, empty lines, wrapped lines
  2010-08-03 12:50 ` Verbatim line numbering: location intext/text, empty lines, wrapped lines Stefan Müller
  2010-08-03 13:37   ` Patrick Gundlach
@ 2010-08-04 18:15   ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2010-08-04 18:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Stefan Müller

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-04 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1.1280829602.10932.ntg-context@ntg.nl>
2010-08-03 12:50 ` Verbatim line numbering: location intext/text, empty lines, wrapped lines Stefan Müller
2010-08-03 13:37   ` Patrick Gundlach
2010-08-04 18:15   ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).