I want to reduce spacing between figure and text (not caption) and between paragraphs. I'm using revtex4 package (two column style).
[Tex/LaTex] How to reduce spacing between figure and text
floatsrevtexspacing
Related Solutions
This depends on the location of the float - if the float is at the top of the page, the gap between the caption and the text is \textfloatsep
, while the gap for a float in the middle of the page is given by \intextsep
.
From the layouts
package documentation it is possible to see the lengths in terms of page/document float elements (p 21 onward):
Default for ieeetran
are
\textfloatsep
:1.7\baselineskip plus 0.2\baselineskip minus 0.5\baselineskip
\intextsep
:\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip
and therefore depends on the choice of the default font (since that sets \baselineskip
). The default pt-form is therefore
\textfloatsep
:20.4pt plus 2.4pt minus 4.8pt
\intextsep
:12.0pt plus 2.4pt minus 2.4pt
in the 10pt
font size. The above includes some stretch/shrink. You can modify them using \setlength
. For example,
\setlength{\textfloatsep}{\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}
would allow for between (roughly) 10pt
and 15pt
gap between the float and the text. Something like
\setlength{\textfloatsep}{5pt}
would fix the distance to 5pt
(without stretch/shrink).
To set the amount of intercolumn white-space between any two columns -- say, between columns 1 and 2 -- to 0
, you can insert @{}
in the corresponding spot in the second argument of the tabularx
environment.
Note that because the column type of column 2 is "Z" (which, in turn, is based on the "X" column type) and the first column has a fixed width, the total intercolumn whitespace between columns 1 and 2 will nevertheless nonzero in your example code. This happens because (i) the tabularx
environment expands the associated column widths in order to fill up the allocated width and (ii) the width of the first column is probably wider than absolutely necessary to typeset its contents on a single line.
The following modified form of your MWE implements this idea and also applies a few further refinements. E.g., I'd get rid of the unnecessary whitespace ahead of the first column and after the final column, and I'd also left-align (using \raggedright
) rather than center-set the first column, to make it visually more distinct from the data columns.
\documentclass[a4paper]{article} % change if you're not using A4 paper size
\usepackage[margin=1in]{geometry} % change margin settings to desired values
\usepackage{tabularx,booktabs}
\newcolumntype{Z}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}X}
\newcolumntype{L}{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p}
\begin{document}\pagestyle{empty}
\begin{table}[t]
\caption{Case studies} \label{case-studies}
\smallskip
\begin{tabularx}{\textwidth}{@{} L{4.5cm} @{} *4{Z} @{}}
\toprule
Nature of unreliability & Sender SST & Receiver SST & Implementation SST & Retransmission Bound \\
\midrule
Noisy (Single fixed error message) &
DSST & DSST & DSST & Unbounded \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
Best Answer
To reduce the spacing between figures and text, you can use
\belowcaptionskip
if all your figures have a\caption
:In order to reduce the spacing between paragraphs, set
\parskip
:To see the current value, use
\the\parskip
(displayed in document) or\showthe\parskip
(displayed in latex output).