Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support asymmetry uncertainties/tolerances #675

Closed
josephwright opened this issue Jul 23, 2023 · 14 comments
Closed

Support asymmetry uncertainties/tolerances #675

josephwright opened this issue Jul 23, 2023 · 14 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@josephwright
Copy link
Owner

Spun out from #24 as the core multipart idea is now stable and it is only the asymmetrical aspect that needs addressing.

@josephwright josephwright self-assigned this Jul 23, 2023
@josephwright josephwright added the enhancement New feature or request label Jul 23, 2023
@josephwright josephwright added this to the v3.3 milestone Jul 23, 2023
@josephwright
Copy link
Owner Author

Current thinking on the interface is 123.4(+5:-6), but there is an open question as to whether one can 'read in' the signs, e.g. 123.4(5:6)?

@maxfl
Copy link

maxfl commented Jul 25, 2023

Usually I prefer things to be set explicitly, yet, in this particular case I've used to read/say the number in order (+, then -) and I guess this should be ok for most of the people. So the signs may be omitted.

josephwright added a commit that referenced this issue Jul 26, 2023
Replacement is "input-symmetrical-uncertainty-signs". This will be needed to address #675.
@josephwright
Copy link
Owner Author

OK, current thinking is

  • New option input-asymmetrical-uncertainty-signs taking two brace groups, one positive, one negative; most likely users will stick with a default nput-asymmetrical-uncertainty-signs = {+}{-}
  • New option input-uncertainty-divider which will be the suggested : as standard

These two will let me cover the 'compact' input form, but I am still wondering about the 'long' form: I am wondering whether to go with just 'compact' for v3.3 and see what extensions make sense for v3.4: thoughts?

@maxfl
Copy link

maxfl commented Jul 26, 2023

I think that having the short form will be amazing by itself and propose not to wait for the long form.

As for the long form, I do not know what it actually means. In case it means multiple groups of asymmetric uncertainties, the thing is used much more rare, at least in my field. Thus, again, I do not think you need to wait to provide both the features in the same version.

@josephwright
Copy link
Owner Author

@maxfl The 'long' form here would be 1.23 + 0.04 - 0.06 or similar, comparable to 1.23 \pm 0.4

@josephwright
Copy link
Owner Author

OK, I have basic support checked in: at the moment, only one input and one output format. I have a feeling this will need some refinement, but I will look at other issues and hope I get some feedback here!

@josephwright
Copy link
Owner Author

Given this is an area I'm less confident about, I'm going to go with what I have now for v3.3 and push any refinements to v3,4.

@josephwright josephwright modified the milestones: v3.3, v3.4 Jul 27, 2023
@maxfl
Copy link

maxfl commented Jul 27, 2023

OK, I have basic support checked in: at the moment, only one input and one output format. I have a feeling this will need some refinement, but I will look at other issues and hope I get some feedback here!

thank you a lot! I will check.

josephwright added a commit that referenced this issue Jul 31, 2023
Replacement is "input-symmetrical-uncertainty-signs". This will be needed to address #675.
@maxfl
Copy link

maxfl commented Aug 14, 2023

I've checked the new features and they are amazing. Thanks a lot! Having a long format (+x-y) would be nice, but the current one seem to fulfill all the needs.

The only issue I've found is that using uncertainty descriptors in a subscript mode together with multipart uncertainties produces the $x_1_2$-like code and issues an error due to the double subscript. Perhaps, the protection should be added.

@maxfl
Copy link

maxfl commented Aug 14, 2023

as a side note, it took me a while to figure out how to compile the code and produce the sty file. Maybe a few lines may be added to the README.md on this. I've also noticed the build.lua file, but have no idea on whether it may help compiling the package and which particular application could do it.

@josephwright
Copy link
Owner Author

josephwright commented Aug 14, 2023

as a side note, it took me a while to figure out how to compile the code and produce the sty file. Maybe a few lines may be added to the README.md on this. I've also noticed the build.lua file, but have no idea on whether it may help compiling the package and which particular application could do it.

Very few users install themselves: almost everyone gets the package from their TeX system. For those that don't, there's a TDS-style zip on CTAN. And for those who want to extract, the classical instructions for DocStrip ('run tex siunitx.ins) work. I tend to assume the latter group know what they are doing :)

@kh296
Copy link

kh296 commented Aug 22, 2023

Thanks for adding this really nice new feature! Asymmetric uncertainties are formatted perfectly using the compact input form with ansiunitx macro, but it doesn't seem to be possible to use this form without a macro in the S column of a table. As a minimal example, the following:

\documentclass[a4paper]{article}
\usepackage[separate-uncertainty]{siunitx}
\begin{document}
\begin{table}
\begin{tabular}{S[table-format=2.2(1)]}
\num{20.01(2:3)} \\ % Asymmetric uncertainties with macro okay.
20.01(2) \\ % Symmetric uncertainties without macro okay.
30.01(2:3) \\ % This line gives an error.
\end{tabular}
\end{table}
\end{document}

generates the error message:

! Package siunitx Error: Invalid number '30.01(2'

Do I have something wrong in the syntax, or is parsing of the compact form for asymmetric uncertainties not yet enabled?

Thanks!

@josephwright
Copy link
Owner Author

@kh296 Please log a separate issue

@josephwright
Copy link
Owner Author

OK, I'm going to close here as done - if there are more specific issues or requirements, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants