From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/75950 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Bug with linenumbering Date: Thu, 3 May 2012 00:58:37 -0400 (EDT) Message-ID: References: <4FA0F0B8.4040301@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1336021133 24593 80.91.229.3 (3 May 2012 04:58:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 3 May 2012 04:58:53 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Thu May 03 06:58:52 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SPo7w-0008Qi-A0 for gctc-ntg-context-518@m.gmane.org; Thu, 03 May 2012 06:58:52 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1EC2D101E4; Thu, 3 May 2012 06:58:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wYJ+yrJBQgHJ; Thu, 3 May 2012 06:58:49 +0200 (CEST) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 919C2101E1; Thu, 3 May 2012 06:58:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E0CE5101E1 for ; Thu, 3 May 2012 06:58:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id y0EOcwKNRKGq for ; Thu, 3 May 2012 06:58:47 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 02C96101E0 for ; Thu, 3 May 2012 06:58:46 +0200 (CEST) Original-Received: from hellskitchen.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.82]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q434wiGh021434 for ; Thu, 3 May 2012 06:58:45 +0200 Original-Received: FROM adi-netbook (bas3-montreal02-1096682554.dsl.bell.ca [65.94.12.58]) By hellskitchen.mr.itd.umich.edu ID 4FA21080.36A21.17619 ; Authuser adityam; 3 May 2012 00:58:40 EDT In-Reply-To: <4FA0F0B8.4040301@wxs.nl> User-Agent: Alpine 2.02 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.82; country=US; region=TX; city=Ladonia; postalcode=75449; latitude=33.4261; longitude=-95.9709; metrocode=623; areacode=903; http://maps.google.com/maps?q=33.4261,-95.9709&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06H5gWIot - 9547a3f3e864 - 20120503 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:75950 Archived-At: On Wed, 2 May 2012, Hans Hagen wrote: > On 1-5-2012 21:43, Aditya Mahajan wrote: >> Hi, >> >> Line numbering does not respect the parameters given with >> \startlinenumbering. For example: > > Line numbering is a delayed operation. As they are handled when the page is > constructed the settings of that moment apply. In practice only the start key > is handled when you pass settings to \start.... (the only reason for having > the second argument is number start/restart etc). If you want different > renderings, the best is to define a specific instance of line numbering. A little background: In the initial version of the vim module, I used to do line numbering manually (each line started with \NL macro, which expanded to a number in an appropriate style depending on whether line numbering was enabled or not. When I rewrote the module to use the filter module, I also rewrote the line numbering mechanism to use ConTeXt's inbuilt line numbering macros, but I cannot get them to work. Consider the following example. I want to define an environment, which, amongst other things does line numbering. I want the user to control the style and color of line numbering, so I define keys numberstyle and numbercolor, which are then passed on to the line numbering macros. The most obvious implementation of this does not work. \definenamespace [whatever] [ type=module, name=whatever, command=yes, setup=yes, parent=whatever, ] \appendtoks \definelinenumbering [\currentwhatever] [ color=\whateverparameter{numbercolor}, style=\whateverparameter{numberstyle}, ]% \setvalue{start\currentwhatever}{\dostartwhatever[\currentwhatever]}% \setvalue{stop\currentwhatever}{\dostopwhatever}% \to\everydefinewhatever % For illustration. The actual macro is more complicated. \def\dostartwhatever[#1]% {\startlinenumbering[#1]} \def\dostopwhatever {\stoplinenumbering} %%%% \definewhatever[testing][numbercolor=red,numberstyle=bold] \starttext \starttesting \input knuth \stoptesting \stoptext When I run it, the line number is not styled. Any idea on what I can do differently? Aditya ___________________________________________________________________________________ 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 ___________________________________________________________________________________