Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am writing report and now improving look and feel of the report. I found that last section appears in last of page and its remaininng part on next page which does not look good.

enter image description here

How can i move sectinon2 and its content to next page dynamically.

share|improve this question

closed as not a real question by lockstep, Kurt, Martin Schröder, diabonas, Guido Feb 15 '13 at 19:14

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
By default, LaTeX will not insert a page break after the first line of a section. Therefore, please add a minimal working example (MWE). –  lockstep Jan 26 '13 at 11:43
    
I think Enlarge a single page might what you are looking for. (If this alone fixes the issue for you, please comment here so that we can close this question as a duplicate.) –  Martin Scharrer Jan 26 '13 at 12:18
    
No, I need to do it dynamically. My text is variable. It may vary from report to report so i cannot make it fixed. –  manish Jan 26 '13 at 15:20
1  
@manish I think you should really provide an MWE. :-) –  hpesoj626 Jan 26 '13 at 15:37
add comment

1 Answer

up vote 2 down vote accepted

The needspace package provides a means to conditionally insert content based on the amount of space left on a page. In this instance, you might be after a setup like the following:

\documentclass{article}
\usepackage{needspace,lipsum}% http://ctan.org/pkg/{needspace,lipsum}
\begin{document}
\section{First section}\lipsum[1-4]
\needspace{6\baselineskip}% <--------- Need 6 lines of text, or insert a page break
\section{Another section}\lipsum[1-4]
\end{document}

Comment out the line containing \needspace in order to see the difference. You can vary this length to suit your needs, depending on the amount of text that follow \section{Another section}, to avoid seeing widowed lines of text.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.