determinenoflines

From Wiki
Jump to navigation Jump to search

determinenoflines calculates the number of lines of the given text. For example,

\startbuffer
  \input tufte
\stopbuffer

\starttext
\determinenoflines{\getbuffer}

The number of the lines given text is $\the\noflines$.
\stoptext


interesting example of Hans using \determinenoflines.

 
\def\determinednoflines#1%
 {\localcontrolled{\determinenoflines{#1}}\noflines}

\startbuffer
   \input tufte
\stopbuffer

\starttext

%\fillinrules[n=\determinednoflines{\getbuffer},
%width=fit]{first}
%\fillinrules[n=\determinednoflines{\getbuffer},
%width=broad]{first}
%\fillinrules[n=\determinednoflines{\getbuffer},
%width=3cm]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
width=3cm,distance=.5em,separator=:]{first}
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}

\stoptext