Am 04.03.2012 um 11:20 schrieb Pablo Rodríguez:

> I have asked this question before (more than twice), after I found no
> answer in the ConTeXt reference manual, the wiki or the mailing list.
> 
> I wanted to be able to have in the headers the first and last line
> number from page. This feature is extremely useful when typesetting some
> kinds of poetry.
> 
> The most basic sample would be:
> 
> \starttext
> \startlinenumbering
> \dorecurse{10}{\input zapf\par\input knuth}
> \stoplinenumbering
> \stoptext
> 
> Is that possible to achieve with ConTeXt?


Yes but it’s not usable because the numbers are always shown on the next page.

\definemarking[linenumber]

\define\LinenumberCommand
  {\normalexpanded{\setmarking[linenumber]{\linenumber}}}

\setuplinenumbering[command=\LinenumberCommand]

\startsetups linenumber

        \doiftext {
                \getmarking[linenumber]
        }
        {
                \getmarking[linenumber][first] – \getmarking[linenumber][last]
        }

\stopsetups

\setupheadertexts[\texsetup{linenumber}]

\starttext

\dorecurse{6}{\input tufte\par}

\startlinenumbering
\dorecurse{20}{\input knuth\par}
\stoplinenumbering

\resetmarking[linenumber]

\dorecurse{6}{\input tufte\par}

\stoptext

Wolfgang
___________________________________________________________________________________
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 via email to