Hi all,
I'm a newbie to latex and have been plugging away for about 3 weeks.
I have an issue where I want to ensure that some sections of text do not have a page break in them.
How can I force them on to a new page? I know I can add a page break before the section, but I want this to be done automatically at build time, i.e. the latex builder sees that there is a page break in this section of text and then moves the entire section to a new page.
Is this possible? If so how can I do it? Or I am I going about this the wrong way?
I suppose it's some sort of global document setting I'm looking for.
R
General ⇒ Newbie question about pagebreaks
NEW: TikZ book now 40% off at Amazon.com for a short time.

Newbie question about pagebreaks
I've had this problem a lot myself. I have found the samepage environment useful here (though there are apparently other ways to do this as well.
You can do something like this I think:
You can do something like this I think:
Code: Select all
\begin{samepage}
lots of stuff that
should stay together
\end{samepage}
Newbie question about pagebreaks
Thanks for the info. But it doesn't work for me.
Here's what I'm trying
This occurs at the end of a page and becomes split just after the index.
When I put the code in the samepage env nothing happened
Here's what I'm trying
Code: Select all
\begin{samepage}
\hypertarget{thislink}{
\index{index1}
\index{index2}
\paragraph[{Text}]{\setlength{\rightskip}{0pt plus 5cm}\texttt{text}( {\em text})}\hfill}
\label{thislabel}
Blah blah
\begin{Desc}
\item[\texttt{text}]
\begin{description}
\item[\mbox{$\leftarrow$} {\em sec}]Float \end{description}
\end{Desc}
\begin{Desc}
\item[\texttt{text}]None
\begin{Code}\begin{verbatim}
Blah Blah
\end{Desc}
\begin{Desc}
\item[]
Blah
\end{Desc}
\end{samepage}
When I put the code in the samepage env nothing happened
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Newbie question about pagebreaks
Hi Ronanj,
the needspace package provides commands that could help. The documentation is contained in needspace.sty itself.
Stefan
the needspace package provides commands that could help. The documentation is contained in needspace.sty itself.
Stefan
LaTeX.org admin
Re: Newbie question about pagebreaks
thanks.
That does exactly what i want.
R
That does exactly what i want.
R