On 3/16/2021 8:08 PM, Jeong Dal wrote:
Dear Hans,
I found a command \determinenoflines by googling.
I made a MWE as following. It is working well.
But I have to write the paragraph twice for couning.
Is there a better way?
Thank you again.
Best regards,
Dalyoung
%%%%%%%
\def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}
\def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[\the\noflines*line
+ \the\noflines*halfline]}}
\enablemode[hideSolution]
\starttext
The first line.
\hrule
\StartHide
\samplefile{knuth}
\determinenoflines{\samplefile{knuth}}
\StopHide
\hrule
The second line.
\hrule
\StartHide
\samplefile{ward}
\determinenoflines{\samplefile{ward}}
\StopHide
\hrule
The last line.
\stoptext
Let me show you some magic ...
\def\determinednoflines#1%
{\localcontrolled{\determinenoflines{#1}}\noflines}
\startbuffer
\input tufte
\stopbuffer
\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}
i'll make a better hider later
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________