0

I was testing some commands on ShareLatex, and while creating a 'tabu' environment, I came across an error: 'Misplaced \noalign'

Error related to tabu environment

I searched here in StackExchange about this error and read lots of answered questions, but none of them could solve my problem. I am pasting the code below, and I beg you to help me. Probably, there is something that my eyes didn't see.

\documentclass{article}  
\usepackage[utf8]{inputenc}  
\usepackage{amssymb}  
\usepackage{amsmath}  
\usepackage{txfonts}  
\usepackage{mathdots}  
\usepackage[classicReIm]{kpfonts}  
\usepackage{graphicx}  
\usepackage{tabu}  
\usepackage[makeroom]{cancel}  
\usepackage{geometry}  
\geometry{a4paper,left=25mm,top=15mm,bottom=15mm,right=25mm}  
\providecommand{\sin}{} \renewcommand{\sin}{\hspace{2pt}\mathrm{sen}}  
\providecommand{\tan}{} \renewcommand{\tan}{\hspace{2pt}\mathrm{tg}}  
\usepackage{calc}  
\usepackage[T1]{fontenc}  
\usepackage[table]{xcolor}  
\definecolorset{RGB}{}{}{bio,149,193,0;qui,0,141,54;biot,226,239,217}  
\setlength\parindent{0cm}  


\begin{document}

\begin{center}  
\setlength{\tabcolsep}{4pt}  

\begin{tabu}{|c|c|c|c|c|c|c|c|}  
\hline  
\rowcolor{bio} \rowfont{\color{white} \bfseries} Caráter & Grupo A & Grupo B & Grupo C & Grupo D & Grupo E & Grupo F & Grupo G \\ \hline  
\rowfont{\bfseries}                 1 & X & X & X & X & X & X & X \\ \hline  
\rowcolor{biot} \rowfont{\bfseries} 2 &   & X & X & X & X & X & X \\ \hline  
\rowfont{\bfseries}                 3 &   &   & X & X & X & X & X \\ \hline  
\rowcolor{biot} \rowfont{\bfseries} 4 &   &   &   & X & X & X & X \\ \hline  
\rowfont{\bfseries}                 5 &   &   &   & X & X &   &   \\ \hline  
\rowcolor{biot} \rowfont{\bfseries} 6 &   &   &   &   &   & X & X \\ \hline  
\end{tabu}  

\end{center}  

\end{document}

Thank you who tried to help me!

0

The problem seems to be that \rowcolor has to come after \rowfont for whatever reason:

\documentclass{article}
\usepackage{tabu}
\usepackage[table]{xcolor}
\definecolorset{RGB}{}{}{bio,149,193,0;qui,0,141,54;biot,226,239,217}
\setlength\parindent{0cm}

\begin{document}

\begin{center}
\setlength{\tabcolsep}{4pt}

\begin{tabu}{|c|c|c|c|c|c|c|c|}
\hline
\rowfont{\color{white} \bfseries}\rowcolor{bio}  Caráter & Grupo A & Grupo B & Grupo C & Grupo D & Grupo E & Grupo F & Grupo G \\ \hline
\rowfont{\bfseries}                 1 & X & X & X & X & X & X & X \\ \hline
\rowfont{\bfseries}\rowcolor{biot}  2 &   & X & X & X & X & X & X \\ \hline
\rowfont{\bfseries}                 3 &   &   & X & X & X & X & X \\ \hline
\rowfont{\bfseries}\rowcolor{biot}  4 &   &   &   & X & X & X & X \\ \hline
\rowfont{\bfseries}                 5 &   &   &   & X & X &   &   \\ \hline
\rowfont{\bfseries}\rowcolor{biot}  6 &   &   &   &   &   & X & X \\ \hline
\end{tabu}

\end{center}

\end{document} 

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.