Say, i have a text file
10.0123235 5.0234324
11.2342345 6.02343256
where the first column is value and the second is a standard deviation.
I am trying to figure out how to automatically put it into a table with \pm sign using pgfplotstable?
So what i want to be in table is $10\pm5$ and $11\pm6$.
Should be something in style like
\pgfplotstabletypeset[
columns={0},
columns/0/.style={
column name={$value$},
postproc cell content/.style={
@cell content=##0$\pm$##1
}
}
]...
but it does not work...
UPDATE: here is a minimal LaTeX example:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\pagestyle{empty}
\usepackage{pgfplotstable}
\usepackage{array}
\usepackage{colortbl}
\usepackage{booktabs}
\usepackage{eurosym}
\usepackage{amsmath}
\usepackage{pgfplotstable}
\begin{document}
\begin{table}
\pgfplotstabletypeset[
columns={0},
columns/0/.style={
column name={$0$},
postproc cell content/.append style={
/pgfplots/table/@cell content/.add={}{$\pm$ ##2 }
}
}
]{
10.0123235 & 5.0234324 \\
11.2342345 & 6.02343256
}
\end{table}
\end{document}
UPDATE2:
almost working example, the question is : how to control precision in numbers?
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\pagestyle{empty}
\usepackage{pgfplotstable}
\usepackage{array}
\usepackage{colortbl}
\usepackage{booktabs}
\usepackage{eurosym}
\usepackage{amsmath}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableread{
10.0123235 5.0234324
11.2342345 6.02343256
}\loadedtable
\pgfplotstablecreatecol[
create col/assign/.code={%
\getthisrow{0}\entry
\getthisrow{1}\dev
\edef\entry{\entry$\pm$\dev}%
\pgfkeyslet{/pgfplots/table/create col/next content}\entry
}]
{new}\loadedtable
\begin{table}
\pgfplotstabletypeset[
columns={new},
columns/new/.style={
string type,
column name={$new$},
}
]\loadedtable
\end{table}
\end{document}
UPDATE3: I found a nice topic on printing complex numbers. It is actually very similar to what i want to achieve... Trying to bend their result to my needs...

tokssuch as\pgfmathprintnumber[fixed,precision=5]{...}etc. – percusse May 06 '14 at 06:59