Skip to content

Commit

Permalink
Suppress prefix conversion for angle units and percent (fixes #771)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jan 17, 2025
1 parent 8c6b62b commit 64a58ce
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 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]

### Changed
- Suppress prefix conversion for angle units and `\percent` (see issue
[\#771](https://github.com/josephwright/siunitx/issues/771))

### Fixed
- Printing of exponent part in `\ang` (see issue
[\#769](https://github.com/josephwright/siunitx/issues/769))
Expand Down
10 changes: 6 additions & 4 deletions siunitx-quantity.dtx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
% File: siunitx-quantity.dtx Copyright (C) 2018-2024 Joseph Wright
% File: siunitx-quantity.dtx Copyright (C) 2018-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 @@ -434,11 +434,13 @@
% \pkg{siunitx-unit} on options it does not contain.
% \begin{macrocode}
\siunitx_unit_options_declare:Nn \arcminute
{ quantity-product = { } }
{ prefix-mode = input , quantity-product = { } }
\siunitx_unit_options_declare:Nn \arcsecond
{ quantity-product = { } }
{ prefix-mode = input , quantity-product = { } }
\siunitx_unit_options_declare:Nn \degree
{ quantity-product = { } }
{ prefix-mode = input , quantity-product = { } }
\siunitx_unit_options_declare:Nn \percent
{ prefix-mode = input }
% \end{macrocode}
% \end{macro}
%
Expand Down
8 changes: 4 additions & 4 deletions siunitx-symbol.dtx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
% File: siunitx-symbol.dtx Copyright (C) 2018-2024 Joseph Wright
% File: siunitx-symbol.dtx Copyright (C) 2018-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 @@ -144,13 +144,13 @@
{
\siunitx_declare_unit:Nnn \arcminute
{ \ensuremath { { } ' } }
{ quantity-product = { } }
{ prefix-mode = input , quantity-product = { } }
}
\@@_if_replace:NnT \arcsecond { "02BA }
{
\siunitx_declare_unit:Nnn \arcsecond
{ \ensuremath { { } '' } }
{ quantity-product = { } }
{ prefix-mode = input , quantity-product = { } }
}
% \end{macrocode}
% For |\degree|, direct input works in text mode so there is only a need to
Expand All @@ -172,7 +172,7 @@
{ { } ^ { \exp_not:N \circ } }
}
}
{ quantity-product = { } }
{ prefix-mode = input , quantity-product = { } }
}
% \end{macrocode}
% For |\degreeCelsius|, much the same to think about but the comparison
Expand Down
2 changes: 2 additions & 0 deletions siunitx.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,8 @@ \subsection{Quantities}
\qty[prefix-mode = extract-exponent]{10}{\kilo\gram\squared\deci\second} \\
\qty[prefix-mode = extract-exponent]{7.5}{\gram} \\
\end{LaTeXdemo}
This option does not apply to units \cs{degree}, \cs{arcminute}, \cs{arcsecond}
and \cs{percent}.

\DescribeOption{separate-uncertainty-units}
When a number has multiple parts (such as a separate uncertainty) then the unit
Expand Down

0 comments on commit 64a58ce

Please sign in to comment.