I'm sure I'm not the first one to run into this problem, but I couldn't find any other question that quite answered this in a way that worked for me.
I would like to insert a section heading in the same column if there's sufficient space and kick it to the next column if there is not; I've succeeded in this by setting penalties in the appropriate places. However, when a column break is necessary, I'd like to fill the previous column, so that \parskip
doesn't stretch crazily.
Turning of \parskip
for the whole document is not an option, or the columns do not balance.
MWE:
\documentclass[letterpaper]{article}
\usepackage{multicol}
\makeatletter
\def\articulus{%
\vskip 3em plus 0.75em minus 0.25em%
\centerline{\Large\textsc{Articulus }}%
\penalty10000\vskip 3em plus 0.75em minus 0.25em%
\normalsize\@afterindentfalse\@afterheading%
}%
\makeatother
\def\text{Now is the time for all good men to come to the
aid of their party.}
\begin{document}
\begin{multicols}{2}
\text\text\text\text\text\text\text\text\text\text
\text\text\text\text\text\text\text\text\text
\text\text\text
\articulus{}
\text\text\text\text\text\text\text\text\text
\text\text\text\text\text\text\text\text\text
\text\text\text\text\text\text\text\text\text
\text\text\text\text\text\text\text\text\text
\text\text\text\text\text\text\text\text\text
\end{multicols}
\end{document}
I would like to vertically fill the remainder of the column if a pagebreak has to occur here. Is this possible? If not, is there a better way to arrange this?