1

What is wrong with this please? I have error

! Undefined control sequence. Fit& 1& 2& 3& 4& 5& 6& 7& 8& 9& \cellcolor

Thank you

\documentclass[12pt,a4paper]{report}
\usepackage[locale=FR]{siunitx}
\usepackage{booktabs}
\usepackage{xcolor}

\begin{document}


\noindent
\textbf{Konvergence - MOST a BRITE}

\begin{table}[h!!]
\renewcommand{\arraystretch}{1.45}
\scriptsize
\begin{tabular}{r|S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]}

Fit&    1&  2&  3&  4&  5&  6&  7&  8&  9& \cellcolor{blue!25}10 &  11\\

\end{tabular}
\end{table}

\end{document} 
Bernard
  • 271,350

2 Answers2

5

You need to load table option of xcolor, which loads colortbl containing \cellcolor, etc.

\documentclass[12pt,a4paper]{report}
\usepackage[locale=FR]{siunitx}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\begin{document}
\noindent
\textbf{Konvergence - MOST a BRITE}
\begin{table}[h!!]
\renewcommand{\arraystretch}{1.45}
\scriptsize
\begin{tabular}{r|S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]}
Fit&    1&  2&  3&  4&  5&  6&  7&  8&  9& \cellcolor{blue!25}10 &  11\\
\end{tabular}
\end{table}
\end{document} 

Btw why is your table so wide?

1

Despite being correct in the causes, @user156344's solution did not help me. Further Googling lead me here:

The two solutions in that post are the following:

  1. Add the command \PassOptionsToPackage{table}{xcolor} on your preamble before \documentclass.
  2. Add the option table directly in your \documentclass.
Kernel
  • 11