-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Padding not correct / decimal point at wrong place #725
Comments
Minimised example \documentclass{article}
\usepackage{siunitx}
\sisetup{minimum-decimal-digits = 4}
\begin{document}
\qty{5.407 \pm 0.04}{\metre}
\end{document} |
Off-topic here, but you seem to have missed that |
Thanks a lot for your hot fix 🎉 Unfortunately, users of our library might not be easily able to use an updated version of siunitx. E.g. even for the current LTS Ubuntu (Ubuntu 22.04 jammy), the siunitx version that comes shipped with That's why I'm asking if there is a workaround when using version \NewDocumentCommand{\UncertStat}{}{_{\text{stat}}}
\NewDocumentCommand{\UncertSys}{}{_{\text{sys}}}
\sisetup{input-digits=0123456789\UncertStat\UncertSys\UncertSystematic}
$$\qty{5.407 \pm 0.010\UncertSys \pm 0.04\UncertStat e-7}{\m}$$ |
@Splines The auxiliary hasn't changed name, so \ExplSyntaxOn
\cs_gset:Npn \__siunitx_number_digits_uncert_aux:nn #1#2
{
\exp_not:n {#2}
\int_compare:nNnT
{ \l__siunitx_number_min_decimal_int - \tl_count:n {#1} } > 0
{
\prg_replicate:nn
{ \l__siunitx_number_min_decimal_int - \tl_count:n {#1} } { 0 }
}
}
\ExplSyntaxOff will locally adjust the code. I'm still not clear why you are not using the built-in multi-uncertainty support in v3.1. |
Thanks a lot!
I thought that multi-uncertainty support only referred to being able to add multiple \sisetup{uncertainty-descriptor-mode=subscript} and then generate programatically the following output for quantities: \qty[uncertainty-descriptors={customlabel1,customlabel2}]{1.2 \pm 0.1 \pm 0.05}{\m} |
\qty{5.407 \pm 0.010 \pm 0.04}{\m} Is there a way to print the |
No, becaue the main value here has 3 decimal places, so the uncertainty must also be specified to the same precision. |
(Or rather that's the internal model |
Ah ok and I guess there's also no (easy) way to overwrite that, right? |
@Splines I can imagine an approach but that's definitely a non-trivial feature request for the current release not something that can be shoehorned into a past release. |
In the case you're willing to put your time and effort into such a feature (which would be much appreciated), we'd like to then also be able to make our users profit from it. That's why I've opened #726 to get to know how users can upgrade to the most recent version of siunitx without having to rethink their entire LaTeX setup. |
@Splines Please open a separate issue - including supporting links/PDFs/whatever that show that this approach is used by professionally-typeset material (that's my usual requirement for feature requests). |
Presumptions
I use the following sisetup:
\sisetup{ locale=US, group-separator={,}, group-digits=integer, per-mode=symbol, separate-uncertainty=true }
Description of problem
I'm wondering why this input:
$$\qty[minimum-decimal-digits=6]{5.407 \pm 0.04}{\m}$$
is printed as

(5.407000 \pm 0.004000) m
in the LaTeX document. Note that siunitx altered the uncertainty from0.04
to0.004
.The root cause for this is probably the same for the following confusing output:
will result in:
note that the
0
is printed after the\text{stat}
. Is there a way to get rid of this trailing0
altogether?Efforts taken
round-mode
as well asround-pad
, but these settings didn't help. Also found out aboutminimum-decimal-digits
.round-pad
in versionv3.0.0
. Searched for "minimum" and found that Handling of "minimum-decimal-digits" is wrong with some uncertainties #601 is fixed inv3.0.50
. As I'm using3.1.11
, I should have this fix available.Additional context
If you're wondering why we need this
\NewDocumentCommand
stuff. A friend of mine and me currently build a Python library calledResultWizard
as an interface between Python code and the siunitx LaTeX package. We're in the second alpha version right now and stumbled upon the described issue here.System Information
I'm using TeX Live in WSL (Ubuntu 22.04 jammy). siunitx version:
3.1.11 (2022-12-05)
.The text was updated successfully, but these errors were encountered: