summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-01-23 01:49:41 +0000
committerKarl Berry <karl@freefriends.org>2009-01-23 01:49:41 +0000
commit393794d0d467bdfef27fc2c9c20a22e3a124d0ab (patch)
tree31b736d67d1475e5751566eb3e0cb26a462c5a61 /Master/texmf-dist/source
parent6c09c35e81bf5ad24370d76d16eb074c75bbe71d (diff)
siunitx 1.2 (22jan09)
git-svn-id: svn://tug.org/texlive/trunk@11948 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx151
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.ins1
2 files changed, 122 insertions, 30 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index 209a4a4091c..7e33617bd1c 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
@@ -1,6 +1,9 @@
% \iffalse meta-comment
+%
+% !TEX encoding = ISO-8859-1
+% !TEX program = pdflatex
%
-% Copyright (C) 2008 by
+% Copyright (C) 2008-09 by
% Joseph Wright <joseph.wright@morningstar2.co.uk>
%
% This work may be distributed and/or modified under the
@@ -224,7 +227,7 @@ dcolumn, rccol and numprint packages.
%</driver>
% \fi
%
-%\CheckSum{10177}
+%\CheckSum{10209}
%
% \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
@@ -307,7 +310,7 @@ dcolumn, rccol and numprint packages.
% eVperc,addplot,color,milli,cm,Hz,kg,DeclareRobustCommand,
% pascal,dalton,addtolocale,DTLnewdb,DTLnewrow,DTLnewdbentry,
% DTLforeach,DTLiffirstrow,DTLmul,newqualifier,hour,renewunit,
-% degree}}
+% degree,numrange,SIrange}}
%
%\title{\currpkg\ --- A comprehensive (SI) units package^^A
% \thanks{This file describes version \fileversion, last revised
@@ -1374,6 +1377,26 @@ dcolumn, rccol and numprint packages.
% \si{\kg\polymer\per\mole\catalyst\per\hour}
%\end{LaTeXexample}
%
+%\section{Ranges of numbers}
+%
+%\changes{v1.2}{2009/01/22}{Added \cs{numrange} and \cs{SIrange} for
+% handling ranges}
+%\DescribeMacro{\numrange}
+%\DescribeMacro{\SIrange}
+% To aid the input of ranges of numbers, the macros \cs{numrange} and
+% \cs{SIrange} are available. These both take an optional settings
+% argument, then two numbers. The \cs{SIrange} macro then needs a
+% unit. Depending on package settings, the phrase for the range and
+% the repetition of units can be altered.
+%\begin{LaTeXexample}
+% \numrange{1}{10}\\
+% \numrange[tophrase=dash]{0.4}{0.6}\\
+% \SIrange{1.0}{1.4}{\metre}\\
+% \SIrange[tophrase=dots]{12}{15}{\pascal}\\
+% \SIrange[repeatunits=false]
+% {44}{45}{\kilo\gram}\\
+%\end{LaTeXexample}
+%
%\section{Specialist units}
% In some subject area, there are units which are in common use even
% though they are outside of the SI system. Unlike the units
@@ -1807,7 +1830,8 @@ dcolumn, rccol and numprint packages.
% units.\footnote{This is a very simply option: do not expect it to
% work with anything except areas and volumes.} Notice that when
% applied to errors, \opt{repeatunits} takes priority over
-% \opt{trapambigerr}.
+% \opt{trapambigerr}.\footnote{\opt{repeatunits} also applies to the
+% range macro \cs{SIrange}.}
%\begin{LaTeXexample}
% \num{1 x 2 x 3}\\
% \SI{4 x 5 x 6}{\metre}\\
@@ -1916,6 +1940,20 @@ dcolumn, rccol and numprint packages.
% \num{773322}
%\end{LaTeXexample}
%
+%%\DescribeOption{tophrase}
+% When using the range macros \cs{numrange} and \cs{SIrange}, the phrase
+% used for ``to'' is set using the option \opt{tophrase}. This can take
+% three pre-defined choices \defaultopt{to}, \opt{dots} and \opt{dash},
+% or arbitrary input in text mode.
+%\begin{LaTeXexample}
+% \numrange{1}{10}\\
+% \numrange[tophrase=dots]{1}{10}\\
+% \numrange[tophrase=dash]{1}{10}\\
+% \numrange[tophrase={{ bis }}]{1}{10}\\
+%\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}
%\DescribeOption{strictarc}
@@ -2500,8 +2538,8 @@ dcolumn, rccol and numprint packages.
% prefixsymbolic & Boolean & Behaviour of unit prefixes\\
% prespace & Boolean & Add space before units \\
% redefsymbols & Boolean & Use better symbols if available \\
-% repeatunits & List & Repeat units with separated errors \\
-% & & and products \\
+% repeatunits & List & Repeat units with separated errors, \\
+% & & products and in ranges \\
% retainplus & Boolean & Retain explicit plus sign\\
% seperr & Boolean & Separate number and error \\
% sepfour & Boolean & Separate four-digit numbers \\
@@ -2534,6 +2572,7 @@ dcolumn, rccol and numprint packages.
% textsf & Csname & Sans serif text font \\
% texttt & Csname & Fixed-width text font \\
% tightpm & Boolean & Reduce space around $\pm$ \\
+% tophrase & List or literal & The phrase ``to'' for ranges \\
% trapambigerr & Boolean & Check for ambiguous errors \\
% trapambigfrac & Boolean & Check for ambiguous fractions \\
% unitcolor & Literal & Switch for colouring units \\
@@ -3365,7 +3404,7 @@ author.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{siunitx}
- [2008/12/22 v1.1j A comprehensive (SI) units package]
+ [2008/01/22 v1.2 A comprehensive (SI) units package]
% \end{macrocode}
% The package requires \eTeX, so the usual test is made.
% \begin{macrocode}
@@ -5076,6 +5115,12 @@ author.
% \end{macrocode}
%\end{macro}
%\end{macro}
+%\begin{macro}{\si@tophrase}
+% The phrase for ``to'' in a range.
+% \begin{macrocode}
+\si@opt@xchoicekey{tophrase}{to,dots,ndash,dash}{to}
+% \end{macrocode}
+%\end{macro}
%\begin{macro}{\si@locale}
%\begin{macro}{\si@loctolang}
% Handling typographic conventions needs three keys. \opt{locale} is
@@ -5378,6 +5423,18 @@ author.
\newcommand*{\si@fix@none}{}
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\si@fix@to}
+%\begin{macro}{\si@fix@dash}
+%\begin{macro}{\si@fix@dots}
+% For the range system.
+% \begin{macrocode}
+\newcommand*{\si@fix@to}{ to }
+\newcommand*{\si@fix@dash}{--}
+\newcommand*{\si@fix@dots}{\,\dots\,}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
%
%\subsection{Symbols}
%\begin{macro}{\si@symbol}
@@ -10228,6 +10285,39 @@ author.
%\end{macro}
%\end{macro}
%
+%\subsection{Ranges}
+%
+%\begin{macro}{\numrange}
+%\changes{v1.2}{2009/01/22}{New user macro}
+%\begin{macro}{\SIrange}
+%\changes{v1.2}{2009/01/22}{New user macro}
+% Ranges are essentially just repeated calls to \cs{num} or \cs{SI}.
+% However, a nice wrapper is useful.
+% \begin{macrocode}
+\si@newrobustcmd*{\numrange}[3][]{%
+ \begingroup
+ \sisetup{#1}%
+ \num{#2}%
+ \text{\si@tophrase}%
+ \num{#3}%
+ \endgroup
+}
+\si@newrobustcmd*{\SIrange}[4][]{%
+ \begingroup
+ \sisetup{#1}
+ \ifsi@repeatunits
+ \SI{#2}{#4}%
+ \else
+ \num{#2}%
+ \fi
+ \text{\si@tophrase}%
+ \SI{#3}{#4}%
+ \endgroup
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%
%\subsection{Locales}
%\begin{macro}{\si@loc@load}
%\begin{macro}{\si@loc@sisetup}
@@ -10650,6 +10740,7 @@ author.
textsf=sffamily,
texttt=ttfamily,
tightpm=false,
+ tophrase=to,
trapambigerr=true,
trapambigfrac=true,
unitsep=thin,
@@ -10746,7 +10837,7 @@ author.
% powers.
% \begin{macrocode}
\ProvidesFile{si-prefix.cfg}
- [2008/12/22 v1.1j siunitx: SI Multiple prefixes]
+ [2009/01/22 v1.2 siunitx: SI Multiple prefixes]
\newprefix{\yocto}{-24}{y}
\newprefix{\zepto}{-21}{z}
\newprefix{\atto}{-18}{a}
@@ -10850,7 +10941,7 @@ author.
% is an awkward one, but here the UK standard is used.
% \begin{macrocode}
\ProvidesFile{si-named.cfg}
- [2008/12/22 v1.1j siunitx: SI Named units]
+ [2009/01/22 v1.2 siunitx: SI Named units]
\newunit{\becquerel}{Bq}
\newunit{\coulomb}{C}
\newunit{\farad}{F}
@@ -10946,7 +11037,7 @@ author.
% This requires \file{si-prefix.cfg} and \file{si-named.cfg}.
% \begin{macrocode}
\ProvidesFile{si-prefixed.cfg}
- [2008/12/22 v1.1j siunitx: SI Prefixed units]
+ [2009/01/22 v1.2 siunitx: SI Prefixed units]
\requiresiconfigs{prefix,named,accepted,physical}
% \end{macrocode}
%\begin{macro}{\picometre}
@@ -11244,7 +11335,7 @@ author.
% block for the appropriate option. First currents.
% \begin{macrocode}
\ProvidesFile{si-abbr.cfg}
- [2008/12/22 v1.1j siunitx: Abbreviated units]
+ [2009/01/22 v1.2 siunitx: Abbreviated units]
\requiresiconfigs{prefix,named,accepted,physical}
\newunit{\pA}{\pico\ampere}
\newunit{\nA}{\nano\ampere}
@@ -11467,7 +11558,7 @@ author.
% These are defined here, although some are in very general use.
% \begin{macrocode}
\ProvidesFile{si-addn.cfg}
- [2008/12/22 v1.1j siunitx: SI Additional units]
+ [2009/01/22 v1.2 siunitx: SI Additional units]
\newunit{\angstrom}{\si@sym@ringA}
\newunit{\are}{a}
\newunit{\hectare}{\hecto\are}
@@ -11517,7 +11608,7 @@ author.
%\begin{macro}{\percent}
% \begin{macrocode}
\ProvidesFile{si-accepted.cfg}
- [2008/12/22 v1.1j siunitx: SI Accepted units]
+ [2009/01/22 v1.2 siunitx: SI Accepted units]
\newunit{\minute}{min}
\newunit{\hour}{h}
\newunit{\Day}{d}
@@ -11570,7 +11661,7 @@ author.
% for a negative kern does make things a bit complicated.
% \begin{macrocode}
\ProvidesFile{si-physical.cfg}
- [2008/12/22 v1.1j siunitx: SI Physically-measured units]
+ [2009/01/22 v1.2 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%
@@ -11606,7 +11697,7 @@ author.
% own definitions.
% \begin{macrocode}
\ProvidesFile{si-synchem.cfg}
- [2008/12/22 v1.1j siunitx: Units for synthetic chemists]
+ [2009/01/22 v1.2 siunitx: Units for synthetic chemists]
\requiresiconfigs{prefix}
\newunit{\mmHg}{mmHg}
\newunit{\molar}{\mole\per\cubic\deci\metre}
@@ -11627,7 +11718,7 @@ author.
% Some units inspired by \pkg{hepunits}.
% \begin{macrocode}
\ProvidesFile{si-hep.cfg}
- [2008/12/22 v1.1j siunitx: Units for high-energy physics]
+ [2009/01/22 v1.2 siunitx: Units for high-energy physics]
\requiresiconfigs{prefix,named}
% \end{macrocode}
%\begin{macro}{\micron}
@@ -11709,7 +11800,7 @@ author.
% For astronomy, the \cs{parsec} unit is needed.
% \begin{macrocode}
\ProvidesFile{si-astro.cfg}
- [2008/12/22 v1.1j siunitx: Units for astronomy]
+ [2009/01/22 v1.2 siunitx: Units for astronomy]
\newunit{\parsec}{pc}
\newunit{\lightyear}{ly}
% \end{macrocode}
@@ -11724,7 +11815,7 @@ author.
% The unit \cs{gon} is useful here.
% \begin{macrocode}
\ProvidesFile{si-geophys.cfg}
- [2008/12/22 v1.1j siunitx: Units for astronomy]
+ [2009/01/22 v1.2 siunitx: Units for astronomy]
\newunit{\gon}{gon}
% \end{macrocode}
%\end{macro}
@@ -11745,7 +11836,7 @@ author.
% \SIunits. First, the binary prefixes.
% \begin{macrocode}
\ProvidesFile{si-binary.cfg}
- [2008/12/22 v1.1j siunitx: Binary units]
+ [2009/01/22 v1.2 siunitx: Binary units]
\newprefix[binary]{\kibi}{10}{Ki}
\newprefix[binary]{\mebi}{20}{Mi}
\newprefix[binary]{\gibi}{30}{Gi}
@@ -11788,7 +11879,7 @@ author.
% default values.\footnote{The package author is in the UK.}
% \begin{macrocode}
\ProvidesFile{si-UK.cfg}
- [2008/12/22 v1.1j siunitx: UK locale]
+ [2009/01/22 v1.2 siunitx: UK locale]
\sisetup{
unitsep=thin,
expproduct=times,
@@ -11805,7 +11896,7 @@ author.
% The same as for the UK.
% \begin{macrocode}
\ProvidesFile{si-USA.cfg}
- [2008/12/22 v1.1j siunitx: USA locale]
+ [2009/01/22 v1.2 siunitx: USA locale]
\sisetup{
unitsep=thin,
expproduct=times,
@@ -11822,7 +11913,7 @@ author.
% Germany, hopefully.
% \begin{macrocode}
\ProvidesFile{si-DE.cfg}
- [2008/12/22 v1.1j siunitx: Germany locale]
+ [2009/01/22 v1.2 siunitx: Germany locale]
\sisetup{
unitsep=cdot,
valuesep=thin,
@@ -11839,7 +11930,7 @@ author.
% Design decisions taken from the same section of \SIstyle.
% \begin{macrocode}
\ProvidesFile{si-ZA.cfg}
- [2008/12/22 v1.1j siunitx: South Africa locale]
+ [2009/01/22 v1.2 siunitx: South Africa locale]
\sisetup{
unitsep=cdot,
valuesep=thin,
@@ -11871,7 +11962,7 @@ author.
% \units for conflicting options, so users probably expect none.
% \begin{macrocode}
\ProvidesFile{si-units.cfg}
- [2008/12/22 v1.1j siunitx: Emulation of units]
+ [2009/01/22 v1.2 siunitx: Emulation of units]
\si@emulating{units}{1998/08/04 v0.9b}
\si@ifloaded{SIunits}
{\si@emclash{units}{SIunits}\endinput}{}
@@ -11941,7 +12032,7 @@ author.
% clash.
% \begin{macrocode}
\ProvidesFile{si-unitsdef.cfg}
- [2008/12/22 v1.1j siunitx:
+ [2009/01/22 v1.2 siunitx:
Emulation of unitsdef]
\si@emulating{unitsdef}{2005/01/04 v0.2}
\si@ifloaded{SIunits}
@@ -12390,7 +12481,7 @@ author.
% the macros in \SIstyle as given in the manual for that package.
% \begin{macrocode}
\ProvidesFile{si-sistyle.cfg}
- [2008/12/22 v1.1j siunitx: Emulation of
+ [2009/01/22 v1.2 siunitx: Emulation of
SIstyle]
\si@emulating{sistyle}{2006/12/20 v2.3}
\sisetup{%
@@ -12574,7 +12665,7 @@ author.
% \SIunits emulation starts in much the same way.
% \begin{macrocode}
\ProvidesFile{si-SIunits.cfg}
- [2008/12/22 v1.1j siunitx: Emulation of
+ [2009/01/22 v1.2 siunitx: Emulation of
SIunits]
\si@emulating{SIunits}{2007/12/02 v1.36}
\sisetup{
@@ -13137,7 +13228,7 @@ author.
% which are not really to be encouraged.
% \begin{macrocode}
\ProvidesFile{si-hepunits.cfg}
- [2008/12/22 v1.1j siunitx: Emulation of
+ [2009/01/22 v1.2 siunitx: Emulation of
hepunits]
\si@emulating{hepunits}{2007/09/27}
\requiresiconfigs{SIunits,accepted,prefix,hep}
@@ -13292,7 +13383,7 @@ author.
% a little emulation and a few macros needed.
% \begin{macrocode}
\ProvidesFile{si-fancynum.cfg}
- [2008/12/22 v1.1j siunitx: Emulation of
+ [2009/01/22 v1.2 siunitx: Emulation of
fancynum]
\si@emulating{fancynum}{2000/08/08 0.92}
\sisetup{decimalsymbol=cdot,digitsep=comma}
@@ -13354,7 +13445,7 @@ author.
% test is needed.
% \begin{macrocode}
\ProvidesFile{si-fancyunits.cfg}
- [2008/12/22 v1.1j siunitx: Emulation of
+ [2009/01/22 v1.2 siunitx: Emulation of
fancyunits]
\si@emulating{fancyunits}{2007/02/01 v1.0.1}
\si@ifloaded{SIunits}
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.ins b/Master/texmf-dist/source/latex/siunitx/siunitx.ins
index a26e2854605..632e2d1bb19 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.ins
+++ b/Master/texmf-dist/source/latex/siunitx/siunitx.ins
@@ -72,6 +72,7 @@
\file{\jobname.bib}{\from{\jobname.dtx}{refs}}
}
\endbatchfile
+%%\DescribeOption{tophrase}
\endinput
%%
%% End of file `siunitx.ins'.