ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [Fwd:  Line numbering]
@ 2006-09-07  4:43 CV Radhakrishnan
  2006-09-07  5:48 ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: CV Radhakrishnan @ 2006-09-07  4:43 UTC (permalink / raw)


Any help for the following problem will be highly appreciated.

Radhakrishnan


-------- Forwarded Message --------
From: CV Radhakrishnan <cvr@river-valley.org>
Reply-To: mailing list for ConTeXt users <ntg-context@ntg.nl>
To: Mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Line numbering
Date: Sat, 02 Sep 2006 10:13:31 +0530

Dear all,

Forgive me if I sound naive.  I searched the archives, but could not
find the solution for my following problem:

I need to have line numbers for the text formatted in two columns.  The
numbers for left column shall appear in the left side and that for right
column shall appear in the right side of the page.  location=inmargin
option to the \setuplinenumbering doesn't help much.  Please take a look
at the following image:

  http://www.river-valley.com/cvr/one.png

which will give you an idea of my requirement.  Any help in this matter
will be highly apprecaited and thanks in advance.

Best

Radhakrishnan

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

* Re: [Fwd:  Line numbering]
  2006-09-07  4:43 [Fwd: Line numbering] CV Radhakrishnan
@ 2006-09-07  5:48 ` Aditya Mahajan
  2006-09-07 16:22   ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2006-09-07  5:48 UTC (permalink / raw)


Hi CVR,

> From: CV Radhakrishnan <cvr@river-valley.org>
> Reply-To: mailing list for ConTeXt users <ntg-context@ntg.nl>
> To: Mailing list for ConTeXt users <ntg-context@ntg.nl>
> Subject: [NTG-context] Line numbering
> Date: Sat, 02 Sep 2006 10:13:31 +0530
>
> Dear all,
>
> Forgive me if I sound naive.  I searched the archives, but could not
> find the solution for my following problem:
>
> I need to have line numbers for the text formatted in two columns.  The
> numbers for left column shall appear in the left side and that for right
> column shall appear in the right side of the page.  location=inmargin
> option to the \setuplinenumbering doesn't help much.  Please take a look
> at the following image:
>
>  http://www.river-valley.com/cvr/one.png
>
> which will give you an idea of my requirement.  Any help in this matter
> will be highly apprecaited and thanks in advance.

I do not know how to automate what you want. An ugly solution is to 
specify the column breaks yourself, something like

\unprotect
\def\dosetuplinenumbering[#1]%
   {\getparameters[\??rn][\c!start=1,\c!step=1,#1]%
%    \global\linenumber\plusone
%    Do not reset linenumber. Why is this here?
   }
\protect


\starttext
\startcolumns
\setuplinenumbering[location=inleft]
   \startlinenumbering
     \input knuth
   \stoplinenumbering
   \column
   \setuplinenumbering[location=inright]
   \startlinenumbering[continue]
     \input knuth
   \stoplinenumbering
\stopcolumns
\stoptext

Aditya

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

* Re: [Fwd:  Line numbering]
  2006-09-07  5:48 ` Aditya Mahajan
@ 2006-09-07 16:22   ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2006-09-07 16:22 UTC (permalink / raw)


Aditya Mahajan wrote:
> Hi CVR,
>
>   
>> From: CV Radhakrishnan <cvr@river-valley.org>
>> Reply-To: mailing list for ConTeXt users <ntg-context@ntg.nl>
>> To: Mailing list for ConTeXt users <ntg-context@ntg.nl>
>> Subject: [NTG-context] Line numbering
>> Date: Sat, 02 Sep 2006 10:13:31 +0530
>>
>> Dear all,
>>
>> Forgive me if I sound naive.  I searched the archives, but could not
>> find the solution for my following problem:
>>
>> I need to have line numbers for the text formatted in two columns.  The
>> numbers for left column shall appear in the left side and that for right
>> column shall appear in the right side of the page.  location=inmargin
>> option to the \setuplinenumbering doesn't help much.  Please take a look
>> at the following image:
>>
>>  http://www.river-valley.com/cvr/one.png
>>
>> which will give you an idea of my requirement.  Any help in this matter
>> will be highly apprecaited and thanks in advance.
>>     
>
> I do not know how to automate what you want. An ugly solution is to 
> specify the column breaks yourself, something like
>
> \unprotect
> \def\dosetuplinenumbering[#1]%
>    {\getparameters[\??rn][\c!start=1,\c!step=1,#1]%
> %    \global\linenumber\plusone
> %    Do not reset linenumber. Why is this here?
>    }
> \protect
>
>
> \starttext
> \startcolumns
> \setuplinenumbering[location=inleft]
>    \startlinenumbering
>      \input knuth
>    \stoplinenumbering
>    \column
>    \setuplinenumbering[location=inright]
>    \startlinenumbering[continue]
>      \input knuth
>    \stoplinenumbering
> \stopcolumns
> \stoptext
>   

proof of concept:

\newcounter\TestNumber

\let\normaldodoplacelinenumber\dodoplacelinenumber

\def\dodoplacelinenumber
  {\doglobal\increment\TestNumber
   \xypos{lnm:\TestNumber}%
   \ifdim\MPx{lnm:\TestNumber}>.5\makeupwidth
      \swapmacros\inleftmargin\inrightmargin
   \fi
   \normaldodoplacelinenumber}

\setuplinenumbering[location=inleft]

\startcolumns
\startlinenumbering
\input tufte \endgraf
\input tufte \endgraf
\input tufte \endgraf
\stoplinenumbering
\stopcolumns

\stoptext

in order to let this work ok (spacing) we need to write a nice patch (and also use the opportunity to clean up some code) which will take a couple of hours, so not today .. 

Hans  



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2006-09-07 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-07  4:43 [Fwd: Line numbering] CV Radhakrishnan
2006-09-07  5:48 ` Aditya Mahajan
2006-09-07 16:22   ` 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).