I'm visualizing a csv file using pgfplotstable and longtable as followed:
\newcommand{\powerTable}[3]{
\pgfplotstabletypeset[
string type,
col sep = comma,
skip rows between index={0}{#2},
skip rows between index={#3}{1000000000},
begin table=\begin{longtable},
end table=\end{longtable},
% packo id,N,Packomania Radius,,id,circlecount,Radius,time (ns),overlap (square units),nancount,Time,,Difference,% Increase
columns={{N},{ratio},{Radius},{Difference},{Increase},{Time}},
every head row/.style={before row=\caption{#1}\\\toprule, after row=\midrule\endhead},
every last row/.style={after row=\bottomrule},
column type={l}, %default
columns/{N}/.style={column type={c}},
columns/{ratio}/.style={column name={Beste radius}},
columns/{Radius}/.style={column name={Radius}},
columns/{Difference}/.style={column name={Vergroting}},
columns/{Increase}/.style={column type={c}, column name={Vergroting (\%)}},
columns/{Time}/.style={column name={Tijd}},
]{csv/Power Packomania Problems Comparison.csv}
}
I added a caption that shows up on every page. However it also shows up multiple times in my \listoftables. I'm assuming it's because pgfplotstable actually generates duplicates of the caption for every page. But how can I make it so it only shows up once in the list of tables?
Thanks!
After a lot of trying out different stuff, I found this to work:
\newcommand{\powerTable}[3]{
\pgfplotstabletypeset[
string type,
col sep = comma,
skip rows between index={0}{#2},
skip rows between index={#3}{1000000000},
begin table=\begin{longtable},
end table=\end{longtable},
% packo id,N,Packomania Radius,,id,circlecount,Radius,time (ns),overlap (square units),nancount,Time,,Difference,% Increase
columns={{N},{ratio},{Radius},{Difference},{Increase},{Time}},
every head row/.style={before row=\caption[]{#1}\\\toprule, after row=\midrule\endhead},
every last row/.style={after row=\bottomrule},
every first row/.style={before row=\captionsetup{labelformat=empty}\caption[#1]{}\\[-23pt]},
column type={l}, %default
columns/{N}/.style={column type={c}},
columns/{ratio}/.style={column name={Beste radius}},
columns/{Radius}/.style={column name={Radius}},
columns/{Difference}/.style={column name={Vergroting}},
columns/{Increase}/.style={column type={c}, column name={Vergroting (\%)}},
columns/{Time}/.style={column name={Tijd}},
]{csv/Power Packomania Problems Comparison.csv}
}
Notice the use of \\[-23pt] in the style of every first row.
every last row/.style={after row=\caption{#1}\\\bottomrule},(note the additional \ before bottomrule). However, is it possible to get the page number to be the first page of the table? – The Oddler May 05 '16 at 22:06every head row/.style={before row=\caption[]{#1}\\\toprule, after row=\midrule\endhead}, every last row/.style={after row=\bottomrule}, every first row/.style={before row=\captionsetup{labelformat=empty}\caption[#1]{}\\}which almost works, only now I get an extra white space before the first row. But if I remove the \ it won't build. – The Oddler May 05 '16 at 22:13\tabularnewline, but it gives the same problem. And using\killdoes hide the row, but then the table doesn't shown in the lot anymore... – The Oddler May 06 '16 at 08:11\\[-25pt]. This moved the row slightly up (25 points), so counteracts the extra blank row. It's a bit of a hack, but works very nicely, even if I only show part of the rows. I have accepted your answer because you helped me get there. Thanks! – The Oddler May 06 '16 at 08:23