I declared a macro like this:
\newcommand{\itemcell}[1]{%
\begin{tabular}[t]{@{}l@{}}#1\end{tabular}
}
Yet, I am now struggling with this, because it does not allow an automatic line wrapping anymore. See the example below :
\begin{longtable}{p{4cm}p{1.5cm}p{1.2cm}p{1.2cm}p{1.2cm}p{\dimexpr\columnwidth-9.1cm-12\tabcolsep\relax}}
\toprule
Title 1 & Title 2 & Title 3 & Title 4 & Title 5 & Title 6 \\
\midrule
a & b & c & d & e & \itemcell{This is a very long description which won't fit in 1 line, it should break, but it won't\\And this is a second line} \\
\bottomrule
\end{longtable}
The content of the \itemcell{} won't be wrapped at the end of the column, overfull hbox incoming.
How can I arrange this macro to get that default behaviour back ?
pcolumns so just remove\itemcellit does nothing other than prevent line breaking. – David Carlisle Dec 12 '14 at 10:10pcolumn use a paragraph break (if it is a new paragraph) or\linebreakor\newlineif you just want to manually break a line. – David Carlisle Dec 12 '14 at 10:11\itemcellis recommended. A search return nothing. – Ulrike Fischer Dec 12 '14 at 10:11\itencellin alcolumn to allow line breaking, but it is missing a%at the end of the line in its definition. – David Carlisle Dec 12 '14 at 10:13\newlineor\linebreak(depending on whether you want the line to be cut short or be justified) just as in normal text outside of a table. – David Carlisle Dec 12 '14 at 10:14ccolumn which does not allow multiple lines, so it is designed to locally over-ride that. – David Carlisle Dec 12 '14 at 10:15\newlineor\par(or an empty line) to get a paragraph break. And in other column types it can only be used for short bits. – Ulrike Fischer Dec 12 '14 at 10:18