My question is essentially the same as How to prevent a page break before an itemize list?. First, I don't undestand how the proposed solution (\par\nobreak\@afterheading
) works. Why doesn't just \par\nobreak
work? \nobreak
should put there impossible penalty to pagebreak at the following glue. What does \@afterheading
do?
Another thing is that it seems that the solution consumes the space between the paragraph and itemize environment. Minimal example showing the problem follows.
\documentclass[12pt, a4paper]{article}
\makeatletter
\newcommand*{\NoBreakPar}{\par\nobreak\@afterheading}
\makeatother
\begin{document}
Let's see the following list:\NoBreakPar
\begin{itemize}
\item First.
\item Second.
\item Third.
\end{itemize}
\end{document}
\nobreak
is overridden by coding defined in the beginning of (all) lists;\@afterheading
counteracts this. but the removal of space before theitemize
does appear to be a real problem; that should be the subject of this question, and a small example would help. (by the way,enumitem
is irrelevant here, and i've removed that flag.)@username
comment to the relevant user who posted the question and ask him/her for more explanation. I am sure, you will be answered.the user who posted the answer
...enumitem
tag, because bothitemize
andenumitem
are examples of the general problem.