I tried using the command \intextsep with \setlength to readjust the distance/spacing between floats and text but for some reason this only affected the distance of the top of the figure and the text when this is supposed to also adjust the bottom. Can anyone explain how I can fix this? Any feedback would be most welcome, thanks!
My problem is that the distance between the text and top of the float is a good distance but the spacing following the float is a bit too large for my liking. Using \intextsep ends up placing the float too close at the top to the text but not showing enough of a spacial difference between the bottom of the float and following text (and in some cases the distance even gets larger).
Attached are two screen captures of a before and after.
(after, with \setlength\intextsep{-1.5pt} )
(new images for screen capture)
Attachments
before \intextsep
before-intextsep2.jpg (64.83 KiB) Viewed 17868 times
after \intextsep
after-intextsep2.jpg (55.7 KiB) Viewed 17868 times
Last edited by workerbee on Sat Dec 27, 2008 2:33 am, edited 2 times in total.
\documentclass{article}
\usepackage{array}
\newlength{\mylen}
\settowidth\mylen{\normalfont\small Categories in Original Data Set}
\newcolumntype{C}{>{\centering\arraybackslash}p{0.33\mylen}}
\begin{document}
The recoded values are shown in the table below.\par\vspace{\intextsep}
\begingroup
\centering\small
\setlength\extrarowheight{1pt}
\begin{tabular}{|*{6}{C|}}
\hline
\multicolumn{3}{|c|}{Categories in Original Data Set}
& \multicolumn{3}{c|}{Categories in Recoded Data Set} \\
\hline
u1 & u2 & u3 & u1 & u2 & u3 \\
\hline
1 & 2 & 3 & 0 & 1 & 2 \\
1 & 1 & 2 & 0 & 0 & 1 \\
2 & 2 & 2 & 1 & 1 & 1 \\
2 & 3 & 4 & 1 & 2 & 3 \\
\hline
\end{tabular}
\par\vspace{\intextsep}
\endgroup
\noindent The CATEGORICAL option can be used\ldots
The recoded values are shown in the table below.
\begin{center}
\centering\small
\setlength\extrarowheight{1pt}
\begin{tabular}{|*{6}{C|}}
\hline
\multicolumn{3}{|c|}{Categories in Original Data Set}
& \multicolumn{3}{c|}{Categories in Recoded Data Set} \\
\hline
u1 & u2 & u3 & u1 & u2 & u3 \\
\hline
1 & 2 & 3 & 0 & 1 & 2 \\
1 & 1 & 2 & 0 & 0 & 1 \\
2 & 2 & 2 & 1 & 1 & 1 \\
2 & 3 & 4 & 1 & 2 & 3 \\
\hline
\end{tabular}
\end{center}
\noindent The CATEGORICAL option can be used\ldots
\end{document}
In the definition of the new column type, you can replace 0.33\mylen by a suitable fixed length. Please observe that:
Since the table has no caption, you don't need a table environment. In fact, this environment is the responsible of the extra space you observed.
If you want exactly \intextsep vertical space, use the first part of the code. If not, perhaps it may suffice the separation provided by the center environment.
If you need additional separation between columns, don't put void columns. You may use columns with specific lengths (as above) or you may change \tabcolsep (half the separation between two consecutive columns).
The optional argument of tabular is used for positioning the table relative to eventual text in the same line. Allowed values are t, b and c, so \begin{tabular}[H] is meaningless.
In your code, the columns labeled by u3 are wider than those corresponding to u1 and u2.