I've a CSV file what I want process with csvsimple. My desire is to color some rows based on a conditional (one specified column has bigger value). Here is an MWE:
\documentclass[12pt]{article}
\usepackage{filecontents}
\usepackage{csvsimple}
\usepackage[table]{xcolor}
\begin{document}
\begin{filecontents*}{mwe.csv}
a,b,c,d
1,1,2,2
1,3,2,1
\end{filecontents*}
\begin{tabular}{*{4}{c}}
\csvreader[
head to column names,
before line={\ifnum\d>1\rowcolor{gray}\fi},
late after line={\\}
]{mwe.csv}{}{
\a&\b&\c&\d
}
\end{tabular}
\end{document}
In this case I gave an error message:
! Misplaced \noalign.
<recently read> \noalign
l.18 }
How can I solve it?


