In the following MWE, one sees the difference between tabular
and longtable
, with respect to the vertical space before an itemize, inside a cell :
\documentclass[12pt]{article}
\usepackage{longtable,enumitem}
\begin{document}
\begin{longtable}{| p{3cm} |p{6cm}|}
\hline%
text &
\begin{itemize}[topsep=0ex,partopsep=0ex]
\item Produkt und Quotient
\item Produkt und Quotient
\end{itemize}
\\ \hline
\end{longtable}
\begin{tabular}{| p{3cm} |p{6cm}|}
\hline%
text &
\begin{itemize}[topsep=0ex,partopsep=0ex]
\item Produkt und Quotient
\item Produkt und Quotient
\end{itemize}
\\ \hline
\end{tabular}
\end{document}
What i would like, is to have in longtable the same vspace as in tabular.
By the way, i set both topsep
and partopsep
to 0, just because i am ignorant, and i don't really know which one i should use…
Best Answer
Oh! Sorry I think this is an unreported bug in
longtable
.Longtable inserts a strut to keep a minimal separation between the text and any
\hline
or the previous row.It does this with the following code
If you look at the equivalent code in the
array
package, you findThe important bit being the last few lines which delay adding the strut by using
\everypar
.It seems to me the same fix should have been applied to
longtable
so only 20 years too late I suggestwhich then makes both your tables have the same vertical spacing.
If you do this could you change
to
I suspect after all this time I can't change
longtable
s default spacing, however I should add an option to fix it.