summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/siunitx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-04-02 18:37:06 +0000
committerKarl Berry <karl@freefriends.org>2009-04-02 18:37:06 +0000
commit3cb8f358eccf25ab947870c1308dbe55b2fbac5f (patch)
treeb05535799151c49248fa4e9140d7f7350e6758f9 /Master/texmf-dist/source/latex/siunitx
parent7191a6160acc88c3b026ce95f07b6ae9ac31c76f (diff)
siunitx update (1apr09)
git-svn-id: svn://tug.org/texlive/trunk@12602 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/siunitx')
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx120
1 files changed, 88 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index 38be72a6c9a..f14145e925b 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
@@ -229,7 +229,7 @@ dcolumn, rccol and numprint packages.
%</driver>
% \fi
%
-%\CheckSum{10223}
+%\CheckSum{10244}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -1978,6 +1978,23 @@ dcolumn, rccol and numprint packages.
%\end{LaTeXexample}
% Notice that any space required must be included in the phrase itself,
% and that this may require a second set of braces.
+%
+%\DescribeOption{trapambigrange}
+%\changes{2009/04/01}{v1.2i}{Added \opt{trapambigrange} option}
+%\DescribeOption{openrange}
+%\DescribeOption{closerange}
+% When \opt{repeatunits} is false, the \opt{trapambigrange} option
+% controls whether brackets are added to keep unit--value agreement.
+% As with other options for trapping ambiguous output, the bracket
+% symbols used here are stored as \opt{openrange} and \opt{closerange}.
+%\begin{LaTeXexample}
+% \SIrange{1}{10}{\kg}\\
+% \SIrange[repeatunits=false]{1}{10}{\kg}\\
+% \SIrange[repeatunits=false,trapambigrange=false]
+% {1}{10}{\kg}
+%\end{LaTeXexample}
+% Notice that any space required must be included in the phrase itself,
+% and that this may require a second set of braces.
%
%\subsection{Angle formatting}
%\DescribeOption{padangle}
@@ -2465,6 +2482,7 @@ dcolumn, rccol and numprint packages.
% astroang & Boolean & Astronomy-style angles \\
% closeerr & Literal & Closes potential-ambiguous error \\
% closefrac & Literal & Closes potential-ambiguous fraction \\
+% closerange & Literal & Closes potential-ambiguous range \\
% color & Literal & Colour used for units and values \\
% colour & Literal & Colour used for units and values \\
% colorall & Boolean & Switch for colouring all output \\
@@ -2556,6 +2574,7 @@ dcolumn, rccol and numprint packages.
% obeymode & Boolean & Check local mode (text/maths) \\
% openerr & Literal & Opens potentially-ambiguous error \\
% openfrac & Literal & Opens potentially-ambiguous fraction \\
+% openrange & Literal & Opens potentially-ambiguous range \\
% padangle & List & Add zeros to blank parts of angles \\
% padnumber & List & Add zeros to blank parts of numbers \\
% per & List & Behaviour of \cs{per} \\
@@ -2602,6 +2621,7 @@ dcolumn, rccol and numprint packages.
% tophrase & List or literal & The phrase ``to'' for ranges \\
% trapambigerr & Boolean & Check for ambiguous errors \\
% trapambigfrac & Boolean & Check for ambiguous fractions \\
+% trapambigrange & Boolean & Check for ambiguous ranges \\
% unitcolor & Literal & Switch for colouring units \\
% unitcolour & Literal & Switch for colouring units \\
% unitmathrm & Csname & Roman maths font for units \\
@@ -3431,7 +3451,7 @@ author.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{siunitx}
- [2009/03/23 v1.2g A comprehensive (SI) units package]
+ [2009/04/01 v1.2i A comprehensive (SI) units package]
% \end{macrocode}
% The package requires \eTeX, so the usual test is made.
% \begin{macrocode}
@@ -3990,10 +4010,11 @@ author.
mode=maths,
repeatunits=true,
trapambigerr=true,
- trapambigfrac=true}
+ trapambigfrac=true,
+ trapambigrange=true}
\@for\si@tempa:=obeyall,obeymode,obeyitalic,mode,unitmode,%
valuemode,textmode,obeybold,repeatunits,trapambigerr,%
- trapambigfrac\do{%
+ trapambigfrac,trapambigrange\do{%
\begingroup
\edef\si@tempb{\endgroup
\noexpand\si@opt@disablekey{\si@tempa}
@@ -5156,6 +5177,17 @@ author.
\si@opt@xchoicekey{tophrase}{to,dots,ndash,dash}{to}
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\ifsi@trapambigrange}
+%\begin{macro}{\si@openrange}
+%\begin{macro}{\si@closerange}
+% Trapping awkward ranges.
+% \begin{macrocode}
+\si@opt@boolkey{trapambigrange}
+\si@opt@cmdkeys{openrange,closerange}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
%\begin{macro}{\si@locale}
%\begin{macro}{\si@loctolang}
% Handling typographic conventions needs three keys. \opt{locale} is
@@ -6410,6 +6442,7 @@ author.
\expandafter\si@num@out
\fi
% \end{macrocode}
+%\changes{2009/04/01}{v1.2i}{Minor change for another text mode issue}
% If there is anything inside the ``x-part'', then there is now
% more work to do.
% \begin{macrocode}
@@ -6420,7 +6453,7 @@ author.
\expandafter\si@out@num\expandafter{%
\ensuremath{\si@closeerr}}%
\ifx\@empty\si@num@ambig\@empty\else
- \expandafter\si@out@num\expandafter{\si@num@ambig}%
+ \si@out@num{\si@num@ambig}%
\renewcommand*{\si@num@ambig}{}%
\fi
\fi
@@ -7658,13 +7691,20 @@ author.
% \end{macrocode}
%\end{macro}
%\begin{macro}{\si@num@addunit}
+%\changes{v1.2h}{2008/03/26}{Minor bug fix for repeated units and text
+% mode values}
% A short macro to add units if needed.
% \begin{macrocode}
\newcommand*{\si@num@addunit}{%
\si@unt@numtrue
\ifx\@empty\si@unt@unitarg\@empty\else
\ifsi@repeatunits
- \si@unt@printunit{\si@unt@unitarg}%
+ \begingroup
+ \si@out@numfalse
+ \si@fam@setfalse
+ \si@fam@set
+ \si@unt@printunit{\si@unt@unitarg}%
+ \endgroup
\fi
\fi}
% \end{macrocode}
@@ -10366,10 +10406,23 @@ author.
\ifsi@repeatunits
\SI{#2}{#4}%
\else
+ \ifsi@trapambigrange
+ \ensuremath{\si@openrange}%
+ \fi
\num{#2}%
\fi
\text{\si@tophrase}%
- \SI{#3}{#4}%
+ \ifsi@repeatunits
+ \SI{#3}{#4}%
+ \else
+ \ifsi@trapambigrange
+ \num{#3}%
+ \ensuremath{\si@closerange\si@valuesep}%
+ \si{#4}%
+ \else
+ \SI{#3}{#4}%
+ \fi
+ \fi
\endgroup
}
% \end{macrocode}
@@ -10737,7 +10790,8 @@ author.
angformat=unchanged,
astroang=false,%(
closeerr=),%(
- closefrac=),
+ closefrac=),%(
+ closerange=),
colour=black,
colourall=false,
colourneg=false,
@@ -10772,6 +10826,7 @@ author.
obeymode=false,
openerr=(,%)
openfrac=(,%)
+ openrange=(,%
padangle=small,
padnumber=lead,
per=reciprocal,
@@ -10802,6 +10857,7 @@ author.
tophrase=to,
trapambigerr=true,
trapambigfrac=true,
+ trapambigrange=true,
unitsep=thin,
valuesep=thin,
xspace=false}
@@ -10896,7 +10952,7 @@ author.
% powers.
% \begin{macrocode}
\ProvidesFile{si-prefix.cfg}
- [2009/03/23 v1.2g siunitx: SI Multiple prefixes]
+ [2009/04/01 v1.2i siunitx: SI Multiple prefixes]
\newprefix{\yocto}{-24}{y}
\newprefix{\zepto}{-21}{z}
\newprefix{\atto}{-18}{a}
@@ -11000,7 +11056,7 @@ author.
% is an awkward one, but here the UK standard is used.
% \begin{macrocode}
\ProvidesFile{si-named.cfg}
- [2009/03/23 v1.2g siunitx: SI Named units]
+ [2009/04/01 v1.2i siunitx: SI Named units]
\newunit{\becquerel}{Bq}
\newunit{\coulomb}{C}
\newunit{\farad}{F}
@@ -11096,7 +11152,7 @@ author.
% This requires \file{si-prefix.cfg} and \file{si-named.cfg}.
% \begin{macrocode}
\ProvidesFile{si-prefixed.cfg}
- [2009/03/23 v1.2g siunitx: SI Prefixed units]
+ [2009/04/01 v1.2i siunitx: SI Prefixed units]
\requiresiconfigs{prefix,named,accepted,physical}
% \end{macrocode}
%\begin{macro}{\picometre}
@@ -11394,7 +11450,7 @@ author.
% block for the appropriate option. First currents.
% \begin{macrocode}
\ProvidesFile{si-abbr.cfg}
- [2009/03/23 v1.2g siunitx: Abbreviated units]
+ [2009/04/01 v1.2i siunitx: Abbreviated units]
\requiresiconfigs{prefix,named,accepted,physical}
\newunit{\pA}{\pico\ampere}
\newunit{\nA}{\nano\ampere}
@@ -11617,7 +11673,7 @@ author.
% These are defined here, although some are in very general use.
% \begin{macrocode}
\ProvidesFile{si-addn.cfg}
- [2009/03/23 v1.2g siunitx: SI Additional units]
+ [2009/04/01 v1.2i siunitx: SI Additional units]
\newunit{\angstrom}{\si@sym@ringA}
\newunit{\are}{a}
\newunit{\hectare}{\hecto\are}
@@ -11666,7 +11722,7 @@ author.
%\begin{macro}{\bel}
% \begin{macrocode}
\ProvidesFile{si-accepted.cfg}
- [2009/03/23 v1.2g siunitx: SI Accepted units]
+ [2009/04/01 v1.2i siunitx: SI Accepted units]
\newunit{\minute}{min}
\newunit{\hour}{h}
\newunit{\Day}{d}
@@ -11724,7 +11780,7 @@ author.
% for a negative kern does make things a bit complicated.
% \begin{macrocode}
\ProvidesFile{si-physical.cfg}
- [2009/03/23 v1.2g siunitx: SI Physically-measured units]
+ [2009/04/01 v1.2i siunitx: SI Physically-measured units]
\newcommand*{\si@eVspacea}{\text{\kern-\si@eVcorra}}%
\newcommand*{\si@eVspaceb}{\text{\kern-\si@eVcorrb}}%
\newunit{\electronvolt}{e\protect\si@eVspacea V\protect%
@@ -11760,7 +11816,7 @@ author.
% own definitions.
% \begin{macrocode}
\ProvidesFile{si-synchem.cfg}
- [2009/03/23 v1.2g siunitx: Units for synthetic chemists]
+ [2009/04/01 v1.2i siunitx: Units for synthetic chemists]
\requiresiconfigs{prefix}
\newunit{\mmHg}{mmHg}
\newunit{\molar}{\mole\per\cubic\deci\metre}
@@ -11781,7 +11837,7 @@ author.
% Some units inspired by \pkg{hepunits}.
% \begin{macrocode}
\ProvidesFile{si-hep.cfg}
- [2009/03/23 v1.2g siunitx: Units for high-energy physics]
+ [2009/04/01 v1.2i siunitx: Units for high-energy physics]
\requiresiconfigs{prefix,named}
% \end{macrocode}
%\begin{macro}{\micron}
@@ -11863,7 +11919,7 @@ author.
% For astronomy, the \cs{parsec} unit is needed.
% \begin{macrocode}
\ProvidesFile{si-astro.cfg}
- [2009/03/23 v1.2g siunitx: Units for astronomy]
+ [2009/04/01 v1.2i siunitx: Units for astronomy]
\newunit{\parsec}{pc}
\newunit{\lightyear}{ly}
% \end{macrocode}
@@ -11878,7 +11934,7 @@ author.
% The unit \cs{gon} is useful here.
% \begin{macrocode}
\ProvidesFile{si-geophys.cfg}
- [2009/03/23 v1.2g siunitx: Units for astronomy]
+ [2009/04/01 v1.2i siunitx: Units for astronomy]
\newunit{\gon}{gon}
% \end{macrocode}
%\end{macro}
@@ -11893,7 +11949,7 @@ author.
% For astronomy, the \cs{parsec} unit is needed.
% \begin{macrocode}
\ProvidesFile{si-chemeng.cfg}
- [2009/03/23 v1.2g siunitx: Units for chemical engineering]
+ [2009/04/01 v1.2i siunitx: Units for chemical engineering]
\newunit{\gmol}{g\text{-}mol}
\newunit{\kgmol}{kg\text{-}mol}
\newunit{\lbmol}{lb\text{-}mol}
@@ -11918,7 +11974,7 @@ author.
% \SIunits. First, the binary prefixes.
% \begin{macrocode}
\ProvidesFile{si-binary.cfg}
- [2009/03/23 v1.2g siunitx: Binary units]
+ [2009/04/01 v1.2i siunitx: Binary units]
\newprefix[binary]{\kibi}{10}{Ki}
\newprefix[binary]{\mebi}{20}{Mi}
\newprefix[binary]{\gibi}{30}{Gi}
@@ -11961,7 +12017,7 @@ author.
% default values.\footnote{The package author is in the UK.}
% \begin{macrocode}
\ProvidesFile{si-UK.cfg}
- [2009/03/23 v1.2g siunitx: UK locale]
+ [2009/04/01 v1.2i siunitx: UK locale]
\sisetup{
unitsep=thin,
expproduct=times,
@@ -11978,7 +12034,7 @@ author.
% The same as for the UK.
% \begin{macrocode}
\ProvidesFile{si-USA.cfg}
- [2009/03/23 v1.2g siunitx: USA locale]
+ [2009/04/01 v1.2i siunitx: USA locale]
\sisetup{
unitsep=thin,
expproduct=times,
@@ -11995,7 +12051,7 @@ author.
% Germany, hopefully.
% \begin{macrocode}
\ProvidesFile{si-DE.cfg}
- [2009/03/23 v1.2g siunitx: Germany locale]
+ [2009/04/01 v1.2i siunitx: Germany locale]
\sisetup{
unitsep=cdot,
valuesep=thin,
@@ -12013,7 +12069,7 @@ author.
% Design decisions taken from the same section of \SIstyle.
% \begin{macrocode}
\ProvidesFile{si-ZA.cfg}
- [2009/03/23 v1.2g siunitx: South Africa locale]
+ [2009/04/01 v1.2i siunitx: South Africa locale]
\sisetup{
unitsep=cdot,
valuesep=thin,
@@ -12045,7 +12101,7 @@ author.
% \units for conflicting options, so users probably expect none.
% \begin{macrocode}
\ProvidesFile{si-units.cfg}
- [2009/03/23 v1.2g siunitx: Emulation of units]
+ [2009/04/01 v1.2i siunitx: Emulation of units]
\si@emulating{units}{1998/08/04 v0.9b}
\si@ifloaded{SIunits}
{\si@emclash{units}{SIunits}\endinput}{}
@@ -12115,7 +12171,7 @@ author.
% clash.
% \begin{macrocode}
\ProvidesFile{si-unitsdef.cfg}
- [2009/03/23 v1.2g siunitx:
+ [2009/04/01 v1.2i siunitx:
Emulation of unitsdef]
\si@emulating{unitsdef}{2005/01/04 v0.2}
\si@ifloaded{SIunits}
@@ -12564,7 +12620,7 @@ author.
% the macros in \SIstyle as given in the manual for that package.
% \begin{macrocode}
\ProvidesFile{si-sistyle.cfg}
- [2009/03/23 v1.2g siunitx: Emulation of
+ [2009/04/01 v1.2i siunitx: Emulation of
SIstyle]
\si@emulating{sistyle}{2006/12/20 v2.3}
\sisetup{%
@@ -12748,7 +12804,7 @@ author.
% \SIunits emulation starts in much the same way.
% \begin{macrocode}
\ProvidesFile{si-SIunits.cfg}
- [2009/03/23 v1.2g siunitx: Emulation of
+ [2009/04/01 v1.2i siunitx: Emulation of
SIunits]
\si@emulating{SIunits}{2007/12/02 v1.36}
\sisetup{
@@ -13311,7 +13367,7 @@ author.
% which are not really to be encouraged.
% \begin{macrocode}
\ProvidesFile{si-hepunits.cfg}
- [2009/03/23 v1.2g siunitx: Emulation of
+ [2009/04/01 v1.2i siunitx: Emulation of
hepunits]
\si@emulating{hepunits}{2007/09/27}
\requiresiconfigs{SIunits,accepted,prefix,hep}
@@ -13466,7 +13522,7 @@ author.
% a little emulation and a few macros needed.
% \begin{macrocode}
\ProvidesFile{si-fancynum.cfg}
- [2009/03/23 v1.2g siunitx: Emulation of
+ [2009/04/01 v1.2i siunitx: Emulation of
fancynum]
\si@emulating{fancynum}{2000/08/08 0.92}
\sisetup{decimalsymbol=cdot,digitsep=comma}
@@ -13528,7 +13584,7 @@ author.
% test is needed.
% \begin{macrocode}
\ProvidesFile{si-fancyunits.cfg}
- [2009/03/23 v1.2g siunitx: Emulation of
+ [2009/04/01 v1.2i siunitx: Emulation of
fancyunits]
\si@emulating{fancyunits}{2007/02/01 v1.0.1}
\si@ifloaded{SIunits}