siunitx
siunitx copied to clipboard
Align uncertainties at decimal point in table
siunitx does not align the uncertainties in tables.
Consider the following minimal example:
\documentclass[margin=1pt]{standalone}
\usepackage[
separate-uncertainty=true,
table-align-uncertainty=true,
]{siunitx}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{S[table-format=3.1(3)]}
\toprule
{$x \mathbin{/} \si{\ohm}$} \\
\midrule
663.0 +- 12.1 \\
670.1 +- 10.9 \\
678.0 +- 9.1 \\
678 +- 8 \\
\bottomrule
\end{tabular}
% workaround with two columns and multicolumn
\begin{tabular}{S[table-format=3.1] @{${}\pm{}$} S[table-format=2.1]}
\toprule
\multicolumn{2}{c}{$x \mathbin{/} \si{\ohm}$} \\
\midrule
663.0 & 12.1 \\
670.1 & 10.9 \\
678.0 & 9.1 \\
678 & 8 \\
\bottomrule
\end{tabular}
\end{document}
I have the same problem, but I can't use the workaround as my header is wider than the numbers.
Would it be possible to implement the feature, that you can specify a separate number for the integral and decimal part of the uncertainty? Like table-format=3.1(2.1)
in this example?
Does anybody know another workaround? Or will there be a fix in the future?
This is something like an table-align-uncertainty-decimal
option: doable but not currently implemented.
This would be awesome!
Can someone please share the fix?
Can someone please share the fix?
It's been in the release for over a year - what version are you using?
It's been in the release for over a year - what version are you using?
I believe you! I just think it'd be nice to share the fix for those who (like me) land on this issue after googling how to fix this. I wasn't able to extract the information from the pull request.
@fepegar 'Update your installation'?
Ah, I understand. I guess you mean if I run the OP's code I won't get this issue anymore. Maybe my code was different. Apologies for the misunderstanding!