Page LayoutCurrent Page Layout

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
rgrice
Posts: 10
Joined: Fri Mar 09, 2012 2:25 pm

Current Page Layout

Post by rgrice »

Hi,

Can anyone help me? I need to be able to \clearpage if say the current position is 0.9\textheight to stop content being split across pages. I've attached a minimal working example minimal.tex to illustrate the problem ... when it is rendered in MiKTex the record header (\basicRecordHeader) is split over page 1 and 2. I need to be able to insert a \clearpage or \newpage so the second record moves to the beginning of the second page. I've tried using \widowpenalty=10000 and \clubpenalty=10000 but this doesn't work.
What I really need to be able to do is programmatically 'test' and see if the current position is say 0.95\textheight (or whatever the position is relative to the \textheight) and add a \clearpage

Any help would be really appreciated.
Attachments
minimal.tex
Minimal working example.
(9.37 KiB) Downloaded 362 times
Last edited by localghost on Fri Mar 09, 2012 5:16 pm, edited 1 time in total.

Recommended reading 2024:

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

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

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

Current Page Layout

Post by Stefan Kottwitz »

Hi,

you could use the needspace package. With your example (very good that you posted one):

Code: Select all

\usepackage{needspace}
\newcommand{\basicRecord}{%
  \needspace{.1\textheight}
  ...
For details, have a look at the needspace manual.

Stefan
LaTeX.org admin
rgrice
Posts: 10
Joined: Fri Mar 09, 2012 2:25 pm

Re: Current Page Layout

Post by rgrice »

Thank you so much Stefan ... I'll give it a try. I find it very encouraging that people like yourself are prepared to take time to help others like this ...
rgrice
Posts: 10
Joined: Fri Mar 09, 2012 2:25 pm

Re: Current Page Layout

Post by rgrice »

Yes that works !!!! Thanks again and keep up the good work :D
Post Reply