Given a macro

% bold task titles
\newcommand{\mypar}[1]{{\bf #1:}}

%task decription template
    \mypar{#1} #2 \\
    \emph{Solution:} #3\\

I should like for the text generated by a task macro to be an atomic unit. I.e. it either fits entirely into the space left on a page or all of it (and everything following it) is pushed to the next page.

What can I do to this macro to enforce this?

  • Enclose it in \begin{samepage}...\end{samepage}. Commented Jan 26, 2016 at 8:37
  • Nope, that doesn't do anything, I'm afraid.
    – User1291
    Commented Jan 26, 2016 at 8:46


Browse other questions tagged .