From cd841589f4c33a97df820008421c61b888421bd2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 20 Dec 2006 23:43:03 +0000 Subject: SIstyle update (21dec06) git-svn-id: svn://tug.org/texlive/trunk@2830 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/SIstyle/sistyle.sty | 43 +++++++++++++++++++++---- 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'Master/texmf-dist/tex/latex/SIstyle') diff --git a/Master/texmf-dist/tex/latex/SIstyle/sistyle.sty b/Master/texmf-dist/tex/latex/SIstyle/sistyle.sty index b1828606b12..1526f83297b 100644 --- a/Master/texmf-dist/tex/latex/SIstyle/sistyle.sty +++ b/Master/texmf-dist/tex/latex/SIstyle/sistyle.sty @@ -31,8 +31,19 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{sistyle} - [2006/07/11 v2.1 SI units and numbers (DNJ Els)] + [2006/12/20 v2.3 SI units and numbers (DNJ Els)] \RequirePackage{amstext} +\newif\ifSI@eTeX +\SI@eTeXfalse +\ifx\eTeXversion\@undefined +\else + \ifx\eTeXversion\relax + \else + \ifnum\eTeXversion>\z@ + \SI@eTeXtrue + \fi + \fi +\fi \begingroup \catcode`\Q=3 \long\gdef\SI@ifempt#1{\SI@xifempt#1QQ\@secondoftwo\@firstoftwo\@nil} @@ -225,20 +236,40 @@ \let\SI@unitdot=\pnt% \SIupmath[\SI@defaultNfam]{\SI@num{#1}}}} \DeclareRobustCommand*{\num}{\@ifstar{\SI@num}{\SInum}} +\ifSI@eTeX + \DeclareRobustCommand{\ang}{% + \begingroup + \catcode`;=12\relax + \catcode`@=11\relax + \SI@ang} + \def\SI@ang#1{% + \scantokens{\SI@@ang#1;;;\@nil}% + \endgroup} + \def\SI@@ang#1;#2;#3;#4\@nil{% + \SI@@@ang{#1}{#2}{#3}}% +\else + \DeclareRobustCommand{\ang}[1]{% + \@nameuse{SI@ang@\romannumeral\catcode`\;}{#1}}% + \begingroup + \catcode`\;=12\relax + \gdef\SI@ang@xii#1{\SI@@ang@xii#1;;;\@nil} + \gdef\SI@@ang@xii#1;#2;#3;#4\@nil{\SI@@@ang{#1}{#2}{#3}} + \catcode`\;=\active\relax + \gdef\SI@ang@xiii#1{\SI@@ang@xiii#1;;;\@nil} + \gdef\SI@@ang@xiii#1;#2;#3;#4\@nil{\SI@@@ang{#1}{#2}{#3}} + \endgroup +\fi \let\SI@degs=\relax \let\SI@mins=\relax \let\SI@secs=\relax -\DeclareRobustCommand{\ang}[1]{\SI@ang#1;;;\@nnil} -\def\SI@ang#1;#2;#3;#4\@nnil{% -\bgroup +\newcommand*{\SI@@@ang}[3]{{% \SI@ifempt{#3}{}{\def\SI@secs{\SInum{#3}\SIupmath{\arcsec}}% \def\SI@mins{\SInum{0}\SIupmath{\arcmin}}% \def\SI@degs{\SInum{0}\SIupmath{\arcdeg}}}% \SI@ifempt{#2}{}{\def\SI@mins{\SInum{#2}\SIupmath{\arcmin}}% \def\SI@degs{\SInum{0}\SIupmath{\arcdeg}}}% \SI@ifempt{#1}{}{\def\SI@degs{\SInum{#1}\SIupmath{\arcdeg}}}% - \SI@degs\SI@mins\SI@secs -\egroup} + \SI@degs\SI@mins\SI@secs}} \newcommand*{\SI@unitsep}{\,} \newcommand*{\SIunitsep}[1]{\renewcommand*{\SI@unitsep}{#1}} \newcommand*{\SI@unitspace}{\,} -- cgit v1.2.3