Removing extra space after itemize environment in longtable in memoir
A p
column entry in a table ends with essentially
\unskip \strut \par \egroup \hfil
so after your list you get a \strut
added which appears on a newline. You can back-up with -\baselineskip
:
\documentclass{article}
\usepackage{enumitem}
\usepackage{longtable}
\usepackage{booktabs}
\newcommand{\fuda}[2]{%
Functions:%
\begin{itemize}[nosep]
#1%
\end{itemize}
Data:%
\begin{itemize}[nosep]
#2%
\end{itemize}}
\begin{document}
\begin{longtable}{p{0.25\textwidth}|p{0.7\textwidth}}
\caption[List of components]{List of functions and data allocated to each component} \label{d_plan} \\
\toprule
\textbf{Components} & \textbf{Functions and Data} \\\midrule
\textbf{Registration} &\fuda{\item Register capabilities of the device
\item Unregister capabilities of the device
\item Register context representation
}{\item Interface List
\item Capability List
\item Protocol List
\item Representation List}\vspace*{-\baselineskip}
\\\bottomrule
\end{longtable}
\end{document}
The same applies to p
cells in ordinary tables.
Added in the memoir
class the definition of \@endpbox
is a little difference and you will need to write
\vspace*{-\baselineskip}\leavevmode
instead of just the \vspace*
command.
\documentclass{memoir}
\usepackage{enumitem}
\usepackage{longtable}
\usepackage{booktabs}
\newcommand{\fuda}[2]{%
Functions:%
\begin{itemize}[nosep]
#1%
\end{itemize}
Data:%
\begin{itemize}[nosep]
#2%
\end{itemize}}
\begin{document}
\begin{longtable}{p{0.25\textwidth}|p{0.7\textwidth}}
\caption[List of components]{List of functions and data allocated to each component} \label{d_plan} \\
\toprule
\textbf{Components} & \textbf{Functions and Data} \\\midrule
\textbf{Registration} &\fuda{\item Register capabilities of the device
\item Unregister capabilities of the device
\item Register context representation
}{\item Interface List
\item Capability List
\item Protocol List
\item Representation List}
\vspace{-\baselineskip}\mbox{}
\\\bottomrule
\end{longtable}
\end{document}
Or you can use a minipage
.
\newcommand{\fuda}[2]{%
\begin{minipage}[t]{\linewidth}
Functions:%
\begin{itemize}[nosep]
#1%
\end{itemize}
Data:%
\begin{itemize}[nosep]
#2%
\end{itemize}
\end{minipage}}
Full code:
\documentclass{memoir}
\usepackage{enumitem}
\usepackage{longtable}
\usepackage{booktabs}
\newcommand{\fuda}[2]{%
\begin{minipage}[t]{\linewidth}
Functions:%
\begin{itemize}[nosep]
#1%
\end{itemize}
Data:%
\begin{itemize}[nosep]
#2%
\end{itemize}
\end{minipage}}
\begin{document}
\begin{longtable}{p{0.25\textwidth}|p{0.7\textwidth}}
\caption[List of components]{List of functions and data allocated to each component} \label{d_plan} \\
\toprule
\textbf{Components} & \textbf{Functions and Data} \\\midrule
\textbf{Registration} &\fuda{\item Register capabilities of the device
\item Unregister capabilities of the device
\item Register context representation
}{\item Interface List
\item Capability List
\item Protocol List
\item Representation List}
\\\bottomrule
\end{longtable}
\end{document}