# Whitespace that breaks across pages (e.g. for handwritten answers)

I'm creating a document where I want to leave white space of varying heights, e.g. for handwritten answers to questions.

It doesn't matter whether this empty space is bordered or not.

The key thing is that it needs to break across pages, so if I asked for a space of height 6in, but there was only 3in left on the page, I would get 3in on the first page and 3in on the next.

For instance I saw someone use this code here

\def\boxpar[#1]#2#3{{\setlength{\fboxsep}{-\fboxrule}\fbox{\parbox[][#2][t]{#1}{\mbox{}\\[-.125\baselineskip]\mbox{}~#3}}}}

\boxpar[\hsize]{6in}{}


which will create a bordered box 6in tall and the width of the page as required, but if there is not enough space on the first page it will move the whole thing to the next page.

-
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Jubobs May 1 '13 at 8:20

Just produce paragraphs, that don't disappear. In order to specify any dimension, just make many of them.

\documentclass{article}
\usepackage{lipsum}

\par\smallskip
\begingroup
\if#1r\hrule\fi
\baselineskip=\dimexpr#2/100\relax
\lineskip=0pt \parindent=0pt
\count255=0
\loop\ifnum\count255<100
\leavevmode\vbox to\baselineskip{}
\if#1r\vrule\hfill\vrule\fi\endgraf
\repeat
\if#1r\hrule\fi
\smallskip
\endgroup
}

\begin{document}
\lipsum[1]

\lipsum[2]

\lipsum[3]
\end{document}


With \answerspace[r]{<length>} rules are made.

-
Exactly what I was looking for and I appreciate the option to rule or not. –  James May 1 '13 at 11:28

Let try to answer the question using the package mdframed. (Github-version: https://github.com/marcodaniel/mdframed -- newer)

The provided command \boxpar has the following syntax:

\boxpar[<number of lines>]{Text}[<width of the box>]


You can the the number and the width are optional.

mdframed cant split across pages using a simple\vspace. Therefor the loop is needed.

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}

\newcounter{tempcount}
\NewDocumentCommand \boxpar {  O{3} m O{\linewidth} }{%
\begin{mdframed}[align=center,innertopmargin=.4cm,userdefinedwidth=#3]
\setcounter{tempcount}{0}
\loop\ifnum\value{tempcount}<#1
\rule{0pt}{\baselineskip}\\[2pt]
\stepcounter{tempcount}
\repeat
\ifx\relax#2\relax\else#2\fi
\end{mdframed}%
}
\begin{document}
\lipsum[1]

\boxpar{}

\lipsum[2]

\boxpar[10]{}[8cm]

\boxpar[6]{3 Points}[8cm]
\end{document}


If you want to modify the style of the frame you can do this by options of mdframed

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\mdfdefinestyle{boxpar}{linewidth=2pt,backgroundcolor=gray!10,roundcorner=10pt,}
\usepackage{lipsum}

\newcounter{tempcount}
\NewDocumentCommand \boxpar {  O{3} m O{\linewidth} }{%
\begin{mdframed}[align=center,innertopmargin=.4cm,userdefinedwidth=#3,style=boxpar]
\setcounter{tempcount}{0}
\loop\ifnum\value{tempcount}<#1
\rule{0pt}{\baselineskip}\\[2pt]
\stepcounter{tempcount}
\repeat
\ifx\relax#2\relax\else#2\fi
\end{mdframed}%
}
\begin{document}
\lipsum[1]

\boxpar{}

\lipsum[2]

\boxpar[10]{}[8cm]

\boxpar[6]{3 Points}[8cm]
\end{document}


If you want horizontal lines you can use:

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\mdfdefinestyle{boxpar}{linewidth=2pt,backgroundcolor=gray!10,roundcorner=10pt,}
\usepackage{lipsum}

\newcounter{tempcount}
\NewDocumentCommand \boxpar {  O{3} m O{\linewidth} }{%
\begin{mdframed}[align=center,innertopmargin=.4cm,userdefinedwidth=#3,style=boxpar]
\setcounter{tempcount}{1}
\loop\ifnum\value{tempcount}<\numexpr#1+1\relax
%       \rule{0pt}{\baselineskip}\\[2pt]
\the\value{tempcount}\rule{\linewidth}{.8pt}\\[2pt]
\stepcounter{tempcount}
\repeat
\ifx\relax#2\relax\else#2\fi
\end{mdframed}%
}
\begin{document}
\lipsum[1]

\boxpar{}

\lipsum[2]

\boxpar[10]{}[8cm]

\boxpar[6]{3 Points}[8cm]
\end{document}


You can also add a title:

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}

\newcounter{tempcount}
\NewDocumentCommand \boxpar {  O{3} m O{\linewidth} }{%
\begin{mdframed}[align=center,innertopmargin=.4cm,userdefinedwidth=#3,style=boxpar]
\setcounter{tempcount}{0}
\loop\ifnum\value{tempcount}<#1
\rule{0pt}{\baselineskip}\\[2pt]
\stepcounter{tempcount}
\repeat
\ifx\relax#2\relax\else#2\fi
\end{mdframed}%
}
\begin{document}
\lipsum[1]

\boxpar{}

\lipsum[2]

\boxpar[5]{}[8cm]

\boxpar[6]{3 Points}[8cm]
\end{document}


-
Thanks for this answer as well, tried using mdframed earlier but struggled with it, so this is a helpful example for future reference! –  James May 1 '13 at 11:25
@James: If you have any trouble you can contact the author ;-) -- me ;-) –  Marco Daniel May 1 '13 at 11:32

Remove the \vrule\strut\hfill\vrule If you don't want the lines either side.

\documentclass{article}

\def\blanklines#1{%
\ifnum#1>0
\par\noindent\mbox{}\vrule\strut\hfill\vrule\par%
\expandafter\blanklines\expandafter{%
\the\numexpr#1-1\expandafter\relax\expandafter}%
\fi
}

\begin{document}

stuff

more stuff\par more stuff\par more stuff\par more stuff\par more stuff\par

\blanklines{16}

more stuff\par more stuff\par more stuff\par more stuff\par more stuff\par

\blanklines{25}

more stuff\par more stuff\par more stuff\par more stuff\par more stuff\par

\end{document}
`
-