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'm trying to use multicolum. In my table all the columns have a predefined color which will be overwritten by multicolum. So my question is how can I define own or some more custom multicolumn commands which will make it able to set the color of the column faster than writing:

\multicolumn{3}{|>{\columncolor[gray]{.8}} c|}{myText} 

I tried something like this:

\renewcommand{\multicolumn}[3]{%
\oldmc{##1}{| {\columncolor[gray]{.8}[.5\tabcolsep] } c |  ##2}{ ##3 }% }}

But I think there are some problems with the syntax, as I don't get it working.

share|improve this question
    
Welcome to TeX.SX. Note that you don't have to sign with your name since it automatically appears in the lower right corner of your post. –  Claudio Fiandrino Feb 7 '13 at 18:22
    
@user25646 It looks like you've got two separate accounts: this one and one older unregistered one. The StackExchange staff can merge them together for you. –  Joseph Wright Feb 8 '13 at 15:16
    
thx, for the advice –  user1234567890 Feb 9 '13 at 4:29

1 Answer 1

up vote 2 down vote accepted

Load package array

\usepackage{array}

define a new column type (say Q)

\newcolumntype{Q}{|>{\color[gray]{.8}} c|}

then use

\multicolumn{3}{Q}{myText}
share|improve this answer
1  
Which is surely better than redefining \multicolumn, of course. :-) –  egreg Feb 7 '13 at 18:52

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.