2

I'm writing a latex document which contains a table. This table is doesn't fit the actual page so it's placed in the next page.

The problem is that vertical spaces are added automatically in the previous page in order to fill the page and I want to avoid that from happening.

I use H in order to add the table figure.

My problem

10
  • 3
    [H] is almost a guarantee for bad layout. Try with [htbp] instead. Commented Jan 10, 2019 at 16:46
  • @samcarter htbp is changing position of the table.
    – AwesomeGuy
    Commented Jan 10, 2019 at 16:50
  • 1
    Yes, [htbp] will select a position for the table which results in a good layout without such large gaps between the paragraphs Commented Jan 10, 2019 at 16:54
  • In addition to [htbp], at least two more things can affect this. What document class? memoir has \sloppybottom and I think most have \raggedbottom. Also, \parskip will affect this. I had a similar issue and use \setlength{\parskip}{0pt plus 18pt minus 2pt} in preamble (but you will need to decide what values work for you, if you use it).
    – whatisit
    Commented Jan 10, 2019 at 17:02
  • @AwesomeGuy If the tables move you should cross-references ( \ref - \label) and make autoexplicative captions, or alternatively do not use floats. Then the table will never move and will be in the exact lecture point that you want, but the layout will be a pain. Use [H] is the same except that you can add captions (now useless). Choose: good layouts or fixed positions. You cannot have both without a careful redesign the document.
    – Fran
    Commented Jan 10, 2019 at 18:00

1 Answer 1

5

The reason LaTeX has floating environments such as figure and table is to avoid large white space gaps at page breaks by moving the figure to a position which produces a better page break.

By using [H] you disable the float mechanism so you get the bad page break that latex would have avoided by floating the figure.

Depending on the use case and reasons why you used [H] you need to accept the space, or move the figure in the source file, rearranging the text so there is more text on the page, or use the float mechanism [htbp].

If you decide to accept the space, you may prefer \raggedbottom so all the excess space comes at the bottom of the page.

You must log in to answer this question.

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