Page LayoutSingle lines in document

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
k123123
Posts: 6
Joined: Tue Aug 20, 2013 12:35 pm

Single lines in document

Post by k123123 »

Hi,
I'm writing a thesis which has mostly text and figures. Figures are inserted as [htbp] or [hbp] if I want to push it to the bottom. Often I will get a page with a single line of text, then a figure (might be half a page -- ie small enough for Latex to want to place the float 'inline'), then the next \section{} heading immediately below the figure.

Question -- how do I stop a single line appearing like this? Partly it is ugly; partly it is distracting; and partly, it is easy to miss this line because you immediately start looking at the figure at the (almost) top of the page. I searched a bit but I can only find info on 'widow/orphan' penalties; but this is not exactly the problem I have, since the text isn't on an otherwise empty page.

Is there a penalty I can set that forces Latex NOT to make a pagebreak on the previous page, and just include that extra line there.

Thanks

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Single lines in document

Post by Johannes_B »

Hi, there are penalties concerning such things (Controlling widows and orphans), but i guess something is wrong in your workflow. Could you try do prepare a minimal working example? This is extremely helpful to reproduce and understand the error.
The package mwe can help you with this.

How do you start a new paragraph? Are you using a blank line (that would be correct) or a double backslash \\ (that would be wrong)?

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
k123123
Posts: 6
Joined: Tue Aug 20, 2013 12:35 pm

Re: Single lines in document

Post by k123123 »

Sorry I don't understand what you mean by "workflow"...?

Thank you for the link -- I will look into that in more detail. So the widow/orphan penalty is not just for new (blank) pages, it applies when *any* paragraph is split to the next page? I didn't realise that.

I am starting a new paragraph with an empty line, not with \\, is that ok?
(I am also using the package 'parskip' so that new paragraphs are not indented)

I'll look into making a MWE, but everytime I make a small change it appears the layour changes, so sometimes this appears and sometimes not... I'll repost something when I see it next

Thanks for the quick reply
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Single lines in document

Post by Johannes_B »

If you are not able to reproduce this behaviour in form of an MWE (that is quite hard in this case), maybe a screenshot can help, with the code that produces it from your original code. This would not be an MWE, since we cannot reproduce it by compiling.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply