2

It is probably apparent I'm trying to color the last column green, but for me, it shows up as white still.

Also, if I understand correctly '>' is just used by tabularx for demarcating formatting information?

\documentclass[compress,red,notes]{beamer}

\usepackage{tabularx}
\usepackage{xcolor}
\usepackage{colortbl}

\definecolor{Green}{rgb}{0,1,0}

\begin{document}

\frame{\frametitle{Performance}

\begin{figure}
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{lrrrrrrrr>{\columncolor[rgb]{Green}}r}
\textbf{(a)} \hspace{1.2cm} & Max. $\mu$ & Model &
  Standard FBA & Fitted FBA & GIMME & iMAT & Lee et al. & FALCON\\
 & 75 \%& Yeast~5 MC & 0.66 & 0.66 & NaN  & 0.57 & 0.64 & 1 \\
 & 75 \%& Yeast~7 MC & 0.66 & 0.66 & 0.68 & 0.66 & 0.66 & 0.98\\
 & 75 \%& Yeast~5 HC & 0.73 & 0.78 & 0.75 & 0.66 & 0.98 & 0.99\\
Pearson's r
 & 75 \%& Yeast~7 HC & 0.70 & 0.70 & 0.80 & 0.66 & 0.98 & 0.99\\
 & 85 \%& Yeast~7 MC & 0.62 & 0.62 & 0.65 & 0.62 & 0.62 & 0.97\\
 & 85 \%& Yeast~5 HC & 0.88 & 0.89 & 0.9  & 0.81 & 0.99 & 0.99\\
 & 85 \%& Yeast~7 HC & 0.67 & 0.67 & 0.87 & 0.62 & 0.98 & 0.98\\
\end{tabular}}
\caption{Here is a caption.}
\label{tab:FalcPerf}
\end{figure}
}

\end{document}
2
  • 1
    I'm not sure I understad you question about > the syntax comes from array package and inserts commands in each cell of that column. Commented May 30, 2014 at 20:57
  • OK, that clarifies it. I had only looked at the tabularx documentation.
    – bbarker
    Commented May 31, 2014 at 0:01

2 Answers 2

2

You have 10 columns in your specification, yet you only use 9. Another reason why an abbreviated column specification might be more manageable:

enter image description here

\begin{tabular}{l*{7}{r}>{\columncolor{Green}}r}
  %...
\end{tabular}
2
  • @David, I don't quite follow your comment, but I do appreciate the help! Werner: thanks, forgot I could do that - makes counting much easier.
    – bbarker
    Commented May 30, 2014 at 23:50
  • Ah, I see the "[rgb]" in [rgb]{Green} is not needed and in fact is incorrect. But it seems to match the syntax found in Herbert Voss's book.
    – bbarker
    Commented May 31, 2014 at 0:05
3

enter image description here

you miscounted the columns and you either need to give [rgb] and three numbers or just a name (same rules as for \color

\documentclass[compress,red,notes]{beamer}

\usepackage{tabularx}
\usepackage{xcolor}
\usepackage{colortbl}

\definecolor{Green}{rgb}{0,1,0}

\begin{document}

\frame{\frametitle{Performance}

\begin{figure}
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{lrrrrrrr>{\columncolor{Green}}r}
\textbf{(a)} \hspace{1.2cm} & Max. $\mu$ & Model &
  Standard FBA & Fitted FBA & GIMME & iMAT & Lee et al. & FALCON\\
 & 75 \%& Yeast~5 MC & 0.66 & 0.66 & NaN  & 0.57 & 0.64 & 1 \\
 & 75 \%& Yeast~7 MC & 0.66 & 0.66 & 0.68 & 0.66 & 0.66 & 0.98\\
 & 75 \%& Yeast~5 HC & 0.73 & 0.78 & 0.75 & 0.66 & 0.98 & 0.99\\
Pearson's r
 & 75 \%& Yeast~7 HC & 0.70 & 0.70 & 0.80 & 0.66 & 0.98 & 0.99\\
 & 85 \%& Yeast~7 MC & 0.62 & 0.62 & 0.65 & 0.62 & 0.62 & 0.97\\
 & 85 \%& Yeast~5 HC & 0.88 & 0.89 & 0.9  & 0.81 & 0.99 & 0.99\\
 & 85 \%& Yeast~7 HC & 0.67 & 0.67 & 0.87 & 0.62 & 0.98 & 0.98\\
\end{tabular}}
\caption{Here is a caption.}
\label{tab:FalcPerf}
\end{figure}
}

\end{document}
1
  • Thanks! I am curious if it is possible or desirable to have an error emitted in the case that there is a mismatch between the column specification and number of table columns? More of a tabularx issue if anything I suppose.
    – bbarker
    Commented May 30, 2014 at 23:48

You must log in to answer this question.

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