determinenoflines

From Wiki
Revision as of 22:32, 19 March 2021 by Dain88 (talk | contribs) (Created page with "<inputbox> type=create width=100 break=no buttonlabel=Create new article default=determinenoflines </inputbox> determinenoflines calculates the number of lines of the giv...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Unfortunately, it is not compiled in this wiki. If you run the following code with the latest LMTX(ConTeXt ver: 2021.03.17 LMTX), then you will see the lines.

 
\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,distance=.5em,separator=:]{first}
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}

\stoptext