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 aminipage
environment. Specifically, they don't insert that vertical space before. So, you could use aminipage
environment inside the table cell for theitemize
list. There's a trick which is more handy - define this command:Now just use
\compress
before\begin{itemize}
. You could even use it within the column definition, if you also load thearray
package:Output of your example using this command:
The vertical space before
itemize
is gone. If you would like to compress the lists even more, have a look atthe
paralist
package, which offers acompactitem
environment for that purpose, orthe
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
.