# Restrict total height/length of text

I have a large chunk of text that's currently being used in my template, I want to programmatically split this over too pages.

The text is first put into a textbox onto a page and needs to be restricted to a certain size (8 lines or so). The rest of the text needs to put into a variable or something on the following page.

Not exactly sure how I can implement this since the text overflows the boxes no matter I tend to find in there.

• Consider reading up on \vsplit in TeX by Topic. – Werner Sep 25 '13 at 14:21

Thanks werner here is my solution with a MWE (sorry for any mistakes i'm copying off a computer without internet access)

\documentclass{article}
\usepackage{blindtext}
\begin{document}
\newbox{\testbox}
\newbox{\partialbox}
\setbox\testbox=\vbox{\blindtext[3]}
\ifdim\ht\testbox>2in
\setbox\partialbox=\vsplit\testbox to 2in
\unvbox\partialbox
Continued on the next page... (yes i know it's not the next page)
\else
\unvbox\testbox
\fi

\ifvoid\testbox
{}
\else
\unvbox\testbox
\fi
\end{document}