Monday, January 16, 2012

LaTeX series -- Adjusting float space

Sometimes, adjusting float (figure/table) can be really annoying!!!.... Especially when we used [hbt] command.... It adds white spaces that is very hard to deal with. Fortunately, I found the solution after some googling.

Space below top [t] and above bottom [b] floats is managed via the length \textfloatsep. Space above and below here [h] floats is managed via the length \intextsep.


\setlength{\intextsep}{10pt} % Vertical space above & below [h] floats
\setlength{\textfloatsep}{10pt} % Vertical space below (above) [t] ([b]) floats
\setlength{\abovecaptionskip}{10pt}
\setlength{\belowcaptionskip}{5pt}

But the above solution would affect the rest of the figure, once the command was executed. To change the behavior of white spaces for single figure, adding vertical space  \vspace{-2ex} or \vskip{-2ex} within the figure environment either before \end{figure} or just after \begin{figure} could solve the problem.

~Saved!!!

No comments: