I'm typesetting a tabularx in which some of the cells in one column (of type X) contain itemize lists. I don't like the excessive space above & below the lists (or even between the list items), so I'm using the trick from this answer to eliminate the upper vertical space and this answer to eliminate the lower (Trying to use the latter answer's advice for eliminating the upper vertical space didn't work). Specifically, I've defined this command in the preamble:
\makeatletter
\newcommand{\compress}{\@minipagetrue}
\makeatother
and I've inserted >{\compress} before the X in the column specification.
On its own, this works fine, except that (a) the last row of the table contains regular text, not a list, and (b) the table is immediately followed by a \section. These two facts together result in an output in which there is noticeably too little space between the table and the section header. If I remove the last row of the table, leaving a row with a list as the new last row, or if I delete the \section command, or if I remove the >{\compress}, the spacing goes back to normal, but the first two aren't what I want to typeset, and the last results in the top lines of the rows not lining up.
Minimalish working example:
\documentclass{article}
\usepackage{tabularx}
\makeatletter
\newcommand{\compress}{\@minipagetrue}
\makeatother
\usepackage{enumitem}
\setlist[itemize]{
itemsep=0.15\baselineskip,
parsep=0pt,
% Trick from answer 126505; did not work:
%before=\vspace*{\dimexpr-\baselineskip-\parskip},
after=\vspace*{-\baselineskip}
}
\begin{document}
\noindent
\begin{tabularx}{\linewidth}{l>{\compress}X}
\textbf{Colors} & \begin{itemize}
\item Red
\item Green
\item Blue
\end{itemize} \
\textbf{Gems} & \begin{itemize}
\item Ruby
\item Sapphire
\item Emerald
\end{itemize} \
\textbf{Elements} & \begin{itemize}
\item Fire
\item Water
\item Earth
\end{itemize} \
\textbf{Foo} & Bar \
\end{tabularx}
\section{Next Section}
Lorem ipsum\ldots
\end{document}
Result:

\setlist[itemize]{ itemsep=0.15\baselineskip, parsep=0pt, before=\begin{minipage}[t]{\linewidth}, after=\end{minipage} }? – leandriis Jun 23 '21 at 19:01\newcommand{\uncompress}{\global\@minipagefalse}– John Kormylo Jun 23 '21 at 19:55\global(it is global already) and the name I used in my answer is nicer, I think. – David Carlisle Jun 23 '21 at 20:02