Page LayoutProblems with \pagebreak. Alternatives?

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
TheNinjaWizard
Posts: 7
Joined: Sun May 15, 2011 11:33 pm

Problems with \pagebreak. Alternatives?

Post by TheNinjaWizard »

Tried to search for this, but for some mysterious reason there is a character limit in the search bar.

Anyway:
In my document, I would like to have a very specific page break rule at certain points:
If it's less than half a page left, then start a new page.

I found \pagebreak, and I thought that could work with a low priority, but \pagebreak[4] works exactly like \newpage, which is useless to me, and \pagebreak[3] through \pagebreak[0] don't seem to do anything at all.

Any suggestions to what I can do?
I suppose writing some custom environment would be the best thing, but that is beyond my LaTeX capabilities.

Oh, and a preemptive comment:
Please don't tell me I should do what LaTeX wants because it "knows best". This document is only going to be read by me, so any standard typography conventions are completely irrelevant. ;)
Last edited by TheNinjaWizard on Mon May 16, 2011 8:45 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Problems with \pagebreak. Alternatives?

Post by Stefan Kottwitz »

Hi,

welcome to the board!

You could use the needspace package for that, such as

Code: Select all

\needspace{.5\textheight}
...
If there's not enough space as requested, a page break would be inserted.

Stefan
LaTeX.org admin
TheNinjaWizard
Posts: 7
Joined: Sun May 15, 2011 11:33 pm

Re: Problems with \pagebreak. Alternatives?

Post by TheNinjaWizard »

Thanks for the welcome and the tip! That was exactly what I was looking for.

Btw. I also got the \pagebreak to work by including a blank line after the command, but it was nowhere near sufficient.

But, all is well now. :)
Cheers again!
Guillaume
Posts: 8
Joined: Mon Aug 29, 2011 1:27 pm

Problems with \pagebreak. Alternatives?

Post by Guillaume »

This is the preamble and code:

Code: Select all

\documentclass[12pt,a4paper]{book}
\usepackage[polutonikogreek,english]{babel}
\newcommand*{\tg}[1]{\textgreek{#1}}
\usepackage{ledmac}
\usepackage{fancyhdr}
\pagestyle{empty}
\usepackage{multind} 
\makeindex{nominum}
\makeindex{rerum}

\input{style}
\raggedbottom
\begin{document}
\mainmatter
\beginnumbering

\pstart
text
\pagebreak
text
\pend
\endnumbering
\printindex{nominum}{Index nominum}
\printindex{rerum}{Index rerum}
\end{document}
I just don't know why it doesn't work. Many thanks, this is driving me crazy!
Last edited by Stefan Kottwitz on Tue Aug 30, 2011 7:45 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Problems with \pagebreak. Alternatives?

Post by Stefan Kottwitz »

Hi Guillaume,

welcome to the board!
Use \pend before and \pstart after \pagebreak to make it work:

Code: Select all

\beginnumbering
\pstart
text
\pend
\pagebreak
\pstart
text
\pend
\endnumbering
Stefan
LaTeX.org admin
Post Reply