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 346 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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
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