Difference between revisions of "determinenoflines"

From Wiki
Jump to navigation Jump to search
(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...")
 
 
Line 36: Line 36:
  
 
== interesting example of Hans using \determinenoflines. ==
 
== 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>  
 
<texcode>  
Line 49: Line 47:
 
\starttext
 
\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},
 
\fillinrules[n=\determinednoflines{\getbuffer},
width=fit]{first}
+
width=3cm,distance=.5em,separator=:]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
 
width=broad]{first}
 
\fillinrules[n=\determinednoflines{\getbuffer},
 
width=3cm,distance=.5em,separator=:]{first}
 
 
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}
 
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}
  
Line 64: Line 64:
 
<context mode=lmtx>  
 
<context mode=lmtx>  
 
\def\determinednoflines#1%
 
\def\determinednoflines#1%
{\localcontrolled{\determinenoflines{#1}}\noflines}
+
{\beginlocalcontrol\determinenoflines{#1}\endlocalcontrol\noflines}
  
 
\startbuffer
 
\startbuffer
  \input tufte
+
  \input tufte
 
\stopbuffer
 
\stopbuffer
 
+
\startTEXpage[width=15cm]
\startTEXpage
 
 
 
 
%\fillinrules[n=\determinednoflines{\getbuffer},
 
%\fillinrules[n=\determinednoflines{\getbuffer},
% width=fit]{first}
+
%width=fit]{first}
 
%\fillinrules[n=\determinednoflines{\getbuffer},
 
%\fillinrules[n=\determinednoflines{\getbuffer},
% width=broad]{first}
+
%width=broad]{first}
 
%\fillinrules[n=\determinednoflines{\getbuffer},
 
%\fillinrules[n=\determinednoflines{\getbuffer},
% width=3cm]{first}
+
%width=3cm]{first}
%\fillinrules[n=\determinednoflines{\getbuffer},
+
\fillinrules[n=\determinednoflines{\getbuffer},
% width=3cm,distance=.5em,separator=:]{first}
+
width=3cm,distance=.5em,separator=:]{first}
 
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}
 
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}
 +
\stopTEXpage
  
\stopTEXpage
 
 
</context>
 
</context>

Latest revision as of 00:32, 20 March 2021

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