我在 tabularx-package 的表格中使用了 enumitem-package 的列表。在包含列表的表格行和下一个表格行之间有一个空格,我想避免。我该怎么做?这是一些基本的示例代码:
\documentclass{article}
\usepackage{tabularx} % featured tables
\usepackage{enumitem} % control layout of itemize, enumerate, description
\setlist{nosep}
\setlist[itemize,1]{leftmargin=\dimexpr 1em}
\renewcommand{\arraystretch}{1.3} % table spacing
\begin{document}
\begin{tabularx}{\textwidth}{p{4cm}X}
lorem ipsum a & lorem ipsum b
\begin{itemize}[label=--]
\item lorem ipsum c
\item lorem ipsum d
\end{itemize}\\
lorem ipsum e & lorem ipsum f\\
\end{tabularx}
\end{document}
它看起来像这样:
答案1
您可以将否定词添加\vspace
到列表选项中:
\documentclass{article}
\usepackage{tabularx} % featured tables
\usepackage{enumitem} % control layout of itemize, enumerate, description
\setlist{nosep}
\setlist[itemize,1]{leftmargin=1em}
\renewcommand{\arraystretch}{1} % table spacing
\begin{document}
\begin{tabularx}{\textwidth}{p{4cm}X}
lorem ipsum a
& lorem ipsum b
\begin{itemize}[label=--,after=\vspace*{-\baselineskip}]
\item lorem ipsum c
\item lorem ipsum d
\end{itemize} \\
lorem ipsum e
& lorem ipsum f\\
lorem ipsum g &
lorem ipsum h
\end{tabularx}
\end{document}