1

If I use compactitem in a tabular(x), there is a vertical space before and after the listing environment. How can I remove that space?

\documentclass[11pt, a4paper]{scrartcl}

\usepackage[ngerman]{babel}
\usepackage{paralist, tabularx}

\begin{document}

\begin{compactitem}
\item Item 1
\item Item 2
\end{compactitem}
    There is no verstical space after the compactitem-environment.



\bigskip
\begin{tabularx}{\textwidth}{l X}
\hline
a & b\\
a &     \begin{compactitem}
\item Item 1
\item Item 2
\end{compactitem}\\
a& \dots but in the tabular, there \emph{is} vertical space after and before the einvironment!\\
\hline
\end{tabularx}

\end{document}
4
\documentclass[11pt, a4paper]{scrartcl}

\usepackage[ngerman]{babel}
\usepackage{paralist, tabularx}
\makeatletter
\renewcommand\tabularxcolumn[1]{>{\@minipagetrue}p{#1}}
\makeatother
\begin{document}

\begin{tabularx}{\textwidth}{l X}\hline
a & b\\
a &     \begin{compactitem}
\item Item 1
\item Item 2
\end{compactitem}\\[-\normalbaselineskip]
a& \dots but in the tabular, there \emph{is} vertical space after and before the einvironment!\\
\hline
\end{tabularx}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.