Based on the video available here : http://www.youtube.com/watch?v=vkBCeOBbAmM I try to understand what the following code does

\hsize= 5cm

\setbox0=\vsplit\galley to\z@}

to #1\baselineskip}

unfortunately, I am not sucessful. In the video, he speaks about "floating, scrolling text" which you can cut in pieces and place the different pieces in the page. But I fail to understand how to do that with the previous code lines. I begin in macro writing so it could be I do not understand because I do not undestand the effect of the different commands put under these macros.

I tried

\text blablablabla \endtext

to check the effect but the page does not display any text at all then.


Here's a working example:

\input plipsum

  \hsize=10cm \hrule height 0pt}

  \setbox0=\vsplit\galley to \z@}

\def\lines#1{\vsplit\galley to #1\baselineskip}

\lipsum 1,3

\noindent{\bf Four lines:}\par\medskip



\noindent{\bf Five lines:}\par\medskip



The big text has much more than nine lines. We gather it in a \vbox, then chop off the initial (invisible) rule. With \lines{x} we can chop x lines from the top of the paragraph and set them in a box which we can do anything with. In the example we just print it.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.