[OS X TeX] Avoiding page breaks

Chris Goedde cgg.lists at gmail.com
Wed Apr 16 20:14:26 CEST 2008


On Apr 16, 2008, at 11:57 AM, Toke Lindegaard Knudsen wrote:

> -----
> \newenvironment{versetxt}[2]
> {
>   \begin{center}$\sim$ {\sc #2} $\sim$\end{center}\Nopagebreak%
>     ({#1}) \begin{large}\begin{bf}
> }
> {
>   \end{bf}\end{large}\\ \mbox{}
> }
> -----

You might not care because you found another solution, but my testing  
shows that the code below works. The problem is that the center  
environment is allowing for a break before TeX ever encounters  
\Nopagebreak.

\newenvironment{Center}{\begin{center}}{\Nopagebreak\end{center}}

\newenvironment{versetxt}[2]
{
   \begin{Center}$\sim$ {\sc #2} $\sim$\end{Center}\Nopagebreak%
     ({#1}) \begin{large}\begin{bf}
}
{
   \end{bf}\end{large}\\ \mbox{}
}

-- 
Chris




More information about the macostex-archives mailing list