I'm currently loading a table via '\pgfplotstabletypeset` and I found out that I can manipulate the header like this:
\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
a b c d
1 4 5 1
2 3 1 5
3 5 6 1
4 1 4 9
5 3 4 7
\end{filecontents*}
\begin{document}
\pgfplotstabletypeset[
assign column name/.style= {%
/pgfplots/table/column name={#1 $\left[\frac{1}{\textrm{s}}\right]$}
},
] {data.csv}
\end{document}
Now I have come to a point where I only want to change the column names of columns > 0 (so the first one should stay just the way it is). However all my attempts to create a conditional statement that uses \pgfplotstablecol
in order to retrieve the column index have failed.
What I want is something like this: \documentclass{article} \usepackage{pgfplotstable} \usepackage{filecontents}
\begin{filecontents*}{data.csv}
a b c d
1 4 5 1
2 3 1 5
3 5 6 1
4 1 4 9
5 3 4 7
\end{filecontents*}
\begin{document}
\pgfplotstabletypeset[
assign column name/.style= {%
if first column -> /pgfplots/table/column name={#1}
else -> /pgfplots/table/column name={#1 $\left[\frac{1}{\textrm{s}}\right]$}
},
] {data.csv}
\end{document}
What is the proper way to tackle this problem?
\pgfplotstablecol
that already does keep the current column number...\pgfplotstablecol
should work in this context (the documentation isn't using it like it would be necessary and I can't get it to work...)