i learned of the samepage environment based from this link Unbreakable block so i tried it on my case but i think this isn't what I am looking for. My problem is: with the exam class, i have created a test question true or false. The questions would rather continue to the next page without knowing the exact number of questions that is only allowed. These should not be the case. What I want is, a command that will prevent question continuation to the next page and pops out an error notification that the question will break. Is there any suggested variables which should i include in my command.
Code
\documentclass{exam}
\newcounter{tfno}
\renewcommand\arraystretch{2}
\newcommand{\nbox}{\resizebox{.5cm}{!}{\raisebox{-.5ex}{$\Box$}}}
\newenvironment{truefalse}{%
\setcounter{tfno}{0}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\begin{longtable}{>{\stepcounter{tfno}\thetfno.}cp{.5
\textwidth}@{\extracolsep{\fill}}cc}
\multicolumn{1}{r}{}& & \fbox{\parbox{.75cm}{True}} & \fbox{\parbox{.75cm}
{False}} \
}{%
\end{longtable}
}
\newcommand\tfquestion[1]{ & #1 & \nbox & \nbox \}
\begin{document}
\begin{truefalse}
\tfquestion{Is this the first question?}
\tfquestion{2nd question}
\tfquestion{this series of questions for the true or false, if it reach the
nextpage, the command should prevent it.}
\end{document}
this is an example image:

As you can see the next page was the continuation of the question. What should I do to prevent this. I'd rather be favor of making a command for this error but i dont know how. pls help.. :(
minipage,parbox, orvboxfor example – cmhughes Feb 18 '13 at 18:13minipagebut it grabs the whole question type t/f to the next page which results the first page has no more text and all the text are on the second page. – Kayla Feb 19 '13 at 06:30minipagedoes that because this is what TeX does. Once something doesn't fit on "this page", it is typeset on "next page", no matter whether it does fit or not. And you are notified, by a warning in the.logfile and in the compilation log:Overfull \vbox (<spill-length>pt too high) has occurred while \output is active [<page number>], where<spill-length>tells how much too large it is (1 line is 12--14pt) and<page-number>is a number of the page where it happened. – yo' Feb 19 '13 at 14:2540 cmin25 cm), it goes a bit crazy. – yo' Feb 19 '13 at 14:36