ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Stefan Müller" <warrence.stm@gmx.de>
To: ntg-context@ntg.nl
Subject: Verbatim line numbering: location intext/text, empty lines, wrapped lines
Date: Tue, 3 Aug 2010 14:50:22 +0200	[thread overview]
Message-ID: <201008031450.22594.warrence.stm@gmx.de> (raw)
In-Reply-To: <mailman.1.1280829602.10932.ntg-context@ntg.nl>

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
___________________________________________________________________________________


       reply	other threads:[~2010-08-03 12:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1.1280829602.10932.ntg-context@ntg.nl>
2010-08-03 12:50 ` Stefan Müller [this message]
2010-08-03 13:37   ` Patrick Gundlach
2010-08-04 18:15   ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201008031450.22594.warrence.stm@gmx.de \
    --to=warrence.stm@gmx.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).