I just want to ask about why is LyX leaving a big gap between paragraphs surrounding a figure?. Not all paragraphs, but only between those paragraphs where I inserted a float (figure). The figure is placed somewhere else and all I left with is a big gap!

My thesis contains a lot of graphs all of which are floats and I want the figure to appear after the paragraph where it was first mentioned. I don't need big white spaces around the figures or to place a figure alone in a separate page.

enter image description here

Here is what I have in the preamble

%\setlength{\intextsep}{-1ex} % remove extra space above and below in-line float
\raggedbottom % to kill the annoying HUGE whitespace between paragraphs

as you can see from the last line in the preamble, I have tried using \raggedbottom to sort out this as recommended in another forum, but had no success.

LyX file: Removed as it contains unpublished data.

  • Welcome to TeX.SX! There isn't really enough information to answer your question. What position have you defined for the figure in the float settings? From your description you don't want it to float, so you should use Here definitely. To increase the chances of getting good answers it is generally best to add a minimal working example, see meta.tex.stackexchange.com/questions/4488/… (and meta.tex.stackexchange.com/questions/228/…). Aug 7, 2014 at 15:54
  • @Torbjørn T., thanks for the reply. All my figures are set to by Here if possible and Ignore Latex reules. What really annoys me is the gap left between the paragraphs, not the positioning of the figures. (Although I would like to solve the problem of figures positioning, but will leave it for another discussion.)
    – Abdulaziz
    Aug 7, 2014 at 21:12
  • Perhaps your figures have invisible white space around them, i.e. their bounding box is not correct. In such a case, that you may test by putting them in an \fbox, is to crop them.
    – Bernard
    Aug 7, 2014 at 21:12
  • Well, I for one would need to see a sample .lyx file (or exported .tex), as mentioned above, to answer this, I am unable to guess at the cause. Aug 7, 2014 at 21:30
  • @TorbjørnT., here you go. The .lyx file is now in the question. For all, please don't use what is written in the file. It's a part of my thesis.
    – Abdulaziz
    Aug 7, 2014 at 21:52

4 Answers 4


(It is a little bit difficult to say for sure, but I think I know why this happens. At least partly.)

There are two problems relating to the paragraph settings of the paragraphs containing the floats that can produce additional whitespace.

1. Empty paragraphs

If you look at the LaTeX source of one of the figures you'll see something like


The problem here is the \noindent which comes from the paragraph settings in LyX. What you should do is right click just outside each figure, choose Paragraph settings, and check the box for Indent paragraph. If you have the source view open you'll see that the \noindent disappears when you click OK/Apply.

2. Centred alignment

For two of the figures (second and third last in your example) the alignment of the paragraph with the figure is set to Center, and if you look in the code you see something like


The surrounding center environment should be removed, by setting the paragraph alignment to Paragraphs default (justified).

So, why?

To demonstrate how this can give extra whitespace, consider the following LaTeX code, the output is shown below it:

Some words.


More words.

\noindent \begin{figure}
This is a figure.


Another figure


enter image description here

One or more empty line(s) signifies that a new paragraph should start, and new paragraphs are by default indicated by indentation. \noindent lets you remove this indentation for a single paragraph.

Now in the code above, the first \noindent does nothing, because there isn't anything there that can start a new paragraph. So you see that there is no extra space between Some words and More words. In the second case however, the \begin{figure} causes a new paragraph to start, but the only thing in it -- the figure itself -- floats away, so you're left with an empty paragraph.

Further, the center environment adds some verticl whitespace before and after, and when the only thing inside it is a figure that floats away, you're left with just that vertical whitespace.

  • thanks for the help. Unfortunately, it does not solve the problem. I have removed the indentation from all figures as you described and removed also from all the document, but the problem is still not solved.
    – Abdulaziz
    Aug 8, 2014 at 14:59
  • @Abdulaziz I updated my answer, having noticed an additional problem. Aug 8, 2014 at 22:35

I had similar problems. Large gaps after figure floats. None of the above had any impact.

It was the placement option for the figure floats.

Right click on the "float: Figure"

The issue stems from if you have large figures in close proximity to each other. Lyx tries to do what you've asked it to. If the check box indicates "Here definitely", the software prioritizes the order of text to images. The idea being that this text must precede this image with no exceptions. To accommodate this it will put a giant space in the document flowing the text as needed to make sure the image is embedded within the text in next to the correct words.

This can have a cascading effect on a series of large images.

Its best to go through your document and either choose "Use default placement" if possible or "Here if possible" to keep the image nearby but allow the text to flow around the "float: Figure".

Took some trial and error to figure that out. I went down the rabbit hole of adjusting the image size relative to the page and/or the column width. Don't bother. Pick a size that looks good, then choose your float placement options carefully.

That help?

  • Welcome to TeX.SX! In this specific case the problem was not float placement as you mention, but the things described in my answer. The link to the .lyx file is removed now though, so you just have trust me on that one. In general though, the problem you describe is more common I would think, and there have been many questions here on the site about it. Usually also connected to having a documentclass that does \flushbottom, meaning that the space between paragraphs, section headings etc. will be stretched to fill the text block. May 21, 2016 at 6:15

@Torbjørn T. Thank you very much. The problem has been solved.

For anyone facing the same problem, the steps are as follows:

  1. Change the Document>Settings>Text Layout to Indentation: Default (Even if you still want to keep your document not-indented as I do)
  2. This will be quite tedious! For all figures: inside the figure float, change the paragraph settings to be Justified and Indent Paragraph. Avoid using Center.
  3. Now if you want your paragraphs to be separated by a skip rather than to indent them. Do so as described in step 1.

All credit goes to Torbjørn T.

N.B. I wish that there is a command that changes the paragraph settings for floats only rather than doing them manually one by one!

  • Regarding point 2: What you do inside the float doesn't really matter, it's what's outside that causes these problems. Regarding your N.B: The settings in Document --> Settings --> Text layout does not change the settings of individual paragraphs (i.e. it doesn't add \noindent everywhere). So I think you must have changed it into not indented and centred manually at some point, so it is just a matter of not doing that in the first place. Changing paragraph settings for float paragraphs doesn't really make sense anyway, as floats 1) float away and 2) aren't affected by them anyway. Aug 9, 2014 at 7:49

I was having the same problem, and I found a ridiculously easy fix. Are you starting a new paragraph before you insert your figure float? I mean, are you pressing ENTER and then inserting the float? I was doing that, until I tried just inserting the float at the end of the paragraph, without pressing ENTER, and voila! Worked like magic. Seems stupid, but that was it. I hope this helps.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – Symbol 1
    Aug 18, 2015 at 9:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .