General ⇒ Newbie question about pagebreaks
Newbie question about pagebreaks
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Newbie question about pagebreaks
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
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: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Newbie question about pagebreaks
the needspace package provides commands that could help. The documentation is contained in needspace.sty itself.
Stefan
Re: Newbie question about pagebreaks
That does exactly what i want.
R