2

This question already has an answer here:

I'm using a list from enumitem-package inside table from tabularx-package. Between the table-row, which contains the list, and and the next table-row there is a space I would like to avoid. How do I do that? This is some basic example code:

\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}

It looks like this:

preview of code example

marked as duplicate by Community Jan 23 '18 at 23:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

You can add a negative \vspace to the list options:

\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}

output of code

  • In fact, using after=\vspace*{-\dimexpr\baselineskip} as described in this answer has better spacing. – Mekeor Melire Jan 23 '18 at 23:56
  • @MekeorMelire Sorry, the \arraystretch was a mistake. But the \dimexpr is not required. – Alan Munn Jan 24 '18 at 0:28

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