I've created a table where multicolumn cells appear to not even be spanning the width of one of the two columns it was told to, and the adjacent multicolumn cell is spanning more than the two columns it was told to.
I find this to be entirely unexpected.
Here's an example:
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Scale=MatchUppercase]{Libertinus Serif}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{|c|r|p{2em}|p{1em}|p{1em}|p{2em}|}
\toprule
\multicolumn{2}{|r|}{1:}
& A & \multicolumn{2}{|c|}{B-C} & D \
\midrule
\multirow{3}*{2-4}
& 2: &
a & \multicolumn{2}{|c|}{b-c} & d \
& 3: &
\multicolumn{2}{|c|}{a-b} & \multicolumn{2}{|c|}{c-d} \
& 4: &
\multicolumn{4}{|c|}{a-d} \
\midrule
\multicolumn{2}{|r|}{5:} &
\multicolumn{2}{|c|}{a-b} & \multicolumn{2}{|c|}{c-d} \
\bottomrule
\end{tabular}
\end{document}
(Note that I don't usually use vertical dividers, but did in this example to keep track of the edges.)
Output of the above example:
In the output of the example, cell "a-b" in row 3 is told to span 2 columns, but it takes up less space than the single column it's in. Conversely, cell "c-d" is told to span two columns, but it spans more than three!
What I would expect is something more like the following, with changes in red showing what I would expect to be more like two-column-width spacing.
What am I doing wrong?


\multicolumnstatements obliterate all usable information about the supposed fixed widths of the underlying columns for use in rows 3 and 5. – Mico Dec 11 '23 at 20:02\begin{tabular}{...} & & & & & & & \\[-\normalbaselineskip] <rest of tabular> \end{tabular}– Werner Dec 11 '23 at 21:06\multicolumnis a bit at odds with the mechanism of its operation. I feel that my misunderstanding of how\multicolumnworks is because the interface is misleading. Does the first argument not mean "take up n columns", and the columns' positions and widths are already defined the thep{}s? – Jonathan W. Dec 12 '23 at 21:41\documentclass{article} \begin{document} \begin{tabular}{p{4in}} \multicolumn{1}{c}{u} \end{tabular} \end{document}. Thetabularshould be about 4" wide, right? Wrong! It's only as wide as the lowercase letteru(plus some whitespace padding, in the amount of\tabcolsep, on either side ofu). That's why I wrote that\multicolumncan obliterate the underlying information. Do please study the examples contained in the link to the earlier question to (re)develop your intuition. – Mico Dec 12 '23 at 22:56