1

When I generate a document with the code below (data file copied at the bottom), my table is correctly imported. If I change a word in, for example the caption, and do a diff of the two files using latexdiff. latexdiff fieA.tex fileB.tex > difefile.tex

If I try to generate my document with the differences I get the following error:

Error:

Package pgfplots Warning: You requested to open table '', but there is also a ' .tex'. TeX will automatically append the suffix '.tex', so I will now open '.te x'. Please make sure you don't accidentally load TeX files - this may produce u nrecoverable errors. on input line 95.

! Package pgfplots Error: Sorry, could not retrieve column 'NA1' from table ''. Please check spelling (or introduce name aliases)..

See the pgfplots package documentation for explanation. Type H for immediate help. ...
l.95 ]\DIFaddend \dataFile

Code:

\documentclass[12pt]{article}

\usepackage{booktabs,colortbl}    
\usepackage{csvsimple} 
\usepackage{pgfplotstable,filecontents,booktabs}        
\usepackage{longtable,lscape}

\begin{document}

\pgfplotstableread[col sep=comma]{dataFile.csv}\dataFile

\pgfplotstableset{%
 begin table=\begin{longtable}, 
 end table=\end{longtable}}
 \pgfplotstabletypeset[
   string type, header=false, 
   columns={NA1,res,sum V (e14 m3),Impr P,sum RMSE (m),Impr RMSE P},   
   columns/NA1/.style={column name={ },column type = {c|},string type}, 
   columns/res/.style={column type={c|},
   column name={ },precision=0,fixed,fixed zerofill},
   columns/sum V (e14 m3)/.style={column name={sum V (10^{14}m^3)},
   precision=4,fixed,fixed zerofill},
   columns/Impr P/.style={column type={c|},
   column name={Impr P},precision=4,fixed,fixed zerofill},
   columns/sum RMSE (m)/.style={column name={sum RMSE (m)},
   precision=1,fixed,fixed zerofill},
   columns/Impr RMSE P/.style={column type={c|},
   column name={Impr RMSE P},precision=1,fixed,fixed zerofill},
   every head row/.style={    output empty row,   
   before row={\caption{\label{dataFile}Sum over...}\\
   \toprule    
    \multicolumn{2}{c|}{} &\multicolumn{2}{c|}{Volume diff }      
    &\multicolumn{2}{c|}{hs rmse (m)}\\    
    \multicolumn{1}{c|}{} &\multicolumn{1}{c|}{res (km)} 
    &\multicolumn{1}{c}{sum (10$^{14}$ m$^3$)}    
    &\multicolumn{1}{c|}{Improvement (\,\%)}    &\multicolumn{1}{c}{sum (m)}    
    &\multicolumn{1}{c|}{Improvement (\,\%)} \\\midrule}}, 
    every row no 1/.style={after row=\hline},
    every row no 3/.style={after row=\hline}, 
    every row no 5/.style={after row=\hline}, 
    every last row/.style={after row=\hline}, 
    every even row/.style={ before row={\rowcolor{lightgray}}},
    multicolumn names=c]\dataFile

\end{document}

dataFile.csv:

NA1,res,sum V (e14 m3),Impr P,sum RMSE (m),Impr RMSE P%

Base,5,1.4,,2030,

Optimal,5,1.6,-11.8,2090,-2.88

Base,10,3.1,,5260,

Optimal,10,3.2,-3.83,4850,7.95

Base,25,16,,12400,

Optimal,25,14,11.2,11100,10.4
  • In the latexdiff manual it states that command arguments need to be surrounded by curly braces, so try \pgfplotstableread[col sep=comma]{dataFile.csv}{\dataFile} and similarly for the long command – frederik Jan 12 '17 at 8:51
  • Thanks, that did fix that issue. The differences are not shown however but that may be another post. Maybe you could move you comment to an answer so that this question can be flagged as solved. – Kevin Jan 12 '17 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.