1,789 bytes added
, 22:32, 19 March 2021
<inputbox>
type=create
width=100
break=no
buttonlabel=Create new article
default=determinenoflines
</inputbox>
[[determinenoflines]] calculates the number of lines of the given text. For example,
<texcode>
\startbuffer
\input tufte
\stopbuffer
\starttext
\determinenoflines{\getbuffer}
The number of the lines given text is $\the\noflines$.
\stoptext
</texcode>
<context mode=lmtx>
\startbuffer
\input tufte
\stopbuffer
\startTEXpage
\determinenoflines{\getbuffer}
The number of the lines given text is $\the\noflines$.
\stopTEXpage
</context>
== 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.
<texcode>
\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
</texcode>
<context mode=lmtx>
\def\determinednoflines#1%
{\localcontrolled{\determinenoflines{#1}}\noflines}
\startbuffer
\input tufte
\stopbuffer
\startTEXpage
%\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}
\stopTEXpage
</context>