Skip to content

Commit

Permalink
Correct parsing of exponent part in \ang
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jan 17, 2025
1 parent dbd3a76 commit 907e1ba
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to

## [Unreleased]

### Fixed
- Parsing of exponent part in `\ang` (see issue
[\#770](/~https://github.com/josephwright/siunitx/issues/770))

## [v3.4.1] - 2025-01-14

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions siunitx-angle.dtx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
% File: siunitx-angle.dtx Copyright (C) 2016-2019,2021-2024 Joseph Wright
% File: siunitx-angle.dtx Copyright (C) 2016-2019,2021-2025 Joseph Wright
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
Expand Down Expand Up @@ -408,10 +408,10 @@
\cs_new_protected:Npn \@@_arc_sign:nnn #1#2#3
{
\group_begin:
\@@_suppress_exp:
\tl_clear:N \l_@@_sign_tl
\bool_set_false:N \l_@@_signed_bool
\group_begin:
\@@_suppress_exp:
\@@_suppress_uncert:
\str_if_eq:nnTF {#1} { -0 }
{
Expand Down
35 changes: 35 additions & 0 deletions testfiles/siunitx-angle.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(6.88586+0.0)x9.59724, direction TLT
.\mathon
.\OT1/cmr/m/n/10 1
.\mathoff
.\penalty 10000
.\mathon
.\hbox(6.88586+0.0)x4.59723, direction TLT
..\hbox(0.0+0.0)x0.0, direction TLT
..\hbox(3.25694+0.0)x4.59723, shifted -3.62892, direction TLT
...\OMS/cmsy/m/n/7 ^^N
.\mathoff
! OK.
<argument> \l_tmpa_box
l. ... }
============================================================
============================================================
TEST 2: Basic formatting: arcs
Expand Down Expand Up @@ -275,6 +290,26 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(7.51782+0.0)x27.88896, direction TLT
.\mathon
.\OT1/cmr/m/n/10 0
.\OML/cmm/m/it/10 :
.\OT1/cmr/m/n/10 2
.\OT1/cmr/m/n/10 3
.\OT1/cmr/m/n/10 4
.\mathoff
.\penalty 10000
.\mathon
.\hbox(7.51782+0.0)x5.11111, direction TLT
..\hbox(0.0+0.0)x0.0, direction TLT
..\hbox(3.8889+0.0)x5.11111, shifted -3.62892, direction TLT
...\OMS/cmsy/m/n/7 0
...\OMS/cmsy/m/n/7 0
.\mathoff
! OK.
<argument> \l_tmpa_box
l. ... }
============================================================
============================================================
TEST 3: Option setting "angle-mode"
Expand Down
2 changes: 2 additions & 0 deletions testfiles/siunitx-angle.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
\test:n { 1.23 }
\test:n { 1 }
\test:n { .2 }
\test:n { 1e-2 }
}

\TEST { Basic~formatting:~arcs }
Expand All @@ -54,6 +55,7 @@
\test:nnn { } { 2 } { 3 }
\test:nnn { } { } { 3 }
\test:nnn { } { } { 0.234 }
\test:nnn { } { } { 0.234e-5 }
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
35 changes: 35 additions & 0 deletions testfiles/siunitx-angle.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(6.88586+0.0)x9.59724
.\mathon
.\OT1/cmr/m/n/10 1
.\mathoff
.\penalty 10000
.\mathon
.\hbox(6.88586+0.0)x4.59723
..\hbox(0.0+0.0)x0.0
..\hbox(3.25694+0.0)x4.59723, shifted -3.62892
...\OMS/cmsy/m/n/7 ^^N
.\mathoff
! OK.
<argument> \l_tmpa_box
l. ... }
============================================================
============================================================
TEST 2: Basic formatting: arcs
Expand Down Expand Up @@ -275,6 +290,26 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(7.51782+0.0)x27.88896
.\mathon
.\OT1/cmr/m/n/10 0
.\OML/cmm/m/it/10 :
.\OT1/cmr/m/n/10 2
.\OT1/cmr/m/n/10 3
.\OT1/cmr/m/n/10 4
.\mathoff
.\penalty 10000
.\mathon
.\hbox(7.51782+0.0)x5.11111
..\hbox(0.0+0.0)x0.0
..\hbox(3.8889+0.0)x5.11111, shifted -3.62892
...\OMS/cmsy/m/n/7 0
...\OMS/cmsy/m/n/7 0
.\mathoff
! OK.
<argument> \l_tmpa_box
l. ... }
============================================================
============================================================
TEST 3: Option setting "angle-mode"
Expand Down
35 changes: 35 additions & 0 deletions testfiles/siunitx-angle.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(6.88586+0.0)x9.59724
.\mathon
.\OT1/cmr/m/n/10 1
.\mathoff
.\penalty 10000
.\mathon
.\hbox(6.88586+0.0)x4.59723
..\hbox(0.0+0.0)x0.0
..\hbox(3.25694+0.0)x4.59723, shifted -3.62892
...\OMS/cmsy/m/n/7 ^^N
.\mathoff
! OK.
<argument> \l_tmpa_box
l. ... }
============================================================
============================================================
TEST 2: Basic formatting: arcs
Expand Down Expand Up @@ -275,6 +290,26 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(7.51782+0.0)x27.88896
.\mathon
.\OT1/cmr/m/n/10 0
.\OML/cmm/m/it/10 :
.\OT1/cmr/m/n/10 2
.\OT1/cmr/m/n/10 3
.\OT1/cmr/m/n/10 4
.\mathoff
.\penalty 10000
.\mathon
.\hbox(7.51782+0.0)x5.11111
..\hbox(0.0+0.0)x0.0
..\hbox(3.8889+0.0)x5.11111, shifted -3.62892
...\OMS/cmsy/m/n/7 0
...\OMS/cmsy/m/n/7 0
.\mathoff
! OK.
<argument> \l_tmpa_box
l. ... }
============================================================
============================================================
TEST 3: Option setting "angle-mode"
Expand Down

0 comments on commit 907e1ba

Please sign in to comment.