Is tabularx compatible with xcolor? I did the following:

enter image description here

\usepackage[svgnames,hyperref,]{xcolor} % colors for hyperref
  \begin{tabularx}{1.00\linewidth}{X} \toprule
  {\color{red}c} \\

But "c" is displaced so that it takes two rows. Changing the column type to l fixes it.

Is there an easy fix to making xcolor work with tabularx?

  • 1
    Try using \textcolor{red}{c} instead.
    – Werner
    Commented Apr 16, 2014 at 20:09

1 Answer 1


Columns with column type p and X that is based on p are implented via a \vtop, which is a \vbox, but aligned to the top baseline. \color does not start a paragraph, but it creates a whatsit (\special). Because of the vertical mode, it becomes the first element in the \vtop. Also the tabular environments add struts, therefore the cells in a row have at least the height of the strut.

You can avoid this by starting a paragraph:

  • implicit by \textcolor{red}{c} or

  • explicit with \leavemode{\color{red}c}

  • Great, thank you! It's great that there is a community of people who understand these details, but I wonder if these details are really necessary for good typesetting…
    – Neil G
    Commented Apr 16, 2014 at 20:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .