Itemize Environment – Preventing Initial Vertical Space in Itemize Environment

itemizeliststablestabularx

I'm using itemize and tables like the following

\begin{tabularx}{\textwidth}{>{\ttfamily}llX}
 \toprule
 \textbf{\rmfamily Operator} & \textbf{Typen} & \textbf{Regel} \\
 \midrule
 = & Alle Typen &
  \begin{itemize}
   \item This is how we roll
   \item Maybe we can talk?
  \end{itemize} \\
 \bottomrule
\end{tabularx}

But it keeps inserting a vertical space before the itemized list. How can I prevent it from doing so?

Best Answer

Lists like itemize act differently if they are used within a minipage environment. Specifically, they don't insert that vertical space before. So, you could use a minipage environment inside the table cell for the itemize list. There's a trick which is more handy - define this command:

\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother

Now just use \compress before \begin{itemize}. You could even use it within the column definition, if you also load the array package:

\usepackage{array}
...
\begin{tabularx}{\textwidth}{>{\ttfamily}ll>{\compress}X}

Output of your example using this command:

alt text

The vertical space before itemize is gone. If you would like to compress the lists even more, have a look at

  • the paralist package, which offers a compactitem environment for that purpose, or

  • the enumitem package which allows easy customization of list environments, for example \begin{itemize}[itemsep=0pt], it even provides global configuration commands for lists.

But even with \begin{itemize}[itemsep=0pt,topsep=0pt] I would additionally use \compress.