[Tex/LaTex] Why does a linebreak in minipage flow this to the next page

minipagespacingzwpagelayout

I am using zwpagelayout (see this question) but if I put a minipage with a line or paragraph break, I get weird two-page output.

\documentclass{article}
\usepackage[papersize={,10.5in},spine=1in,cropmarks,textwidth=7in,topmargin=.5in,leftmargin=0in,nopagenumbers,color]{zwpagelayout}
\begin{document}
\pagestyle{empty}
\hbox to \textwidth{%
  \vbox to \textheight{\hsize \UserWidth \centering
\begin{minipage}{5in}
This\\
Overflows
\end{minipage}

}\hss
\vbox to \textheight{\hsize \CropSpine \centering
        }\hss
\vbox to \textheight{\hsize \UserWidth \centering
}\hss}
\end{document}

How do I use linebreaks in a minipage in this case?

Best Answer

As David said in the comments, just a minipage is enough. Although this is omitted in many tutorials, you can also fix the height of the minipages, so you do not need at all vertical boxes of \textheight, since it is possible for a minipage take even the complete text area of a single page (for example, to make the cover).

mwe

\documentclass{article}
\usepackage[papersize={6in,5in},spine=1in,cropmarks,  
textwidth=5in,topmargin=.5in,leftmargin=.25in,
nopagenumbers,color]{zwpagelayout}
\begin{document}
\pagestyle{empty}
\fboxsep10pt\fboxrule1pt
\fcolorbox{black}{yellow}{
\begin{minipage}%
[t][\dimexpr\textheight-21pt]%
[t]{\dimexpr\textwidth-21pt}%
This\\
Not\\
Overflows
\end{minipage}}
\end{document}
Related Question