I have an issue in correctly changing the column width of a table. I want the columns to be formatted using the siunitx package. In my data, I have a mix of values that should be printed as is (e.g. 0.0425) and some that should be printed with the float shift (3.585 * 10 ^ -5).
When I change the column width using the table-column-width property of the S column, the values do not align any longer. It seems like the normal floating point numbers do behave as expected and the numbers with a power of 10 are in the place where they would be without column resizing.
To setup the data you can use
\documentclass{minimal}
\begin{document}
\begin{filecontents*}{data.csv}
Parameter,200,600,No-Treatment
N-Observations,209.0,209.0,195.0
Mean,2.500170353865091e-05,2.1559213174203927e-05,0.00015240802982599504
Variance,5.5824149143594136e-08,-1.1650000181975986e-08,1.7979465607149884e-07
Skewness,-0.4393776076843506,-0.06577317175679437,-0.13945687546114036
\end{filecontents*}
\end{document}
A MWE to see the issue is here:
\documentclass{paper}
\usepackage{array}
\usepackage{booktabs} % version 1.61803398
\usepackage{siunitx} % version 2.8b
\sisetup{
round-mode = places, % Rounds numbers
round-precision = 4, % to 4
}
\usepackage{pgfplotstable} % version 1.17
\pgfplotsset{compat=newest}
\begin{document}
\begin{table}[ht]
\centering
\caption{Statistical parameters example}
\pgfplotstabletypeset[
multicolumn names, % allows to have multicolumn names
col sep=comma, % the seperator in our .csv file
display columns/0/.style={
column name=Parameter, % name of first column
column type={p{0.25\textwidth}|},string type}, % use siunitx for formatting
display columns/1/.style={
column type={S[table-column-width=3cm]},string type}, % use siunitx for formatting
display columns/2/.style={
column type={S[table-column-width=3cm]},string type}, % use siunitx for formatting
display columns/3/.style={
column type={S[table-column-width=3cm]},string type}, % use siunitx for formatting
every head row/.style={
before row={\toprule}, % have a rule at top
after row={\midrule},
every last row/.style={after row=\bottomrule}
}
]{data/stat-windows-mean.csv} % filename/path to file
\end{table}
\end{document}
siunitx
version 2: correct?