TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting information written by users in many lines, paragraphs, and I have to put those inside a table, I would like to know if it is possible to instruct LaTeX to accept paragraphs inside a column or maybe inside a multicolumn?

If I try to process this








  \multicolumn{3}{c}{ \bf{#1} } \\

  #1: & & #2 \\

  \multicolumn{3}{c}{} \\
  \multicolumn{3}{|>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{ #1 } \\
  %\multicolumn{3}{|c|}{ #1 } \\

  \rttitlesection{This is my section}
  \rtrowinfo{¿Ha realizado alguna gestión respecto de este predio, ante otra entidad?}{Sí}
  \rttitlesubsection{Descripción de gestión:}
    There are 


    of paragraphs, the guilty is [table]xcolor


I get the error

! Paragraph ended before \multicolumn was complete.
<to be read again> 

It looks like \usepackage[table]{xcolor} is getting in the middle, is there a replacement for xcolor to put some colored rows in a table? If I comment the inclusion of the package and the lines

\multicolumn{3}{|>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{ #1 } \\
\rttitlesection{This is my section}

Then LaTeX is able to process many paragraphs. Is there a suitable replacement for xcolor?

share|improve this question
Check your input; in your example there's a spurious closed brace after \\. It works for me after deleting it and adding some dummy rows. – egreg Jan 3 '12 at 22:20
thank you, I'm revisiting the complete code, because I had a macro that used the multicolumn, I'm trying to identify the problem to repost – ikks Jan 3 '12 at 22:36
Not the \\, but the brace after it! Moreover, recall that you can't use \\ inside the argument to \multicolumn, use \newline instead. – egreg Jan 3 '12 at 22:40
I published the complete code and found the problem with xcolor, your comments made me debug it to find the real problem, but still to be solved :P – ikks Jan 3 '12 at 23:13
up vote 10 down vote accepted

NOTE added February 15, 2012
Version 1.0a of colortbl.sty, released February 13, 2012, addresses and solves the problem, making the patch superfluous (albeit innocuous).

The problem is in colortbl that's loaded when you load xcolor with the option table. This package wrongly redefines \multicolumn without the \long prefix.

A patch is the following magic trick to be written in the preamble somewhere after loading xcolor (or colortbl):

  \long\def\noexpand\multicolumn##1##2##3{\the\toks0 }}\x

It's clearly a bug of colortbl.

Explanation of the trick

While the simplest thing to do is to copy the definition of \multicolumn one finds on lines 121-144 of colortbl.sty and adding \long in front of \def, the above trick accomplishes the same thing and is shorter. Moreover it will work flawlessly even if colortbl.sty were modified not only to add \long.

We need to know that \multicolumn wants three arguments. So we open a group and inside it set the token register \toks0 to contain the replacement text of \multicolumn, by giving it dummy arguments. By the rules of TeX, the # symbols are doubled. Then we define \x to define \multicolumn with the requested \long prefix and the stored replacement text. The \endgroup will be executed only when \x is expanded so the net effect is exactly what we wanted. Before the trick \show\multicolumn would show

#1#2#3->\multispan <...>

After it it would show

\multicolumn=\long macro:
#1#2#3->\multispan <...>

where <...> stands for the same token list in both cases.

Another similar (but more complicated) trick can be found in this other answer

  \begingroup\edef#1{\long\def\noexpand#1\the\toks0 {\the\toks2}}%

(The \makeatletter-\makeatother pair is necessary as \multicolumn uses @-commnds in its replacement text.

share|improve this answer
@DavidCarlisle You probably are interested in this answer – egreg Jan 10 '12 at 16:12
sorry I wasn't tracking this site when this was posted, I'll fix the package at source. – David Carlisle Feb 12 '12 at 19:45

Your Answer


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.