1

Hello i'm trying to reproduce this tableenter image description here

this is my code but the "\rowcolors" line is giving me this enter image description here

    \documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning,shadows,trees}
\usepackage{capt-of}
\usepackage{xspace}
\usepackage[table]{xcolor}
\title{A title}
\author{Author}
\date{Janvier 2018}
\begin{document}
    \begin{center}
    \rowcolors{0}{black}{gray} 
    \begin{tabular}{rrrrr}

\hline
    \begin{bf}Repository Operations\end{bf} &  \begin{bf} CVS \end{bf} & \begin{bf} Subversion \end{bf} & \begin{bf} git \end{bf} & \begin{bf} mercurial \end{bf} & \hline\\
     atomic commit & yes & yes & yes & yes
\end{tabular}
\end{center}
\end{document}

i used tikz previously to make some diagrams does it have anything to do ? like a conflict between xcolor and tikz ?

could somebody help me pinpoint the reason of this error ? thank you by advance !

2

When this happens usually means that another package loads xcolor without the option table, in this case tikz is doing it. So just load xcolor before

\usepackage[table]{xcolor}
\usepackage{tikz}

And that should take care of the conflict.

Down below there are two other problems in your code I corrected

  • Change \hline \\ to \\ \hline
  • Remove & at the end of line
  • Change black to white

This is a working version

\documentclass[table]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

\usepackage[table]{xcolor}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning,shadows,trees}
\usepackage{capt-of}
\usepackage{xspace}

\title{A title}
\author{Author}
\date{Janvier 2018}
\begin{document}
\begin{center}
  \rowcolors{0}{white}{gray} 
  \begin{tabular}{rrrrr}
    \hline
    \begin{bf}Repository Operations\end{bf} &  \begin{bf} CVS \end{bf} & \begin{bf} Subversion \end{bf} & \begin{bf} git \end{bf} & \begin{bf} mercurial \end{bf} \\ \hline
    atomic commit & yes & yes & yes & yes
  \end{tabular}
\end{center}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.