diff options
author | Karl Berry <karl@freefriends.org> | 2009-02-22 00:19:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-02-22 00:19:28 +0000 |
commit | 22862769b10e5e0de5117786a9e51daa8391deaf (patch) | |
tree | 11d18f39b615a80f6b5863a2c9f75b94f1f5b51b /Master/texmf-dist/source/latex/siunitx | |
parent | 3348b22b321fd844d42879b68e3201f902467a11 (diff) |
siunitx 1.2f (20feb09)
git-svn-id: svn://tug.org/texlive/trunk@12202 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/siunitx')
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 138 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.ins | 1 |
2 files changed, 107 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 82a2649dc98..a1f8fb52b9d 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -41,6 +41,7 @@ % si-hep.cfg, % si-astro.cfg, % si-geophys.cfg, +% si-chemeng.cfg, % si-binary.cfg, % si-UK.cfg, % si-USA.cfg, @@ -146,6 +147,7 @@ \file{si-hep.cfg}{\from{\jobname.dtx}{hep}} \file{si-astro.cfg}{\from{\jobname.dtx}{astro}} \file{si-geophys.cfg}{\from{\jobname.dtx}{geophys}} + \file{si-chemeng.cfg}{\from{\jobname.dtx}{chemeng}} \file{si-binary.cfg}{\from{\jobname.dtx}{binary}} } \generate{\file{si-UK.cfg}{\from{\jobname.dtx}{UK}} @@ -218,7 +220,7 @@ dcolumn, rccol and numprint packages. \sisetup{ eVcorra=0.1ex, unitsep=cdot, - alsoload={synchem,hep,binary,astro,geophys}, + alsoload={synchem,hep,binary,astro,geophys,chemeng}, loctolang={UK:UKenglish,DE:german}} \setlength{\cftsubsecnumwidth}{2.5em} \begin{document} @@ -227,7 +229,7 @@ dcolumn, rccol and numprint packages. %</driver> % \fi % -%\CheckSum{10199} +%\CheckSum{10223} % % \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 @@ -822,6 +824,13 @@ dcolumn, rccol and numprint packages. %\end{LaTeXexample} %\endgroup % +%\DescribeOption{allowlitunits} +%\changes{v1.2f}{2009/02/20}{New \opt{allowlitunits} option} +% Some users may prefer to completely disable the use of literal +% input in units, for example to enforce consistency. This can be +% accomplished by setting the \opt{allowlitunits} option to +% \opt{false}: the standard setting is \defaultopt{true}. +% %\subsection{The unit interpreter} % The second operation mode for the \cs{SI} macro is based on the % behaviour of \SIunits. Here, each unit, SI multiple prefix and @@ -1521,6 +1530,22 @@ dcolumn, rccol and numprint packages. % \SI{12}{\gon} %\end{LaTeXexample} % +%\subsection{Chemical engineering (\opt{chemeng})} +%\changes{v1.2f}{2009/02/20}{New module \opt{chemeng}} +%\changes{v1.2f}{2009/02/20}{New unit \opt{gmol}} +%\changes{v1.2f}{2009/02/20}{New unit \opt{kgmol}} +%\changes{v1.2f}{2009/02/20}{New unit \opt{lbmol}} +%\DescribeMacro{\gmol} +%\DescribeMacro{\kgmol} +%\DescribeMacro{\lbmol} +% For chemical engineers, the units \cs{gmol}, \cs{kgmol} and \cs{lbmol} +% can be loaded. +%\begin{LaTeXexample} +% \SI{1}{\gmol} \\ +% \SI{5}{\kgmol} \\ +% \SI{10}{\lbmol} \\ +%\end{LaTeXexample} +% %\section{Font control} % Following the lead of \SIstyle, \currpkg provides control over the % font used to typeset output. By default, all text is typeset using @@ -2432,6 +2457,8 @@ dcolumn, rccol and numprint packages. % \bottomrule % \endlastfoot % addsign & List & Add sign to number \\ +% allowlitunits & Boolean & Allow literal input of units \\ +% allowoptarg & Boolean & Allow optional argument to unit macros \\ % allowzeroexp & Boolean & Allow \num[allowzeroexp]{e0} \\ % angformat & List & Conversion of angle format \\ % anglesep & List or literal & Space between angle components \\ @@ -3404,7 +3431,7 @@ author. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{siunitx} - [2009/02/04 v1.2e A comprehensive (SI) units package] + [2009/02/20 v1.2f A comprehensive (SI) units package] % \end{macrocode} % The package requires \eTeX, so the usual test is made. % \begin{macrocode} @@ -4813,6 +4840,12 @@ author. \si@opt@boolkey{allowoptarg} % \end{macrocode} %\end{macro} +%\begin{macro}{\ifsi@allowlitunits} +% To allow literal input in units. +% \begin{macrocode} +\si@opt@boolkey{allowlitunits} +% \end{macrocode} +%\end{macro} %\changes{v1.1d}{2008/10/29}{Minor bug with \opt{per} option fixed} %\begin{macro}{\ifsi@frac} %\begin{macro}{\ifsi@slash} @@ -9090,12 +9123,12 @@ author. % The unit includes one or more literal items; typeset using the % unit typesetting macro. % \begin{macrocode} - {\si@log@debug{Literal items found in unit - argument:\MessageBreak outputting without further - processing}% - \si@unt@litouttrue - \si@unt@addvaluesep - \si@unt@out{#1}} + {\ifsi@allowlitunits + \expandafter\si@unt@litprint + \else + \expandafter\si@unt@nolitprint + \fi + {#1}} % \end{macrocode} % For processable output, the argument is executed; the macros are % all designed for this. @@ -9109,6 +9142,27 @@ author. % \end{macrocode} %\end{macro} %\end{macro} +%\begin{macro}{\si@unt@litprint} +%\begin{macro}{\si@unt@nolitprint} +% A couple of related macros to cope with literal printing (or not). +% \begin{macrocode} +\newcommand*{\si@unt@litprint}[1]{% + \si@log@debug{% + Literal items found in unit argument:\MessageBreak outputting + without further processing}% + \si@unt@litouttrue + \si@unt@addvaluesep + \si@unt@out{#1}% +} +\newcommand*{\si@unt@nolitprint}[1]{% + \si@log@err{Literal units disabled}{% + You can the literal input `#1' for a unit\MessageBreak + but the allowliteralunits option is off. + } +} +% \end{macrocode} +%\end{macro} +%\end{macro} %\begin{macro}{\si@unt@addvaluesep} %\begin{macro}{\si@unt@addvalsep} %\begin{macro}{\si@unt@litvalsep} @@ -10676,6 +10730,7 @@ author. % \begin{macrocode} \sisetup{ addsign=none, + allowlitunits=true, allowzeroexp=false, angformat=unchanged, astroang=false,%( @@ -10839,7 +10894,7 @@ author. % powers. % \begin{macrocode} \ProvidesFile{si-prefix.cfg} - [2009/02/04 v1.2e siunitx: SI Multiple prefixes] + [2009/02/20 v1.2f siunitx: SI Multiple prefixes] \newprefix{\yocto}{-24}{y} \newprefix{\zepto}{-21}{z} \newprefix{\atto}{-18}{a} @@ -10943,7 +10998,7 @@ author. % is an awkward one, but here the UK standard is used. % \begin{macrocode} \ProvidesFile{si-named.cfg} - [2009/02/04 v1.2e siunitx: SI Named units] + [2009/02/20 v1.2f siunitx: SI Named units] \newunit{\becquerel}{Bq} \newunit{\coulomb}{C} \newunit{\farad}{F} @@ -11039,7 +11094,7 @@ author. % This requires \file{si-prefix.cfg} and \file{si-named.cfg}. % \begin{macrocode} \ProvidesFile{si-prefixed.cfg} - [2009/02/04 v1.2e siunitx: SI Prefixed units] + [2009/02/20 v1.2f siunitx: SI Prefixed units] \requiresiconfigs{prefix,named,accepted,physical} % \end{macrocode} %\begin{macro}{\picometre} @@ -11337,7 +11392,7 @@ author. % block for the appropriate option. First currents. % \begin{macrocode} \ProvidesFile{si-abbr.cfg} - [2009/02/04 v1.2e siunitx: Abbreviated units] + [2009/02/20 v1.2f siunitx: Abbreviated units] \requiresiconfigs{prefix,named,accepted,physical} \newunit{\pA}{\pico\ampere} \newunit{\nA}{\nano\ampere} @@ -11560,7 +11615,7 @@ author. % These are defined here, although some are in very general use. % \begin{macrocode} \ProvidesFile{si-addn.cfg} - [2009/02/04 v1.2e siunitx: SI Additional units] + [2009/02/20 v1.2f siunitx: SI Additional units] \newunit{\angstrom}{\si@sym@ringA} \newunit{\are}{a} \newunit{\hectare}{\hecto\are} @@ -11609,7 +11664,7 @@ author. %\begin{macro}{\bel} % \begin{macrocode} \ProvidesFile{si-accepted.cfg} - [2009/02/04 v1.2e siunitx: SI Accepted units] + [2009/02/20 v1.2f siunitx: SI Accepted units] \newunit{\minute}{min} \newunit{\hour}{h} \newunit{\Day}{d} @@ -11667,7 +11722,7 @@ author. % for a negative kern does make things a bit complicated. % \begin{macrocode} \ProvidesFile{si-physical.cfg} - [2009/02/04 v1.2e siunitx: SI Physically-measured units] + [2009/02/20 v1.2f 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% @@ -11703,7 +11758,7 @@ author. % own definitions. % \begin{macrocode} \ProvidesFile{si-synchem.cfg} - [2009/02/04 v1.2e siunitx: Units for synthetic chemists] + [2009/02/20 v1.2f siunitx: Units for synthetic chemists] \requiresiconfigs{prefix} \newunit{\mmHg}{mmHg} \newunit{\molar}{\mole\per\cubic\deci\metre} @@ -11724,7 +11779,7 @@ author. % Some units inspired by \pkg{hepunits}. % \begin{macrocode} \ProvidesFile{si-hep.cfg} - [2009/02/04 v1.2e siunitx: Units for high-energy physics] + [2009/02/20 v1.2f siunitx: Units for high-energy physics] \requiresiconfigs{prefix,named} % \end{macrocode} %\begin{macro}{\micron} @@ -11806,7 +11861,7 @@ author. % For astronomy, the \cs{parsec} unit is needed. % \begin{macrocode} \ProvidesFile{si-astro.cfg} - [2009/02/04 v1.2e siunitx: Units for astronomy] + [2009/02/20 v1.2f siunitx: Units for astronomy] \newunit{\parsec}{pc} \newunit{\lightyear}{ly} % \end{macrocode} @@ -11821,12 +11876,31 @@ author. % The unit \cs{gon} is useful here. % \begin{macrocode} \ProvidesFile{si-geophys.cfg} - [2009/02/04 v1.2e siunitx: Units for astronomy] + [2009/02/20 v1.2f siunitx: Units for astronomy] \newunit{\gon}{gon} % \end{macrocode} %\end{macro} %\iffalse %</geophys> +%<*chemeng> +%\fi +%\subsection{Chemical engineering} +%\begin{macro}{\gmol} +%\begin{macro}{\kgmol} +%\begin{macro}{\lbmol} +% For astronomy, the \cs{parsec} unit is needed. +% \begin{macrocode} +\ProvidesFile{si-chemeng.cfg} + [2009/02/20 v1.2f siunitx: Units for chemical engineering] +\newunit{\gmol}{g\text{-}mol} +\newunit{\kgmol}{kg\text{-}mol} +\newunit{\lbmol}{lb\text{-}mol} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\iffalse +%</chemeng> %<*binary> %\fi %\subsection{Binary units} @@ -11842,7 +11916,7 @@ author. % \SIunits. First, the binary prefixes. % \begin{macrocode} \ProvidesFile{si-binary.cfg} - [2009/02/04 v1.2e siunitx: Binary units] + [2009/02/20 v1.2f siunitx: Binary units] \newprefix[binary]{\kibi}{10}{Ki} \newprefix[binary]{\mebi}{20}{Mi} \newprefix[binary]{\gibi}{30}{Gi} @@ -11885,7 +11959,7 @@ author. % default values.\footnote{The package author is in the UK.} % \begin{macrocode} \ProvidesFile{si-UK.cfg} - [2009/02/04 v1.2e siunitx: UK locale] + [2009/02/20 v1.2f siunitx: UK locale] \sisetup{ unitsep=thin, expproduct=times, @@ -11902,7 +11976,7 @@ author. % The same as for the UK. % \begin{macrocode} \ProvidesFile{si-USA.cfg} - [2009/02/04 v1.2e siunitx: USA locale] + [2009/02/20 v1.2f siunitx: USA locale] \sisetup{ unitsep=thin, expproduct=times, @@ -11919,7 +11993,7 @@ author. % Germany, hopefully. % \begin{macrocode} \ProvidesFile{si-DE.cfg} - [2009/02/04 v1.2e siunitx: Germany locale] + [2009/02/20 v1.2f siunitx: Germany locale] \sisetup{ unitsep=cdot, valuesep=thin, @@ -11937,7 +12011,7 @@ author. % Design decisions taken from the same section of \SIstyle. % \begin{macrocode} \ProvidesFile{si-ZA.cfg} - [2009/02/04 v1.2e siunitx: South Africa locale] + [2009/02/20 v1.2f siunitx: South Africa locale] \sisetup{ unitsep=cdot, valuesep=thin, @@ -11969,7 +12043,7 @@ author. % \units for conflicting options, so users probably expect none. % \begin{macrocode} \ProvidesFile{si-units.cfg} - [2009/02/04 v1.2e siunitx: Emulation of units] + [2009/02/20 v1.2f siunitx: Emulation of units] \si@emulating{units}{1998/08/04 v0.9b} \si@ifloaded{SIunits} {\si@emclash{units}{SIunits}\endinput}{} @@ -12039,7 +12113,7 @@ author. % clash. % \begin{macrocode} \ProvidesFile{si-unitsdef.cfg} - [2009/02/04 v1.2e siunitx: + [2009/02/20 v1.2f siunitx: Emulation of unitsdef] \si@emulating{unitsdef}{2005/01/04 v0.2} \si@ifloaded{SIunits} @@ -12488,7 +12562,7 @@ author. % the macros in \SIstyle as given in the manual for that package. % \begin{macrocode} \ProvidesFile{si-sistyle.cfg} - [2009/02/04 v1.2e siunitx: Emulation of + [2009/02/20 v1.2f siunitx: Emulation of SIstyle] \si@emulating{sistyle}{2006/12/20 v2.3} \sisetup{% @@ -12672,7 +12746,7 @@ author. % \SIunits emulation starts in much the same way. % \begin{macrocode} \ProvidesFile{si-SIunits.cfg} - [2009/02/04 v1.2e siunitx: Emulation of + [2009/02/20 v1.2f siunitx: Emulation of SIunits] \si@emulating{SIunits}{2007/12/02 v1.36} \sisetup{ @@ -13235,7 +13309,7 @@ author. % which are not really to be encouraged. % \begin{macrocode} \ProvidesFile{si-hepunits.cfg} - [2009/02/04 v1.2e siunitx: Emulation of + [2009/02/20 v1.2f siunitx: Emulation of hepunits] \si@emulating{hepunits}{2007/09/27} \requiresiconfigs{SIunits,accepted,prefix,hep} @@ -13390,7 +13464,7 @@ author. % a little emulation and a few macros needed. % \begin{macrocode} \ProvidesFile{si-fancynum.cfg} - [2009/02/04 v1.2e siunitx: Emulation of + [2009/02/20 v1.2f siunitx: Emulation of fancynum] \si@emulating{fancynum}{2000/08/08 0.92} \sisetup{decimalsymbol=cdot,digitsep=comma} @@ -13452,7 +13526,7 @@ author. % test is needed. % \begin{macrocode} \ProvidesFile{si-fancyunits.cfg} - [2009/02/04 v1.2e siunitx: Emulation of + [2009/02/20 v1.2f 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..6e0ca741b08 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.ins +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.ins @@ -59,6 +59,7 @@ \file{si-hep.cfg}{\from{\jobname.dtx}{hep}}
\file{si-astro.cfg}{\from{\jobname.dtx}{astro}}
\file{si-geophys.cfg}{\from{\jobname.dtx}{geophys}}
+ \file{si-chemeng.cfg}{\from{\jobname.dtx}{chemeng}}
\file{si-binary.cfg}{\from{\jobname.dtx}{binary}}
}
\generate{\file{si-UK.cfg}{\from{\jobname.dtx}{UK}}
|