2

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:

enter image description here

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.. :(

Kayla
  • 1,655
  • 1
    It seems that the whole question doesn't fit in a page, so what do you propose? – egreg Feb 18 '13 at 13:29
  • if the question doesn't fit on one page, so the command would notify that the question will not be allowed to proceed to the next page. – Kayla Feb 18 '13 at 13:46
  • else notify that the user should remove some of the questions. for that to fit the page. – Kayla Feb 18 '13 at 14:25
  • 2
    Hand checking/tweaking required anyway... Smaller interline spacing? Wider margins? Less space between text and the check boxes? Reword some alternatives (or the question) to make them shorter? Designing such a test is a lot of work, and just cutting off stuff for visual layout would be my very last option. – vonbrand Feb 18 '13 at 17:20
  • you could use a minipage, parbox, or vbox for example – cmhughes Feb 18 '13 at 18:13
  • i tried the minipage but 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:30
  • i had lots of question types in my class. how will i make it not letting the sequence of numbers inside a specific question type spill out the first page and place in the next page. That was not ideal. I would like to block it so i'll be notified that the questions are spilling I should lessen those questions to fit on one page. that what all i wanted but i dont have idea in latex on how should do that. Is that a command that will excess in the first page? or command for notification that would allow the user of my class to delete some of the questions created to fit on one page only? help me. – Kayla Feb 19 '13 at 13:53
  • 2
    @Kayla minipage does 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 .log file 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:25
  • @tohecz: so it only means to say that it will always happen the spillovers? because that was what the TeX does? – Kayla Feb 19 '13 at 14:33
  • 3
    TeX is a machine, it does what you say it to do. And if you say it to do something impossible (fit 40 cm in 25 cm), it goes a bit crazy. – yo' Feb 19 '13 at 14:36

0 Answers0