1

I am trying to suppress the blank space on the top of the itemize environment. I tried to use the trick described here, yet it does not seem to work when working with \multicolumn

\documentclass{article}

\usepackage{longtable}
\usepackage{booktabs}
\usepackage{enumitem}
\usepackage{array} % Thanks daleif !

\makeatletter
\newcolumntype{P}[1]{>{\@minipagetrue}p{#1}}
\makeatother

\setlist[itemize]{noitemsep, topsep=0pt, leftmargin=*}

\begin{document}
 \begin{longtable}{p{4cm}p{4cm}p{4cm}}
   \toprule
    \textbf{col1} & \textbf{col2} & \textbf{col3}  \\
   \midrule
    foo & bar & zbb \\
    foo & \multicolumn{2}{P{8cm}}{\begin{itemize}\item foo \item bar\end{itemize}}\\
   \bottomrule
 \end{longtable}
\end{document}

1 Answers1

3

Neither with a multicolumn nor without, the trick with \@minipagetrue works with longtable.

But you can insert the itemize inside a minipage.

MWE

\documentclass{article}

\usepackage{longtable}
\usepackage{booktabs}
\usepackage{enumitem}
\usepackage{array} % Thanks daleif !

\setlist[itemize]{noitemsep, topsep=0pt, leftmargin=*}

\begin{document}
 \begin{longtable}{p{4cm}p{4cm}p{4cm}}
   \toprule
    \textbf{col1} & \textbf{col2} & \textbf{col3}  \\
   \midrule
    foo & bar & zbb \\
    foo & \multicolumn{2}{p{8cm}}{
                                  \begin{minipage}[t]{\linewidth}
                                    \begin{itemize}
                                      \item foo 
                                      \item bar
                                    \end{itemize}
                                  \end{minipage}
                                 }\\[10pt]
   \bottomrule
 \end{longtable}
\end{document} 

Output

enter image description here

BTW: why do you need a \multicolumn here?

karlkoeller
  • 124,410
  • Any technical reason this trick does not work with longtable ? As for your last question, that's just a MWE, I wouldn't need a multicolumn here :) –  Jan 29 '15 at 18:54
  • @EddaSnorra I've no idea. I didn't ever used that trick. I always use minipages in these cases. As for my last question, I knew what the answer was. :-) – karlkoeller Jan 29 '15 at 19:38