# How to adjust last text on last page dynamically? [closed]

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.

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

-
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 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 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 at 15:20
@manish I think you should really provide an MWE. :-) –  hpesoj626 Jan 26 at 15:37

## closed as not a real question by lockstep, Kurt, Martin Schröder, diabonas, GuidoFeb 15 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.

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.

-