[comp.text.tex] How do I prevent a page break at the beginning of a list in LaTeX?

pnr@ngs.fi (Pekka Nikander) (12/07/90)

The subject says it all.  

I have text like this:

   blah blah blah
   % what the hell to put here?
   \begin{itemize}    
     \item xyzzy xyzzy xyzzy

How do I prevent a page break at the comment, i.e between "blah blah
blah" and \begin{itemize}.  \nopagebreak does not work, \nobreak does
not work etc.

What do I do wrong?

--
Pekka Nikander                              Internet: pnr@ngs.fi -or-
Finnish Unix systems User Group (FUUG)                Pekka.Nikander@ngs.fi
Helsinki Unixversity of Technology   

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (12/07/90)

pnr@ngs.fi (Pekka Nikander) writes:


>The subject says it all.  

[ example deleted ]

>What do I do wrong?

Nothing. This is one of those cases where Lamport's macros
are quite strong, and overrule much everything that you try.

What happens is that the list environment places a penalty
\@beginparpenalty. Therefore, setting this to a high value
should do it.

\makeatletter \@bginparpenalty=10000 \makeatother
is a piece of code that does it.

Victor.
 

pnr@ngs.fi (Pekka Nikander) (12/07/90)

In article <1990Dec7.033946.8347@csrd.uiuc.edu> eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) writes:
>>The subject says it all.  
>>What do I do wrong?

>  Nothing. This is one of those cases where Lamport's macros
>  are quite strong, and overrule much everything that you try.

>  What happens is that the list environment places a penalty
>  \@beginparpenalty. Therefore, setting this to a high value
>  should do it.

Thanks!  That directed me the right way, I found the right place in
the latex code.  Now, if I want to prevent the page break only in some
places (not everywhere), there seems to be another way: to place
\@nobreaktrue just before the beginning of list.  If \@nobreak is
true, the penalty is not added but \@nbitem is executed.  \@nbitem
does not seem to be used anywhere else, so I think I can redifine it
if I wish.  In standard LaTeX \@nobreaktrue is only called after
section and chapter headings.

So, I went on and defined in own.sty a new macro:

\def\nopgbrk{\@nobreaktrue}

Thanks again!

--
Pekka Nikander                              Internet: pnr@ngs.fi -or-
Finnish Unix systems User Group (FUUG)                Pekka.Nikander@ngs.fi
Helsinki Unixversity of Technology