Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use @{\hskip 50pt} to separate columns in my table. The problem which arises is that I add this extra space after a multicolumn. This also moves the header row so that it is no longer centred. Is there any easy way to recenter the header name MC? I thought about just adding some extra whitespace after it to move it but maybe there is a better way of doing it. However, I don't want to use X columns or a different table environment to achieve that. It took me 5 days now to add everything to the tables and to align and stretch them properly as I want them to be. Apparently, this is only a very simple example not containing all of the other things I have in my tables but I think the problem is still clear and I am sure it only depends on the multicolumn and extra space issue:

\documentclass[10pt,DIV=12,a4paper,numbers=noenddot]{scrreprt}

\usepackage{tabu}      
\usepackage{multicol}  
\usepackage{multirow}  

\begin{document}

\begin{table}

\begin{tabu}{rr@{\hskip 50pt}rr@{\hskip 50pt}r}

\multicolumn{2}{c}{MC} & bla\\

asdasdsad & asdasdada & adasdddddddd \\
asdasdsad & asdasdada & adasdddddddd \\
asdasdsad & asdasdada & adasdddddddd \\

\end{tabu}

\end{table}

\end{document}
share|improve this question
1  
Just write c@{\hspace{50pt}} as the second argument to \multicolumn. –  egreg Feb 7 '13 at 11:31

2 Answers 2

up vote 2 down vote accepted

When you do \multicolumn{<number>}{<spec>}{<text>} the <spec> substitutes the whole block of the tabular column specifications and the intercolumn material belongs the the preceding column.

Exception: the material before the first column belongs to the first column.

So you have to respecify the intercolumn material if it's not the default; it would be just the same if you had rules instead of @{...}.

So you have to do

\begin{tabu}{rr@{\hspace{50pt}}rr@{\hspace{50pt}}r}

\multicolumn{2}{c@{\hspace{50pt}}}{MC} & bla\\

asdasdsad & asdasdada & adasdddddddd \\
asdasdsad & asdasdada & adasdddddddd \\
asdasdsad & asdasdada & adasdddddddd \\

\end{tabu}

and the result will be what you want.

Note that \hspace{...} is preferable to \hskip...

enter image description here

There's no way to do it automatically, as intercolumn material can be almost anything. Or, if there's a way, it's surely complicated, because it has to deal with many internals of tabular (and of tabu, as you use this one).

share|improve this answer
    
Thanks a lot for this great example. Works like a charm :) –  Josh Feb 7 '13 at 13:09

This will recenter your MC header.

\multicolumn{2}{c@{\hskip 50pt}}{MC} & bla\\

If your extra space is uniform, you can define a new column type, say C, for ease of use:

\newcolumntype{C}{c@{\hskip 50pt}}
% ...
\multicolumn{2}{C}{MC} & bla\\
share|improve this answer
    
thanks for your solution even though it is the same as provided by egreg. Just means it's a good way of doing it :) thanks! –  Josh Feb 7 '13 at 13:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.