# [texhax] nopagebreak not working

Paul Tremblay phthenry at iglou.com
Tue Apr 11 01:08:18 CEST 2006

Responding to my own email, I found this:

\nopagebreak does not suppress the page breaks that are deliberately
inserted around environments like {center}. You have three options:

http://www.cse.iitd.ernet.in/~anup/homepage/UNIX/latex.html#pagebreaksuppress

Is this a bug? According to my somewhat outdated book on LaTeX by
Kopka and Daly, the \nopagebreak[4] should make a page break
"absolutely impossible here."

I have found that I can use the \needspace command, but this also
presents problems, because I don't now how much space. If my title is
long, it will need more space; if I use space before and after my
title, I will also need more space. For the space after and before, I
could write code to accommodate this situation:

\newlength{\myneedspace}
\setlenth{\myneedspace}{3ex}
\needspace{\myneedspace}

The problem is how to figure out how much space my actual title takes.
It is beyond my weak LaTeX skills to calculate length (or acually,
depth or height) based on some text and then add it to needspace.
Such code would be better off in a macro, I think. At any rate,
shouldn't I just be able to set some type of penalty really high to
tell LaTeX not to break after my title?

Thanks

Paul

--

************************
*Paul Tremblay         *
*phthenry at iglou.com    *
************************