2

I'm trying to make a time plan for a project using tables in LaTeX but I've run into a small problem. The table below will look fine until I try to colour individual cells by adding \usepackage[table,usenames,dvipsnames]{xcolor}. Doing this will stretch the middle column all the way out to the right edge of the paper. It does this even without me adding the \cellcolor{somecolor} command or making any other alterations to the table.

Here's a little bit more elaborate example than was originally posted:

\documentclass[a4paper,12pt]{article}
\usepackage{ucs}
\usepackage[hmargin=2cm,vmargin=2cm,a4paper]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[hang,small,bf]{caption}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage{pdfsync}
\usepackage{url}
\usepackage{verbatim}
\usepackage{parskip}
\usepackage{listings}
\usepackage{float}
\usepackage[utf8x]{inputenc} 
\usepackage{booktabs}
\usepackage{multirow}
\usepackage[table,usenames,dvipsnames]{xcolor}


\pagestyle{fancy}
\fancyhf{}


% Document start
\begin{document}

\begin{titlepage}
\begin{center}

\end{center}
\end{titlepage}

\section*{Time plan}

\noindent X\dotfill X

\noindent\begin{tabular*}{\textwidth}{r p{8cm} @{\extracolsep{\fill}} l}
\toprule
Week & Task & Date \\
\midrule
37 &\cellcolor{yellow} Project start & 2012-09-13 \\
\bottomrule
\end{tabular*}

\pagebreak

\end{document}

And here's what it looks like:

image

I have seriously no idea of what's going on here so any help would be much appreciated! It might be worth pointing out that I'm also using the multirow package, if that has any impact on making coloring work. All packages seems to be up to date.

3
  • Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. Commented Sep 20, 2012 at 21:45
  • 1
    I don't get that output.
    – egreg
    Commented Sep 20, 2012 at 23:04
  • @egreg I do get that output, on the top of the second page. TeXLive 2012, PDFTeX.
    – Canageek
    Commented Sep 21, 2012 at 15:58

1 Answer 1

4

The trick to making a good MWE is to keep removing packages that are not used by the example until the problem goes away. In this case

\usepackage{pdfsync}

is the tipping point. This presumably adds some whatsit nodes to enable the sync to happen that are messing up the colortbl spacing.

1
  • Sorry for not responding until now but: wow, thanks! It worked! :)
    – Markus
    Commented Sep 24, 2012 at 18:40

You must log in to answer this question.

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