Skip to content

Commit

Permalink
Correct formatting of \pm in tables with sep. uncert. (fixes #665)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jun 12, 2023
1 parent f4b4d0b commit 53cb8b6
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 154 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
- Printing of magnitudes for polar values when not parsing numbers
(see issue
[\#658](https://github.com/josephwright/siunitx/issues/658))
- Alignment of separated uncertainties in tables
(see issue
[\#665](https://github.com/josephwright/siunitx/issues/665))

## [v3.2.5] - 2023-04-13

Expand Down
2 changes: 1 addition & 1 deletion siunitx-table.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@
+ \box_wd:N \l_@@_tmp_box
}
{
\box_use:N \l_@@_uncert_box
\hbox_unpack:N \l_@@_uncert_box
\tl_if_blank:nF {#2#5}
{ \siunitx_print_number:n {#4#5} }
\@@_fil:
Expand Down
97 changes: 46 additions & 51 deletions testfiles/siunitx-table.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -726,22 +726,21 @@ TEST 7: Option setting "table-align-uncertainty"
..\OT1/cmr/m/n/10 6
..\OT1/cmr/m/n/10 3
..\mathoff
.\hbox(6.44444+0.83333)x37.77777, direction TLT
.\hbox(6.44444+0.83333)x37.77777, glue set 1.48145fil, direction TLT
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 0
..\mathoff
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x22.22217, glue set 4.44434fil, direction TLT
...\mathon
...\hbox(0.0+0.0)x0.0, direction TLT
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 1
...\OT1/cmr/m/n/10 2
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0, direction TLT
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 1
..\OT1/cmr/m/n/10 2
..\mathoff
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 1
Expand Down Expand Up @@ -769,21 +768,20 @@ l. ... }
..\OT1/cmr/m/n/10 7
..\OT1/cmr/m/n/10 8
..\mathoff
.\hbox(6.44444+0.83333)x37.77777, direction TLT
.\hbox(6.44444+0.83333)x37.77777, glue set 3.14812fil, direction TLT
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 0
..\mathoff
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x22.22217, glue set 9.44435fil, direction TLT
...\mathon
...\hbox(0.0+0.0)x0.0, direction TLT
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 9
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0, direction TLT
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 9
..\mathoff
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 1
Expand Down Expand Up @@ -811,17 +809,16 @@ l. ... }
..\OT1/cmr/m/n/10 7
..\OT1/cmr/m/n/10 8
..\mathoff
.\hbox(6.44444+0.83333)x37.77777, glue set 7.7778fil, direction TLT
.\hbox(6.44444+0.83333)x37.77777, glue set 8.33331fil, direction TLT
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x22.22217, glue set 9.44435fil, direction TLT
...\mathon
...\hbox(0.0+0.0)x0.0, direction TLT
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 8
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0, direction TLT
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 8
..\mathoff
..\glue 0.0 plus 1.0fil
.\hbox(0.0+0.0)x0.0, direction TLT
..\glue 0.0
Expand Down Expand Up @@ -2043,17 +2040,16 @@ l. ... }
..\OT1/cmr/m/n/10 1
..\OT1/cmr/m/n/10 2
..\mathoff
.\hbox(6.44444+0.83333)x42.77779, glue set 12.77782fil, direction TLT
.\hbox(6.44444+0.83333)x42.77779, glue set 9.99998fil, direction TLT
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x17.22215, glue set 4.44434fil, direction TLT
...\mathon
...\hbox(0.0+0.0)x0.0, direction TLT
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 1
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0, direction TLT
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 1
..\mathoff
..\glue 0.0 plus 1.0fil
.\hbox(0.0+0.0)x0.0, direction TLT
..\glue 0.0
Expand All @@ -2076,22 +2072,21 @@ l. ... }
..\OT1/cmr/m/n/10 1
..\OT1/cmr/m/n/10 2
..\mathoff
.\hbox(6.44444+0.83333)x42.77779, direction TLT
.\hbox(6.44444+0.83333)x42.77779, glue set 1.48145fil, direction TLT
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 3
..\OT1/cmr/m/n/10 4
..\mathoff
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x17.22215, glue set 4.44434fil, direction TLT
...\mathon
...\hbox(0.0+0.0)x0.0, direction TLT
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 0
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0, direction TLT
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 0
..\mathoff
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 0
Expand Down
97 changes: 46 additions & 51 deletions testfiles/siunitx-table.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -726,22 +726,21 @@ TEST 7: Option setting "table-align-uncertainty"
..\OT1/cmr/m/n/10 6
..\OT1/cmr/m/n/10 3
..\mathoff
.\hbox(6.44444+0.83333)x37.77777
.\hbox(6.44444+0.83333)x37.77777, glue set 1.48145fil
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 0
..\mathoff
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x22.22217, glue set 4.44434fil
...\mathon
...\hbox(0.0+0.0)x0.0
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 1
...\OT1/cmr/m/n/10 2
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 1
..\OT1/cmr/m/n/10 2
..\mathoff
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 1
Expand Down Expand Up @@ -769,21 +768,20 @@ l. ... }
..\OT1/cmr/m/n/10 7
..\OT1/cmr/m/n/10 8
..\mathoff
.\hbox(6.44444+0.83333)x37.77777
.\hbox(6.44444+0.83333)x37.77777, glue set 3.14812fil
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 0
..\mathoff
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x22.22217, glue set 9.44435fil
...\mathon
...\hbox(0.0+0.0)x0.0
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 9
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 9
..\mathoff
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 1
Expand Down Expand Up @@ -811,17 +809,16 @@ l. ... }
..\OT1/cmr/m/n/10 7
..\OT1/cmr/m/n/10 8
..\mathoff
.\hbox(6.44444+0.83333)x37.77777, glue set 7.7778fil
.\hbox(6.44444+0.83333)x37.77777, glue set 8.33331fil
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x22.22217, glue set 9.44435fil
...\mathon
...\hbox(0.0+0.0)x0.0
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 8
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 8
..\mathoff
..\glue 0.0 plus 1.0fil
.\hbox(0.0+0.0)x0.0
..\glue 0.0
Expand Down Expand Up @@ -2043,17 +2040,16 @@ l. ... }
..\OT1/cmr/m/n/10 1
..\OT1/cmr/m/n/10 2
..\mathoff
.\hbox(6.44444+0.83333)x42.77779, glue set 12.77782fil
.\hbox(6.44444+0.83333)x42.77779, glue set 9.99998fil
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x17.22215, glue set 4.44434fil
...\mathon
...\hbox(0.0+0.0)x0.0
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 1
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 1
..\mathoff
..\glue 0.0 plus 1.0fil
.\hbox(0.0+0.0)x0.0
..\glue 0.0
Expand All @@ -2076,22 +2072,21 @@ l. ... }
..\OT1/cmr/m/n/10 1
..\OT1/cmr/m/n/10 2
..\mathoff
.\hbox(6.44444+0.83333)x42.77779
.\hbox(6.44444+0.83333)x42.77779, glue set 1.48145fil
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 3
..\OT1/cmr/m/n/10 4
..\mathoff
..\glue 0.0 plus 1.0fil
..\hbox(6.44444+0.83333)x17.22215, glue set 4.44434fil
...\mathon
...\hbox(0.0+0.0)x0.0
...\OMS/cmsy/m/n/10 ^^F
...\mathoff
...\glue 0.0 plus 1.0fil
...\mathon
...\OT1/cmr/m/n/10 0
...\mathoff
..\mathon
..\hbox(0.0+0.0)x0.0
..\OMS/cmsy/m/n/10 ^^F
..\mathoff
..\glue 0.0 plus 1.0fil
..\mathon
..\OT1/cmr/m/n/10 0
..\mathoff
..\mathon
..\OML/cmm/m/it/10 :
..\OT1/cmr/m/n/10 0
Expand Down
Loading

0 comments on commit 53cb8b6

Please sign in to comment.