Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted
\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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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