Page Layout ⇒ not enough space for chapter
not enough space for chapter
sometimes happens to me, that a chapter title is at the very bottom of the page and the content of the chapter is on the new page.
This does not look nice. Is there any way, how to tell latex to move the whole chapter to the new page, if there is not enough space in the current page?
I can use \pagebreak, but this "manual" aproach can be tricky...
also I googled samepage, but I am looking for something that can be applied globally on the whole document
thanks a lot
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
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
not enough space for chapter
\chapter. Do you mean \section? Or which command shows the problem here?Stefan
Re: not enough space for chapter
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
not enough space for chapter
\chapter starts a new page by itself and is always on top. Normally a section heading should also not be at the end of a page. Do you have a small example document showing such a behavior, with your class and your settings resp. preamble?Stefan
Re: not enough space for chapter
but here is a sample document with my preamble and it shows what I want to change in latex settings - there is a section with only 2 lines of content and then a page break
- Attachments
-
- sample.tex
- (2.85 KiB) Downloaded 331 times
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
not enough space for chapter
Well, in any case you could use the
needspace package, even if you don't like this case of the example.Code: Select all
\usepackage{needspace}
...
\needspace{4\baselineskip}
\section{test}Stefan
not enough space for chapter
thanks a lot
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
not enough space for chapter
Code: Select all
\usepackage{needspace}
\usepackage{etoolbox}
\patchcmd{\section}{\@startsection}{\needspace{4\baselineskip}\@startsection}{}{}