I am struggling to remove unwanted space between two paragraphs in Lyx.
The last line at the top and the first line at the bottom (both marked blacked) in the attachment show unwanted white space which i need to remove. The same is happening between a table and the new paragraph that starts below it.
Graphics, Figures & Tables ⇒ Unwanted space between text and table in Lyx
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Unwanted space between text and table in Lyx
It seems that you are using a class with settings that try to fill a page equally. That's desirable for a book which is printed two-sided, for example. So, if necessary, LyX (LaTeX) stretches vertical whitespace so the page ends at the same place on every page. For normal text, this is often fine, since it is distributed over several stretchable spaces on the page.
In a case, when we have a very bad page break, which means like 10 cm white space at the page, this stretch looks crazy. So, you could improve the page break, or disable that vertical page balancing.
It could be that you use figures or tables without floating. So they would not move within the text for better page breaks. I could tell you more, if you would post a LaTeX exported file as attachment here.
Switching of vertical balancing is easy: simply add
Stefan
In a case, when we have a very bad page break, which means like 10 cm white space at the page, this stretch looks crazy. So, you could improve the page break, or disable that vertical page balancing.
It could be that you use figures or tables without floating. So they would not move within the text for better page breaks. I could tell you more, if you would post a LaTeX exported file as attachment here.
Switching of vertical balancing is easy: simply add
\raggedbottom
to the document preamble. I just recommend to check the page break situation at that pass though, such as: what comes directly after that page with the big spaces.Stefan
LaTeX.org admin
Re: Unwanted space between text and table in Lyx
Hi Stefan,
Thanks for the reply, I am using RevTex 4.1 document class but with custom class option of aip,preprint.
I observed that in both the cases where a large space is present between the table and the paragraph or between two paragraphs, the following page has a figure in the beginning. Since the figure with its caption won't fit in the same page, Lyx is generating white space to keep the page margins same.
Thanks for the reply, I am using RevTex 4.1 document class but with custom class option of aip,preprint.
I observed that in both the cases where a large space is present between the table and the paragraph or between two paragraphs, the following page has a figure in the beginning. Since the figure with its caption won't fit in the same page, Lyx is generating white space to keep the page margins same.
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Unwanted space between text and table in Lyx
Do you use floats to prevent this behaviour? Would be a good idea.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Unwanted space between text and table in Lyx
If you use figure with caption, which is also called a float in LaTeX and LyX, you can adjust settings for optimal page breaks.
Have a look at this LyX dialog - I would consider this "Here definitely" generally as problematic:
"Here, definitely" is a problem if there's simply not enough space Here. So it has to move anyway, but leaves a big gap at the end of a page. The automatism with the other points prevents that.
I would remove the checkmark for "Here definitely", and check Top, Bottom, Page and Here if possible, furthermore I would check "Ignore LaTeX rules" for easier placement.
Try and take a look how the page is filled then.
Stefan
Have a look at this LyX dialog - I would consider this "Here definitely" generally as problematic:
"Here, definitely" is a problem if there's simply not enough space Here. So it has to move anyway, but leaves a big gap at the end of a page. The automatism with the other points prevents that.
I would remove the checkmark for "Here definitely", and check Top, Bottom, Page and Here if possible, furthermore I would check "Ignore LaTeX rules" for easier placement.
Try and take a look how the page is filled then.
Stefan
LaTeX.org admin
Re: Unwanted space between text and table in Lyx
The \raggedbottom solved my problem. I'll keep other points in my mind if I face a problem like this in the future. Thanks a lot for your help.