diff options
author | Karl Berry <karl@freefriends.org> | 2007-09-28 23:13:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-09-28 23:13:53 +0000 |
commit | a0a2805999c76cb60a36a5a15c869734295bd36d (patch) | |
tree | 90c8b00e2f1c196926816c8671e456ff2dc1f581 /Master/texmf-dist/tex | |
parent | 742b9bd08a06566ee69d1b6ad6c53a8db1e72c28 (diff) |
hepunits 1.1.1 (27sep07)
git-svn-id: svn://tug.org/texlive/trunk@5061 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/hepunits/hepunits.sty | 155 |
1 files changed, 141 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/hepunits/hepunits.sty b/Master/texmf-dist/tex/latex/hepunits/hepunits.sty index 79939f6d88c..50b8adcd48c 100644 --- a/Master/texmf-dist/tex/latex/hepunits/hepunits.sty +++ b/Master/texmf-dist/tex/latex/hepunits/hepunits.sty @@ -1,9 +1,93 @@ -\ProvidesPackage{hepunits}[2005/01/11] -\RequirePackage{amsmath} -\RequirePackage[mediumspace,thickqspace,derived,squaren,textstyle]{SIunits} +%% hepunits +%% High energy physics (HEP) extensions to the SIunits package +%% Author: Andy Buckley <andy@insectnation.org> +%% +%% This material is subject to the LaTeX Project Public License. +%% See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html +%% or the details of that license. +%% +%% Please let me know if you use hepunits and what you think of it. +%% I'll try to implement any suggested options that seem sensible! + +\def\fileversion{1.1.1} +\def\filedate{2007/09/27} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{hepunits}[\filedate\space High-energy physics units by Andy Buckley (v\fileversion)] +%% Now-redundant wrapper for declaring new units \DeclareRobustCommand{\@NewUnit}[2]{\addunit{#1}{#2}} +%% Option handling variables +\def\@empty{} +\def\@yes{yes} +\def\@HEPopt@noprefixcmds{} +\def\@SIopt@cdot{} +\def\@SIopt@space{mediumspace} +\def\@SIopt@qspace{thickqspace} +\def\@SIopt@amssquare{squaren} +\def\@SIopt@pstricks{} +\def\@SIopt@Gray{} +\def\@SIopt@italian{} +\def\@SIopt@textstyle{yes} +\def\@SIopt@binary{} +\def\@SIopt@noams{} +\def\@SIopt@derivedinbase{} +\def\@SIopt@derived{} + +%% Option for turning off explicit SI prefix commands +\DeclareOption{noprefixcmds}{\def\@HEPopt@noprefixcmds{yes}} + +%% Options for passing to SIunits +\DeclareOption{cdot}{\def\@SIopt@cdot{yes}} +\DeclareOption{thickspace}{\def\@SIopt@space{thickspace}} +\DeclareOption{mediumspace}{\def\@SIopt@space{mediumspace}} +\DeclareOption{thinspace}{\def\@SIopt@space{thinspace}} +\DeclareOption{thickqspace}{\def\@SIopt@qspace{thickqspace}} +\DeclareOption{mediumqspace}{\def\@SIopt@qspace{mediumqspace}} +\DeclareOption{thinqspace}{\def\@SIopt@qspace{thinqspace}} +\DeclareOption{noamssquareissue}{\def\@SIopt@amssquare{}} +\DeclareOption{amssymb}{\def\@SIopt@amssquare{amssymb}} +\DeclareOption{squaren}{\def\@SIopt@amssquare{squaren}} +\DeclareOption{pstricks}{\def\@SIopt@pstricks{yes}} +\DeclareOption{Gray}{\def\@SIopt@Gray{yes}} +\DeclareOption{italian}{\def\@SIopt@italian{yes}} +\DeclareOption{textstyle}{\def\@SIopt@textstyle{yes}} +\DeclareOption{notextstyle}{\def\@SIopt@textstyle{}} +\DeclareOption{binary}{\def\@SIopt@binary{yes}} +\DeclareOption{noams}{\def\@SIopt@noams{yes}} +\DeclareOption{derivedinbase}{\def\@SIopt@derivedinbase{yes}} +\DeclareOption{derived}{\def\@SIopt@derived{yes}} +%\DeclareOption{noderived}{\def\@SIopt@derived{}} + +\ProcessOptions + +%% Pass the SIunits yes/no options +\ifx\@SIopt@cdot\@yes\PassOptionsToPackage{cdot}{SIunits}\fi +\ifx\@SIopt@pstricks\@yes\PassOptionsToPackage{pstricks}{SIunits}\fi +\ifx\@SIopt@Gray\@yes\PassOptionsToPackage{Gray}{SIunits}\fi +\ifx\@SIopt@italian\@yes\PassOptionsToPackage{italian}{SIunits}\fi +\ifx\@SIopt@textstyle\@yes\PassOptionsToPackage{textstyle}{SIunits}\fi +\ifx\@SIopt@binary\@yes\PassOptionsToPackage{binary}{SIunits}\fi +\ifx\@SIopt@noams\@yes\PassOptionsToPackage{noams}{SIunits}\fi +\ifx\@SIopt@derivedinbase\@yes\PassOptionsToPackage{derivedinbase}{SIunits}\fi +\ifx\@SIopt@derived\@yes\PassOptionsToPackage{derived}{SIunits}\fi +%% Pass the SIunits "choice" options +\ifx\@SIopt@space\@empty\else\PassOptionsToPackage{\@SIopt@space}{SIunits}\fi +\ifx\@SIopt@qspace\@empty\else\PassOptionsToPackage{\@SIopt@qspace}{SIunits}\fi +\ifx\@SIopt@amssquare\@empty\else\PassOptionsToPackage{\@SIopt@amssquare}{SIunits}\fi + +%% Get the dependancy packages, now that the options +%% have been processed +\RequirePackage{amsmath} +\RequirePackage{xspace} +\RequirePackage{SIunits} + +%% ------------------------------------------------- +%% Units defined below here +%% ------------------------------------------------- + +\@NewUnit{\Hz}{\hertz} +\ifx\@HEPopt@noprefixcmds\@empty %% Lengths \@NewUnit{\nm}{\nano\metre} \@NewUnit{\micron}{\micro\metre} @@ -14,32 +98,75 @@ \@NewUnit{\mrad}{\milli\rad} %% Times +\@NewUnit{\as}{\atto\second} +\@NewUnit{\fs}{\femto\second} \@NewUnit{\ps}{\pico\second} \@NewUnit{\ns}{\nano\second} %% Rates -\@NewUnit{\Hertz}{\hertz} -\@NewUnit{\Hz}{\hertz} +\@NewUnit{\mHz}{\milli\hertz} \@NewUnit{\kHz}{\kilo\hertz} \@NewUnit{\MHz}{\mega\hertz} +\@NewUnit{\GHz}{\giga\hertz} +\@NewUnit{\THz}{\tera\hertz} +\fi %% Fields -\@NewUnit{\Tesla}{\tesla} +\@NewUnit{\gauss}{G} %% Luminosity \@NewUnit{\invcmsqpersecond}{\rpsquare{\centi\metre}\usk\reciprocal{\second}} -\providecommand{\lumiunits}{\invcmsqpersecond} +\@NewUnit{\invcmsqpersec}{\invcmsqpersecond} +\DeclareRobustCommand{\lumiunits}{\invcmsqpersecond} + +%% (Inverse) cross-sections +\@NewUnit{\invbarn}{\reciprocal\barn\xspace} +\ifx\@HEPopt@noprefixcmds\@empty +\@NewUnit{\nanobarn}{\nano\barn\xspace} +\@NewUnit{\picobarn}{\pico\barn\xspace} +\@NewUnit{\femtobarn}{\femto\barn\xspace} +\@NewUnit{\attobarn}{\atto\barn\xspace} +\@NewUnit{\zeptobarn}{\zepto\barn\xspace} +\@NewUnit{\yoctobarn}{\yocto\barn\xspace} +\@NewUnit{\invnanobarn}{\nano\invbarn\xspace} +\@NewUnit{\invpicobarn}{\pico\invbarn\xspace} +\@NewUnit{\invfemtobarn}{\femto\invbarn\xspace} +\@NewUnit{\invattobarn}{\atto\invbarn\xspace} +\@NewUnit{\invzeptobarn}{\zepto\invbarn\xspace} +\@NewUnit{\invyoctobarn}{\yocto\invbarn\xspace} +\@NewUnit{\invnb}{\invnanobarn} +\@NewUnit{\invpb}{\invpicobarn} +\@NewUnit{\invfb}{\invfemtobarn} +\@NewUnit{\invab}{\invattobarn} +\@NewUnit{\invzb}{\invzeptobarn} +\@NewUnit{\invyb}{\invyoctobarn} +\fi %% HEP energy, momentum and mass units \DeclareRobustCommand{\clight}{\ensuremath{c}} -\@NewUnit{\eV}{{eV}} +\@NewUnit{\eV}{\electronvolt\xspace} +\@NewUnit{\inveV}{\reciprocal\electronvolt\xspace} +\@NewUnit{\eVoverc}{\ensuremath{\eV\!/\clight}\xspace} +\@NewUnit{\eVovercsq}{\ensuremath{\eV\!/\clight^{2}}\xspace} +\ifx\@HEPopt@noprefixcmds\@empty +\@NewUnit{\meV}{\milli\eV} \@NewUnit{\keV}{\kilo\eV} \@NewUnit{\MeV}{\mega\eV} \@NewUnit{\GeV}{\giga\eV} \@NewUnit{\TeV}{\tera\eV} -\@NewUnit{\MeVoverc}{\ensuremath{\MeV\!/\clight}} -\@NewUnit{\GeVoverc}{\ensuremath{\GeV\!/\clight}} -\@NewUnit{\TeVoverc}{\ensuremath{\TeV\!/\clight}} -\@NewUnit{\MeVovercsq}{\ensuremath{\MeV\!/\clight^{2}}} -\@NewUnit{\GeVovercsq}{\ensuremath{\GeV\!/\clight^{2}}} -\@NewUnit{\TeVovercsq}{\ensuremath{\TeV\!/\clight^{2}}} +\@NewUnit{\minveV}{\milli\inveV} +\@NewUnit{\kinveV}{\kilo\inveV} +\@NewUnit{\MinveV}{\mega\inveV} +\@NewUnit{\GinveV}{\giga\inveV} +\@NewUnit{\TinveV}{\tera\inveV} +\@NewUnit{\meVoverc}{\ensuremath{\milli\eVoverc}\xspace} +\@NewUnit{\keVoverc}{\ensuremath{\kilo\eVoverc}\xspace} +\@NewUnit{\MeVoverc}{\ensuremath{\mega\eVoverc}\xspace} +\@NewUnit{\GeVoverc}{\ensuremath{\giga\eVoverc}\xspace} +\@NewUnit{\TeVoverc}{\ensuremath{\tera\eVoverc}\xspace} +\@NewUnit{\meVovercsq}{\ensuremath{\milli\eVovercsq}\xspace} +\@NewUnit{\keVovercsq}{\ensuremath{\kilo\eVovercsq}\xspace} +\@NewUnit{\MeVovercsq}{\ensuremath{\mega\eVovercsq}\xspace} +\@NewUnit{\GeVovercsq}{\ensuremath{\giga\eVovercsq}\xspace} +\@NewUnit{\TeVovercsq}{\ensuremath{\tera\eVovercsq}\xspace} +\fi |