Sorry if the title is too big, but I didn't know how to express it as something specific, I try to generate new columns in a table using custom commands, for instance:
\documentclass{scrbook}
\usepackage[nomessages]{fp}
\usepackage{ifthen}
\usepackage{pgfplotstable}
\usepackage{pgfplots}
\newcommand{\newcoltest}[1]%my custom command
{
\ifthenelse{\isodd{#1}}
{\FPeval{\result}{clip(#1+1)}}
{\FPeval{\result}{clip(#1*3/2-1)}}
\result
}
\begin{document}
\pgfplotstableread{
T
1
2
3
4
5
6
7
8
9
10
}\loadedtable
\pgfplotstablecreatecol[
create col/assign/.code={%
\getthisrow{T}\vala
\edef\newentry{\noexpand\newcoltest{\vala}}%
\pgfkeyslet{/pgfplots/table/create col/next content}\newentry
}%
]{Sa}{\loadedtable}
\pgfplotstabletypeset[string type]\loadedtable%critic line
\end{document}
the critic line is \pgfplotstabletypeset[string type]\loadedtable
, which works only with string type
, when I change to another type or even do not put anything, an error ocurrs.
I put \noexpand
based on pgfplotstable: Use command when defining new column with create col/assign/.code?, since without this I think that my command is not recognized.
I also can't plot it using tikz
, and I think this is related