# Problem with colortbl and supertable, color width of the row with leading “@{}”

I have a problem with colortbl \rowcolor that insists on making the color width of the rows longer than the actual row width. Snippet of the code:

\documentclass[a5paper, 10pt, twoside]{article}
\usepackage[english, norsk]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{amssymb, amsmath}
\usepackage{color}
\usepackage{graphicx, tabularx, fancyhdr, colortbl}
\usepackage[a5paper, height=18.0cm, inner=1.3cm, outer=0.65cm]{geometry}
\usepackage{supertabular}
\usepackage{hyperref}
\usepackage[ttbnonum]{flowfram}

\twocolumn[1-2]

\begin{document}
\tiny
\begin{supertabular}{|p{0.38\linewidth}l@{\,}|lrl|}
\multicolumn{5}{p{0.7\linewidth}}{\textbf{\raggedright \\ \footnotesize No name }} \\
\hline
\rowcolor[gray]{0.8} (project) (Ss) &  & \hspace{-8pt} Fp north & \hspace{-8pt} \textbf{3B:} & \hspace{-10pt}2 \\
\rowcolor[gray]{1.0} (project) (!) &  & \hspace{-8pt} Fp north & \hspace{-8pt} \textbf{3C:} & \hspace{-10pt}2 \\
\rowcolor[gray]{0.8} (project) (Ds) &  & \hspace{-8pt} Fp north & \hspace{-8pt} \textbf{5C:} & \hspace{-10pt}2b \\
\rowcolor[gray]{1.0} (project) (Ss) &  & \hspace{-8pt} Fp north & \hspace{-8pt} \textbf{13A:} & \hspace{-10pt}7 \\
\rowcolor[gray]{0.8} (project) &  & \hspace{-8pt} Fp north & \hspace{-8pt} \textbf{13B:} & \hspace{-10pt}1 \\
\rowcolor[gray]{1.0} (project) (Ss) &  & \hspace{-8pt} Fp north & \hspace{-8pt} \textbf{13B:} & \hspace{-10pt}2 \\
\end{supertabular}
\end{document}


The table expands across several pages (its genereated by some C++ code I'm making). The output looks like this:

The problem lies with the leading @{} in the definition of the supertable (I have to use super table since that is the only one compatible with flowfram).

I could put a negative \hspace, but that will still "indent" the second line in the p{...}.

(Been struggling with this one for 3 years now...)

-
Are you adding @{} by yourself to get rid of extra column space? – Harish Kumar Apr 19 '12 at 10:47
Of course you know that your code example does not produce the problem you're talking about. – egreg Apr 19 '12 at 12:20
Yup writing everything. I'm acutally making a pdf from some custom xml data files that I have, and I don't know up front what each single line will be (currently I have 900 "objects" in the xml file). Thus I must be carefull to make "everything" fit and look nice. – Truls Apr 19 '12 at 13:31

\documentclass[a5paper, 10pt, twoside]{article}

\usepackage{colortbl}

\begin{document}\makeatletter

\begin{tabular}{@{}|@{}p{0.38\linewidth}l@{\,}|lrl|}
\hline
\rowcolor{red}(project)(Ss) &  &  Fp north &  \textbf{3B:} & \hspace{-10pt}2 \\
(ddproject) (!) &  &  Fp north &  \textbf{3C:} & \hspace{-10pt}2 \\
\end{tabular}
\end{document}


shows the same behaviour

Looks like a bug to me, but can't look now, but I thought I would post the simplified MWE to help anyone looking at this.

It is a bug (I think) but you can avoid it by

 \setlength\tabcolsep{0pt}


you will then probably have to insert some spacing within the table to space things out a bot more.

\begin{tabular}{@{}|@{}p{0.38\linewidth}>{\hspace{12pt}}l|>{\hspace{12pt}}l>{\hspace{12pt}}r>{\hspace{12pt}}l|}
\hline
\rowcolor{red}(project)(Ss) &  &  Fp north &  \textbf{3B:} & \hspace{-10pt}2 \\
(ddproject) (!) &  &  Fp north &  \textbf{3C:} & \hspace{-10pt}2 \\
\end{tabular}

-
Hmm... That might work for me. The laatex code does'nt really have to be "neat" as its generated by a c++ program. Will try it out. – Truls Apr 19 '12 at 13:34
Tried it out. Its a good workaround for me. Now I can define the separators in a more understandable way: use positive values for the hspace. Super! thanks a lot! – Truls Apr 19 '12 at 14:39
Follow up question, David: What does the @{} around the first "|" do, now that the colsep=0? – Truls Apr 19 '12 at 15:10
it doesn't do anything (actually it does do soemthing, it stopks TeX adding \hskip0pt in that place but mainly it is just left over from my trials) – David Carlisle Apr 19 '12 at 15:21