1

I am authoring a report that runs into hundreds of pages. In one particular chapter, I have a large number of tables and figures. I use the setting [htb] for both the tables and the figures, so that latex judiciously arranges them across the pages. But when I generate the PDF file, I see that there is extra space above one or two tables, that run into half a page. I tried using \vspace{*5mm} above the tables to reduce the white space, but still it does not go away. I would like to know whether there is a package that I could use to get a compact formatting, with only minimal white spacing.

TIA

David Carlisle
  • 757,742
Vinod
  • 875
  • Your question is somewhat nonspecific, but I find many things which can be improved. Did you try [!htb]? (Please note the !.) \vspace*{5mm} will increase the white space, not reduce it. (Your * is misplaced.) Also, see these, http://tex.stackexchange.com/questions/23313/how-can-i-reduce-padding-after-figure and http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html. – Masroor Jan 31 '15 at 05:17
  • I don't think we have enough information to understand the nature of your problem or to diagnose it. Are the floats with extra space on the top, bottom, or float pages? Is the extra space between floats (that is, does it occur when multiple floats are placed together), or only when one float is by itself? What float-related packages are you loading? To start, try giving \vspace a negative value and see if that solves it. (Positive values skip down, negative values skip up.) – dgoodmaniii Jan 31 '15 at 06:24
  • If there are many floats, why not allow float pages with the poption. – Johannes_B Jan 31 '15 at 06:24
  • thanks for all your suggestions. I shall try them and revert. I am using \vspace*{5 mm} to have a minimum space between any float the following text. I introduced this after seeing that there was extra space inserted between a table and the text following caption. @Masroor thanks especially for the links. they are helpful. – Vinod Jan 31 '15 at 06:36
  • The main affect of htb is to prevent latex making float pages, which makes it much harder to find a good float placement and so makes it much more likely that all the floats drift to the end. Was there a particular reason for that choice? – David Carlisle Jan 31 '15 at 08:55
  • As you have shown no example code it is hard to comment but using \vspace in conjunction with a float is almost always wrong. I can't tell from your description whether the \vspace is inside or outside the float, outside is always wrong, the vspace will add space where it is used but the float will float and may appear somewhere else entirely leaving the vspace making an unwanted change to a different page. – David Carlisle Jan 31 '15 at 08:57
  • @DavidCarlisle thanks for your observation, in fact I have used \vspace outside of the float, so I need to revisit that as well...I decided to use [htb] as it had been recommended in relation to another query of mine in the recent past. So I guess I need to revisit that as well and change to [ht] instead. – Vinod Jan 31 '15 at 09:10
  • @Vinod no you should almost always include p changing from htb to ht makes it even harder to place floats as it prevents floats being placed at the bottom of the page in addition to preventing float pages. Basically an optional argument should only be needed for optional non-default cases. If you are using the same option in every case then something is wrong, you should instead set the default behaviour. – David Carlisle Jan 31 '15 at 09:14

1 Answers1

5

Do not use \vspace, but change float behavior. As comments said, you can also add the p option to use float pages of and/or ! to ignore restrictive LaTeX rules, so using [!htbp] by default solve many problems.

But you can also change this rules. Add to the preamble some like this for normal pages:

\renewcommand{\topfraction}{0.9}    % max fraction of floats at top
\renewcommand{\dbltopfraction}{0.9} % the same for 2 column pages
\setcounter{topnumber}{4}           % max float at top
\setcounter{dbltopnumber}{3}        % the same for 2 column pages
\renewcommand{\bottomfraction}{0.9} % max fraction of floats at bottom
\setcounter{bottomnumber}{}         % max float at bottom
\setcounter{totalnumber}{8}         % max floats per page 
\renewcommand{\textfraction}{0.1}   % min text fraction 

Float pages are constructed according to \topfraction,\bottomfraction but also \floatpagefraction or \dblfloatpagefraction that can be changed also via \renewcommand.

You may want also tune commands to control spacing between floats and text. See How to change the spacing between figures/tables and text?

Fran
  • 80,769