After figuring out why my MCVE wasn't working as expected, I think I've found a bug in either babel or csvsimple package. This compiles:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{test.csv}
n,pibreal,pibnom,deflactor,c,isr,trc,tdeflactado,trcdeflactado,I,x,m
2000,1059317580733.46,393302970000,37.127956446,281965700000,10616220000,437870990000,3941585537.81615,162572550457.059,109702668399.757,139614000000,172276800000
\end{filecontents*}
\usepackage[utf8]{inputenc}
\usepackage{csvsimple}
\begin{document}
\begin{tabular}{|l|r|r|}%
\bfseries Año & \bfseries PIB & \bfseries Consumo privado%
\csvreader{test.csv}{}%
{\\ \hline \csvcoli & \csvcoliii & \csvcolv}%
\end{tabular}
\end{document}
But this doesn't:
\documentclass{article}
\usepackage[spanish]{babel}
\usepackage{filecontents}
\begin{filecontents*}{test.csv}
n,pibreal,pibnom,deflactor,c,isr,trc,tdeflactado,trcdeflactado,I,x,m
2000,1059317580733.46,393302970000,37.127956446,281965700000,10616220000,437870990000,3941585537.81615,162572550457.059,109702668399.757,139614000000,172276800000
\end{filecontents*}
\usepackage[utf8]{inputenc}
\usepackage{csvsimple}
\begin{document}
\begin{tabular}{|l|r|r|}%
\bfseries Año & \bfseries PIB & \bfseries Consumo privado%
\csvreader{test.csv}{}%
{\\ \hline \csvcoli & \csvcoliii & \csvcolv}%
\end{tabular}
\end{document}
The only difference is that the later imports the spanish babel package. Using otherlanguage environment to set the language to english allows the compilation, so the problem is between the spanish and csvsimple packages.
Best Answer
The code in
csvsimple.sty
uses\roman
in five places; since\roman
is redefined bybabel-spanish
, this usage breaks.You can file a bug report to the author and, in the meantime, fix yourself the issue.