TransWikia.com

Is a p-column allowed in a multicolumn?

TeX - LaTeX Asked on July 23, 2021

As far as I understood how tabulars are build, you declare how many columns you need and how to format them. In some columns (notably l, c and r) LaTeX computes the needed width of those columns. On other columns the author defines the width (by using p{<width>} and similar declarations). LaTeX also adds intercolumn space. This results in the total width of the table.

I also think, I understand, how LaTeX computes the resulting width of a X column, when used in a tabularx environment, fitting the column, so that the total width reaches the defined width of the table.

My question is: is it allowed, to use a p{<width>} declaration within a multicolumn-command? As far as I understand, LaTeX must get confused if the author inserts such a multicolumn, which defines its own width, instead of using the LaTeX computed width of the combined columns in question.

For example’s sake: lets say, we have two columns like a l-column and a p{2cm}. LaTeX found out, that the longest entry in the first column is 1cm so, the total usable width of these two columns is 1 cm + 2tabcolsep + 2cm. Suppose now that the author orders multicolumn{2}{p{5cm}}{...}, which is obviously much wider than the LaTeX-computed width of 3cm + 2tabcolsep.

But what should authors use instead, if they want to be able to insert lots of text, being distributed into several lines as in a regular p-column?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP