2

I was wondering how can I define siunitx for columns of my tables when values in that column include mean \pm std?

3 Answers 3

2

Try this:
enter image description here

\documentclass{article}
\usepackage{siunitx} % Import siunitx package
\usepackage{booktabs} % For nicer table lines

\begin{document}

\begin{table}[ht]
\centering
\begin{tabular}{
  l % left-aligned text column
  S[table-format=2.1(2)] % numeric column with mean ± std format
}
\toprule
Experiment & {Value (mean ± std)} \\
\midrule
A & 10.5 \pm 1.2 \\
B & 15.6 \pm 0.8 \\
C & 7.8  \pm 0.9 \\
\bottomrule
\end{tabular}
\caption{Experimental results}
\end{table}

\end{document}
2
  • You should provide an MWE, that we can see what you try.
  • It is not clear what result you expected.
  • You may like the following table design:

enter image description here

For MWE I borrow code from @John Smith answer:

\documentclass{article}
\usepackage{siunitx}  
\usepackage{booktabs} 

\begin{document}
    \begin{table}[ht]
\centering
\sisetup{separate-uncertainty,
         %retain-zero-uncertainty,
         %table-alignment-mode = format,
         %tight-spacing,
         }
\begin{tabular}{l 
                S[table-format=2.1(2)] 
                }
    \toprule
Experiment & {Value (mean ± std)} \\
    \midrule
A & 10.5 \pm 1.2 \\
B & 15.6 \pm 0.8 \\
C & 7.8  \pm 0.9 \\
    bottomrule
\end{tabular}
\caption{Experimental results}
    \end{table}
\end{document}

For more possibilities how to set uncertainty numbers in table, consult siunitx package documentation,

2

I think you should display the means and standard deviations in separate columns. Depending on the use case, one may be interested in mean plus/minus 1 standard deviation, plus/minus 2 standard deviations, etc.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage{siunitx}    % for 'S' column type
\usepackage{booktabs}   % for well-spaced horizontal rules ('\toprule', etc)

\begin{document}

\begin{center}
\begin{tabular}{@{} l S[table-format=2.2] S[table-format=2.2] @{}}
\toprule
Variable & {Mean} & {St.Dev.} \\
\midrule
Apples   &  2.34  &   1.12    \\
Oranges  & 15.4   &  12.05    \\
\bottomrule
\end{tabular}
\end{center}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .