2

I have a Problem with a \pgfplotstableread command. I m always getting the output:

Package PGF Math Error: Could not parse input 'VasconcelosEtAl2012' as a floating point number, sorry. 
The unreadable part was near 'VasconcelosEtAl2012'.. }

My intention is to use a table (inline or as csv) with some rows filled with data to process with biber(Citecommands) or siunitx (Angles for coordinates).

So here is a MWE as I understand it:

\documentclass{minimal}
\usepackage{siunitx}
\usepackage[T1]{fontenc}
\usepackage{stix}
\usepackage{graphicx} 
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{pgfplotstable}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{longtable}
\usepackage[style=authoryear-comp,maxbibnames=25, maxcitenames=2,backend=biber]{biblatex}
    %some bib-libraries
\usepackage{booktabs} 

\begin{document}
\begin{landscape}%
\pgfplotstabletypeset[begin table=\begin{longtable},end table=\end{longtable},
header=true, col sep=comma, row sep=newline,
%0
columns/0/.style={ string replace*={##1}{\textcite{##1}}, column name {Quelle1}, string type,  column type =l},
%1
columns/1/.style={column name={Ort}, verb string type, column type = l},
%2
columns/2/.style={column name={Longitude}, string replace*={##1}{\ang{##1}},string type, column type=r},
%3
columns/3/.style={column name={Latitude},string replace*={##1}{\ang{##1}}, string type, column type=r},
%4
columns/4/.style={column name ={Wert}, column type=r, dec sep align,fixed,precision=2},
%5
columns/5/.style={column name={[Einheit]}, replace string*{##1}{$##1$}, string type},
%6
columns/6/.style={column name=Beschreibung, verb string type, column type=l},
%7
columns/7/.style={column name={$\rho [kg/m^3]$}, column type=r, dec sep align,fixed,precision=2},
%8
columns/8/.style={column name={Quelle $\rho$}, string replace*={##1}{\textcite{##1}}, string type, column type=l},
%9
columns/9/.style={column name={$l$}, precision=2, column type=r},    
%10
columns/10/.style={column name={NAI [$m^3\cdot ha^{-1}$]}, dec sep align,fixed,precision=2, column type=r},
%11
columns/11/.style={column name={Spezien}, string replace*{##1}{\textit{##1}}, string type},
]{
Autor,Ort,Longitude,Latitude,Wert,Einheit,Beschreibung,Dichte,DQuelle,la,NAI,Baumarten
VasconcelosEtAl2012,Brasilien ,-1;19;0,+47;57;0,14.45,$Mg / ha \cdot year$,ANPP,0.704,NogueiraEtAl2005,0.5,4.928,-
BernierEtAl2007,Chibougamau Quebec,+49;41;31.2,+74;25;55.2,2090,$kg /ha \cdot yr$, ANPP Stems,0.45,AseevaEtAl2014,,4.644444444,Picea mariana  (Black Spruce) 
}
\end{landscape}%
\end{document}`

In the original file I'm using BiBLaTeX, but this replacement is working in another table, where I just had keys in a row, that's why I guess it has something to do with the siunitx package or I don't see a missing bracket.

And yes the table is too wide for standard formats, but this is another problem.

----------

So most of the problems are solved, but here is the next:

\documentclass{article}
\usepackage[margin=1cm,a3paper]{geometry}
\usepackage{siunitx}
\usepackage[T1]{fontenc}
\usepackage{stix}
\usepackage{graphicx} 
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{pgfplotstable}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{longtable}
\usepackage[style=authoryear-comp,maxbibnames=25,maxcitenames=2,backend=biber]{biblatex}
%some bib styles and files
\usepackage[babel,german=quotes]{csquotes}
\usepackage{booktabs} 
\pgfplotsset{compat=1.12}

\usepackage{booktabs} 

\begin{document}


\begin{landscape}%
\pgfplotstabletypeset[begin table=\begin{longtable},end     table=\end{longtable},
header=true, col sep=comma, use comma, row sep=newline,
every head row/.append style={after row=\endhead},
%0
columns/Autor/.style={string replace*={##1}{\textcite{##1}},column name={Quelle}, string type, column type =l},
%1
columns/Ort/.style={column name={Ort}, verb string type, column type = l},
%2
columns/Longitude/.style={column name={Longitude},string replace*={##1}    {\ang{##1}}, string type, column type=r},
%3
columns/Latitude/.style={column name={Latitude},string replace*={##1}{\ang{##1}}  , string type, column type=r},
%4
columns/Wert/.style={column name ={Wert}, column type=r, dec sep align,fixed,precision=2},
%5
columns/Einheit/.style={column name={[Einheit]}, string replace*={##1}{$##1$}, string type},
%6
columns/Beschreibung/.style={column name=Beschreibung,string replace*={##1}{$\mathrm{##1}$}, string type, column type=l},
%7
columns/Dichte/.style={column name={$\rho [kg/m^3]$}, column type=r, dec sep align,fixed,precision=2},
%8
columns/DQuelle/.style={column name={Quelle $\rho$}, string replace*={##1}{\textcite{##1}}, string type, column type=l},
%9
columns/la/.style={column name={$l$}, precision=2, column type=r},
%10
columns/NAI/.style={column name={NAI [$m^3\cdot ha^{-1}$]},fixed,precision=2, column type=r , dec sep align},
%11
columns/Baumarten/.style={column name={Spezien}, string replace*={##1}{\textit{##1}}, string type, column type =l}
]
{
Autor,Ort,Longitude,Latitude,Wert,Einheit,Beschreibung,Dichte,DQuelle,la,NAI,Baumarten
BernierEtAl2007,Groundhog River Ontario,48;13;1.2,82;9;21.6,,,,0.45,AseevaEtAl2014,,,Picea mariana  (BS)
}
\end{landscape}%
\end{document}

The output is:

File ended while scanning use of \pgfutil@in@@.

I guess it has something to do with the "empty cells"... It works with the lines provided in the MWE above, but as soon it start to read those ,,, it stop working. Is the empty cell with usefull here?

  • your row sep is a newline but you have % chars at the end so it can't find the new row. – percusse Jun 12 '15 at 15:00
  • yes i gave that already a try, but then it comes to ! Package pgfplots Error: Sorry, could not retrieve column '' from table '<inli ne_table>'. Please check spelling (or introduce name aliases).. – lanthanoid Jun 12 '15 at 15:05
  • So because there are more errors you want to keep the %s ? – percusse Jun 12 '15 at 15:06
  • yes, propably not the best way, but I dont know how to solve that in another way – lanthanoid Jun 12 '15 at 15:08
  • it is not a way. You are not able to read the data that way – percusse Jun 12 '15 at 15:19
2

The following fixes mosts of the errors. You have a number of misspelled keys including a replace string* instead of string replace* and a verb string type instead of string type.

There remains some mismatch in the number of columns that I can't track down yet, but I am posting this in the hope that you will be able to get further.

\documentclass{article}
\usepackage[margin=1cm,a3paper]{geometry}
\usepackage{siunitx}
\usepackage[T1]{fontenc}
\usepackage{stix}
\usepackage{graphicx} 
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{biblatex}
\usepackage{pgfplotstable}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{longtable}

\usepackage{booktabs} 
\pgfplotsset{compat=1.12}

\begin{document}
\begin{landscape}
\pgfplotstabletypeset[begin table=\begin{longtable},end table=\end{longtable},
header=true, col sep=comma, use comma, row sep=newline,
every head row/.append style={after row=\endhead},
%0
columns/Autor/.style={string replace*={##1}{\textcite{##1}},column name={Quelle}, string type, column type =l},
%1
columns/Ort/.style={column name={Ort}, verb string type, column type = l},
%2
columns/Longitude/.style={column name={Longitude},string replace*={##1}{\ang{##1}}, string type, column type=r},
%3
columns/Latitude/.style={column name={Latitude},string replace*={##1}{\ang{##1}}  , string type, column type=r},
%4
columns/Wert/.style={column name ={Wert}, column type=r, dec sep align,fixed,precision=2},
%5
columns/Einheit/.style={column name={[Einheit]}, string replace*={##1}{$##1$}, string type},
%6
columns/Beschreibung/.style={column name=Beschreibung, verb string type, column type=l},
%7
columns/Dichte/.style={column name={$\rho [kg/m^3]$}, column type=r, dec sep align,fixed,precision=2},
%8
columns/DQuelle/.style={column name={Quelle $\rho$}, string replace*={##1}{\textcite{##1}}, string type, column type=l},
%9
columns/la/.style={column name={$l$}, precision=2, column type=r},
%10
columns/NAI/.style={column name={NAI [$m^3\cdot ha^{-1}$]}, dec sep align,fixed,precision=2, column type=r},
%11
columns/Baumarten/.style={column name={Spezien}, string replace*={##1}{\textit{##1}}, string type}
]{
Autor,Ort,Longitude,Latitude,Wert,Einheit,Beschreibung,Dichte,DQuelle,la,NAI,Baumarten
VasconcelosEtAl2012,Brasilien ,-1;19;0,+47;57;0,14.45,Mg / ha \cdot year,ANPP,0.704,NogueiraEtAl2005,0.5,4.928,-
BernierEtAl2007,Chibougamau Quebec,+49;41;31.2,+74;25;55.2,2090,kg /ha \cdot yr,ANPP Stems,0.45,AseevaEtAl2014,0,4.644444444,Picea mariana  (Black Spruce)
}
\end{landscape}
\end{document}
  • yes thanks, now I have this this mismatch in column number too. I will ask again if I need to... – lanthanoid Jun 12 '15 at 17:13
  • the mismatch seems to be generated by the dec sep align key, I've put it at the end, and that's working right now – lanthanoid Jun 12 '15 at 20:02
  • Indeed, placing dec sep align after the column type key seems to be the crucial ordering. – Andrew Swann Jun 13 '15 at 11:38

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.