Skip to content

Commit

Permalink
Add hint "prefixangle" (closes #772)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jan 17, 2025
1 parent 9a5adee commit 8c6b62b
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions siunitx.tex
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
% The next line is needed so that \GetFileInfo will be able to pick up
% version data (quite apart from making the demos work).
\usepackage{siunitx}
% So we can have 'sensible' demos for \arcsecond
\DeclareSIUnit\arcsecond{as}
\DeclareSIUnit[quantity-product = {}]\stdarcsecond{\ensuremath {{}''}}
\sisetup{angle-symbol-second = \stdarcsecond}
\DeclareSIUnit\noop{\relax} % For printing prefixes
\DeclareSIPower\quartic\tothefourth{4} % For demos
\DeclareSIUnit\KWH{kWh}
Expand Down Expand Up @@ -625,7 +629,7 @@ \subsection{The unit macros}
& \cs{liter} & \unit{\liter} \\
\DescribeUnit[minute (plane angle)]{arcminute} \\
\DescribeUnit[minute (time)]{minute} \\
\DescribeUnit[second (plane angle)]{arcsecond} \\
second (plane angle) & \cs{arcsecond} & \unit{\stdarcsecond} \\
\DescribeUnit{neper} \\
\DescribeUnit{tonne} \\
\bottomrule
Expand Down Expand Up @@ -2407,7 +2411,7 @@ \subsection{Angles}
using \opt{angle-symbol-degree}, \opt{angle-symbol-minute} and
\opt{angle-symbol-second}. This is most likely to be used when the definition
of the unit macros is altered, for example to set \cs{arcsecond} as
\texttt{as}.
\texttt{as} (see also Section~\ref{sec:hint:prefixangle}).
\begin{LaTeXdemo}
\ang{6;7;6.5} \\
\sisetup{
Expand Down Expand Up @@ -3916,6 +3920,21 @@ \subsection{Special considerations for the \cs{kWh} unit%
\unit[sticky-per]{\candela\per\kWh}
\end{LaTeXdemo}

\subsection{Prefixes and small angles%
\label{sec:hint:prefixangle}}

Typically, prefixes are not applied to the standard symbols for angles: as
such, the \cs{ang} command is not subject to the \opt{prefix-mode} option. In
some areas, very small angles are given in arcseconds using the symbol
\unit{as}. To apply prefixes in this case, use the \cs{qty} command rather than
\cs{ang}.
\begin{LaTeXdemo}
% In the preamble
% \DeclareSIUnit\arcsecond{as}
\qty{1e-3}{\arcsecond} \\
\qty[prefix-mode = combine-exponent]{1e-3}{\arcsecond}
\end{LaTeXdemo}

\subsection{Creating a column with numbers and units%
\label{sec:hint:mixed}}

Expand Down

0 comments on commit 8c6b62b

Please sign in to comment.