如果我在 tabular(x) 中使用 compactitem,列表环境前后会有垂直空格。我该如何删除该空格?
\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}
答案1
\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}