summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-01-09 01:37:25 +0000
committerKarl Berry <karl@freefriends.org>2007-01-09 01:37:25 +0000
commit75749358b57f757623123e34d01f1d7c02379873 (patch)
treebe185fa3c9d6f086db3554f34624cb4bed30411e /Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
parenta9502e7a832eee7a924f5f6bdaccddef01bf5b74 (diff)
fmtcount update (7jan07)
git-svn-id: svn://tug.org/texlive/trunk@3260 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty')
-rw-r--r--Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty85
1 files changed, 39 insertions, 46 deletions
diff --git a/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty b/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
index 8bca3804618..9ca97952fb5 100644
--- a/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
+++ b/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
@@ -5,7 +5,7 @@
%% The original source files were:
%%
%% fmtcount.dtx (with options: `fmtcount.sty,package')
-%% Copyright (C) 2006 Nicola Talbot, all rights reserved.
+%% Copyright (C) 2007 Nicola Talbot, all rights reserved.
%% If you modify this file, you must change its name first.
%% You are NOT ALLOWED to distribute this file alone. You are NOT
%% ALLOWED to take money for the distribution or use of either this
@@ -27,11 +27,10 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fmtcount}[2006/07/29 v1.04]
+\ProvidesPackage{fmtcount}[2007/01/06 v1.06]
\RequirePackage{ifthen}
\RequirePackage{keyval}
\providecommand{\fmtord}[1]{\textsuperscript{#1}}
-
\newcount\c@padzeroesN
\c@padzeroesN=1\relax
\providecommand{\padzeroes}[1][17]{\c@padzeroesN=#1}
@@ -52,7 +51,6 @@ to load babel before loading fmtcount}}{
{Option `french' can only take the values `france',
`belgian' or `swiss'}}
}}
-
\define@key{fmtcount}{fmtord}{%
\ifthenelse{\equal{#1}{level}
\or\equal{#1}{raise}
@@ -61,7 +59,6 @@ to load babel before loading fmtcount}}{
\PackageError{fmtcount}{Invalid value `#1' to fmtord key}
{Option `fmtord' can only take the values `level', `raise'
or `user'}}}
-
\newif\iffmtord@abbrv
\fmtord@abbrvfalse
\define@key{fmtcount}{abbrv}[true]{%
@@ -70,19 +67,26 @@ or `user'}}}
\PackageError{fmtcount}{Invalid value `#1' to fmtord key}
{Option `fmtord' can only take the values `true' or
`false'}}}
-
\newcommand{\fmtcountsetoptions}[1]{%
\def\fmtcount@fmtord{}%
\setkeys{fmtcount}{#1}%
\@ifundefined{datefrench}{}{%
-\edef\@ordinalstringMfrench{\noexpand\csname @ordinalstringMfrench\fmtcount@french\noexpand\endcsname}%
-\edef\@ordinalstringFfrench{\noexpand\csname @ordinalstringFfrench\fmtcount@french\noexpand\endcsname}%
-\edef\@OrdinalstringMfrench{\noexpand\csname @OrdinalstringMfrench\fmtcount@french\noexpand\endcsname}%
-\edef\@OrdinalstringFfrench{\noexpand\csname @OrdinalstringFfrench\fmtcount@french\noexpand\endcsname}%
-\edef\@numberstringMfrench{\noexpand\csname @numberstringMfrench\fmtcount@french\noexpand\endcsname}%
-\edef\@numberstringFfrench{\noexpand\csname @numberstringFfrench\fmtcount@french\noexpand\endcsname}%
-\edef\@NumberstringMfrench{\noexpand\csname @NumberstringMfrench\fmtcount@french\noexpand\endcsname}%
-\edef\@NumberstringFfrench{\noexpand\csname @NumberstringFfrench\fmtcount@french\noexpand\endcsname}%
+\edef\@ordinalstringMfrench{\noexpand
+\csname @ordinalstringMfrench\fmtcount@french\noexpand\endcsname}%
+\edef\@ordinalstringFfrench{\noexpand
+\csname @ordinalstringFfrench\fmtcount@french\noexpand\endcsname}%
+\edef\@OrdinalstringMfrench{\noexpand
+\csname @OrdinalstringMfrench\fmtcount@french\noexpand\endcsname}%
+\edef\@OrdinalstringFfrench{\noexpand
+\csname @OrdinalstringFfrench\fmtcount@french\noexpand\endcsname}%
+\edef\@numberstringMfrench{\noexpand
+\csname @numberstringMfrench\fmtcount@french\noexpand\endcsname}%
+\edef\@numberstringFfrench{\noexpand
+\csname @numberstringFfrench\fmtcount@french\noexpand\endcsname}%
+\edef\@NumberstringMfrench{\noexpand
+\csname @NumberstringMfrench\fmtcount@french\noexpand\endcsname}%
+\edef\@NumberstringFfrench{\noexpand
+\csname @NumberstringFfrench\fmtcount@french\noexpand\endcsname}%
}%
\ifthenelse{\equal{\fmtcount@fmtord}{level}}{%
\renewcommand{\fmtord}[1]{##1}}{%
@@ -97,9 +101,7 @@ or `user'}}}
\def\fmtord#1{#1}}
\DeclareOption{raise}{\def\fmtcount@fmtord{raise}%
\def\fmtord#1{\textsuperscript{#1}}}
-
\ProcessOptions
-
\newcount\@DT@modctr
\def\@modulo#1#2{%
\@DT@modctr=#1\relax
@@ -181,8 +183,8 @@ or `user'}}}
\@@hexadecimal\@DT@X}
\let\hexadecimalnum=\@hexadecimal
-
-\newcommand{\@@Hexadecimal}[1]{\ifcase#10\or1\or2\or3\or4\or5\or6\or7\or8\or9\or A\or B\or C\or D\or E\or F\fi}
+\newcommand{\@@Hexadecimal}[1]{\ifcase#10\or1\or2\or3\or4\or5\or6\or
+7\or8\or9\or A\or B\or C\or D\or E\or F\fi}
\newcommand{\@Hexadecimal}[1]{%
\@DT@padzeroestrue
@@ -224,7 +226,6 @@ or `user'}}}
}
\let\aaalphnum=\@aaalph
-
\newcommand{\@AAAlph}[1]{%
\@DT@loopN=#1\relax
\advance\@DT@loopN by -1\relax
@@ -267,7 +268,6 @@ or `user'}}}
\fi}
\let\abalphnum=\@abalph
-
\newcommand{\@ABAlph}[1]{%
\ifnum#1>17576
\PackageError{fmtcount}{Value of counter too large for \protect\@ABAlph}{Maximum value 17576}
@@ -291,30 +291,23 @@ or `user'}}}
\fi}
\let\ABAlphnum=\@ABAlph
-
-\newcommand{\@decimal}[1]{%
-\ifnum#1>10000
-\PackageError{fmtcount}{Value of counter too large for \protect\@decimal}{Maximum value 10000}\number#1\relax
+\def\@fmtc@count#1#2\relax{%
+\if\relax#1
\else
-\@DT@padzeroestrue
-\@DT@loopN=6\relax
-\@strctr=\@DT@loopN
-\whiledo{\(\@strctr<\c@padzeroesN\) \TE@or \(\@strctr=\c@padzeroesN\)}{0\advance\@strctr by 1}%
-\@strctr=10000\relax
-\@DT@X=#1\relax
-\loop
-\@DT@modctr=\@DT@X
-\divide\@DT@modctr by \@strctr
-\ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\the\@DT@modctr}%
-\ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi
-\multiply\@DT@modctr by \@strctr
-\advance\@DT@X by -\@DT@modctr
-\divide\@strctr by 10\relax
-\advance\@DT@loopN by -1\relax
-\ifnum\@strctr>1
-\repeat
-\the\@DT@X
+\advance\@strctr by 1\relax
+\@fmtc@count#2\relax
\fi}
+\newcommand{\@decimal}[1]{%
+\@strctr=0\relax
+\expandafter\@fmtc@count\number#1\relax
+\@DT@loopN=\c@padzeroesN
+\advance\@DT@loopN by -\@strctr
+\ifnum\@DT@loopN>0\relax
+\@strctr=0\relax
+\whiledo{\@strctr < \@DT@loopN}{0\advance\@strctr by 1}%
+\fi
+\number#1\relax
+}
\let\decimalnum=\@decimal
\newcommand{\FCordinal}[1]{%
@@ -416,9 +409,8 @@ Available options are m or f}}%
\def\@ordinalM{\@ordinalMenglish}
\let\@ordinalF=\@ordinalM}
-\@ifundefined{languagename}{%
-\@setdef@ultfmtcount}{
-\ifthenelse{\equal{\languagename}{nohyphenation}}{\@setdef@ultfmtcount}{
+\@ifpackageloaded{babel}{
+\ifthenelse{\equal{\languagename}{nohyphenation}\or\equal{languagename}{english}}{\@setdef@ultfmtcount}{
\def\@numberstringM{\@ifundefined{@numberstringM\languagename}{%
\PackageError{fmtcount}{No support for language '\languagename'}{%
The fmtcount package currently does not support language
@@ -478,7 +470,8 @@ The fmtcount package currently does not support language
The fmtcount package currently does not support language
'\languagename' for command \string\@OrdinalstringF}}{%
\csname @OrdinalstringF\languagename\endcsname}}
-}}
+}}{%
+\@setdef@ultfmtcount}
\let\@ordinal=\@ordinalM
\let\@ordinalstring=\@ordinalstringM
\let\@Ordinalstring=\@OrdinalstringM