20

I have a document with many occurrences of

\begin{tabular} 
... 
\end{tabular}

I have been unable to find a global command that will reduce the vertical space before and after this environment. Any help appreciated. Here is the context:

\documentclass{report}
\usepackage{setspace,relsize,needspace,etoolbox}
\makeatletter
\preto{\@verbatim}{\topsep=-1.5pt \partopsep=-1pt }
\makeatother
\parskip 14pt
\parindent 0ex
\setstretch{1}
\begin{document}
\rule{\linewidth}{1mm}
\vspace*{\stretch{2}}
\vspace{.3in}
. . . 
\begin{spacing}{0.7}
\vbox{\noindent\textbf{re : Race/Ethnicity}
{\smaller
\begin{tabular}{ rrr }
n&missing&unique \\
4269&0&5 \end{tabular}
\begin{verbatim}
Mexican American (744, 17%), Other Hispanic (478, 11%) 
Non-Hispanic White (2103, 49%), Non-Hispanic Black (762, 18%) 
Other Race Including Multi-Racial (182, 4%) 
\end{verbatim}
}}

As Peter Grill stated (even though I didn't write a completely executable example) the act of simplifying is very useful - I think the \parskip is much of my problem. I think a solution to this is:

\usepackage{etoolbox}
\makeatletter
\preto{\@tabular}{\parskip=0pt}
\makeatother

which gets rid of extra space before the tabular but leaves too much afterwards.

The reason I've set parskip and parindent as I have (14pt, 0ex) is that this is for handouts for a course that also look decent when projected on a screen, i.e., this is a cross between printed and projected material.

5
  • 7
    The environment tabular doesn't add any vertical skip. Mar 13, 2012 at 19:58
  • 2
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem.
    – Werner
    Mar 13, 2012 at 20:01
  • I'm sorry that I didn't post an example. The code I'm using is fairly complex and lengthy but I'll try to list in the original question above the various packages that may be interacting with tabular to cause the problem. Mar 13, 2012 at 20:33
  • 3
    While listing the packages and code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. Personally, I have often solved my own problems in the process of reducing the amount of code actually required to reproduce the problem. Mar 13, 2012 at 20:35
  • Sorry, I don't understand. It would be nice if you make this a complete question, with a compilable example that clearly shows the problem. And, if you have a solution that works for you, add a separate answer -- self-answers are fine. Then this question would be useful as it will help others in the future who attempt to do something similar. Furthermore, if others have a better suggestion they can post additional answers as well. Mar 14, 2012 at 16:46

1 Answer 1

14

Have you tried to add this command to your preamble?

\setlength{\textfloatsep}{0.1cm}

You can globally change parskip using

\addtolength{\parskip}{-0.5mm}

Set the values to fit your needs.

Hope this helps.

8
  • 4
    Perhaps you could elaborate on what the length \textfloatsep references in terms of figures and text.
    – Werner
    Mar 28, 2012 at 7:04
  • 2
    textfloatsep is the separation between floats and text. You can regulate how much space is left before and after. You can get more information here and here. The package titlesec is a powerful one, but changes many many things.
    – JuanPi
    Mar 30, 2012 at 10:46
  • 2
    The \addtolength{\parskip}{-0.5mm} worked for me, but the first command seemed to not have any effect. Dec 16, 2016 at 16:03
  • 3
    Neither of these worked for me but adding \setlength{\intextsep}{6pt} to the preamble did the trick. This answer from @Werner really helped, too: tex.stackexchange.com/questions/36361/…
    – Omar Wasow
    Aug 23, 2017 at 21:31
  • 4
    I'm concerned that changing those variables might change the behavior of other environments, rather than just for the tabular environment. Is there an option specific to tabular?
    – jvriesem
    Dec 15, 2018 at 19:22

You must log in to answer this question.

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