[2734] | 1 | %% |
---|
| 2 | %% This is file `fmtcount.sty', |
---|
| 3 | %% generated with the docstrip utility. |
---|
| 4 | %% |
---|
| 5 | %% The original source files were: |
---|
| 6 | %% |
---|
| 7 | %% fmtcount.dtx (with options: `fmtcount.sty,package') |
---|
| 8 | %% Copyright (C) 2005 Nicola Talbot, all rights reserved. |
---|
| 9 | %% If you modify this file, you must change its name first. |
---|
| 10 | %% You are NOT ALLOWED to distribute this file alone. You are NOT |
---|
| 11 | %% ALLOWED to take money for the distribution or use of either this |
---|
| 12 | %% file or a changed version, except for a nominal charge for copying |
---|
| 13 | %% etc. |
---|
| 14 | %% \CharacterTable |
---|
| 15 | %% {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 |
---|
| 16 | %% Lower-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 |
---|
| 17 | %% Digits \0\1\2\3\4\5\6\7\8\9 |
---|
| 18 | %% Exclamation \! Double quote \" Hash (number) \# |
---|
| 19 | %% Dollar \$ Percent \% Ampersand \& |
---|
| 20 | %% Acute accent \' Left paren \( Right paren \) |
---|
| 21 | %% Asterisk \* Plus \+ Comma \, |
---|
| 22 | %% Minus \- Point \. Solidus \/ |
---|
| 23 | %% Colon \: Semicolon \; Less than \< |
---|
| 24 | %% Equals \= Greater than \> Question mark \? |
---|
| 25 | %% Commercial at \@ Left bracket \[ Backslash \\ |
---|
| 26 | %% Right bracket \] Circumflex \^ Underscore \_ |
---|
| 27 | %% Grave accent \` Left brace \{ Vertical bar \| |
---|
| 28 | %% Right brace \} Tilde \~} |
---|
| 29 | \NeedsTeXFormat{LaTeX2e} |
---|
| 30 | \ProvidesPackage{fmtcount}[2005/06/20 v1.03] |
---|
| 31 | \RequirePackage{ifthen} |
---|
| 32 | \RequirePackage{keyval} |
---|
| 33 | \providecommand{\fmtord}[1]{\textsuperscript{#1}} |
---|
| 34 | |
---|
| 35 | \newcount\c@padzeroesN |
---|
| 36 | \c@padzeroesN=1\relax |
---|
| 37 | \providecommand{\padzeroes}[1][17]{\c@padzeroesN=#1} |
---|
| 38 | \@ifundefined{dateenglish}{}{\input{fc-english.def}} |
---|
| 39 | \@ifundefined{datespanish}{}{\input{fc-spanish.def}} |
---|
| 40 | \@ifundefined{dateportuges}{}{\input{fc-portuges.def}} |
---|
| 41 | \@ifundefined{datefrench}{}{\input{fc-french.def}} |
---|
| 42 | \def\fmtcount@french{france} |
---|
| 43 | \define@key{fmtcount}{french}[france]{% |
---|
| 44 | \@ifundefined{datefrench}{% |
---|
| 45 | \PackageError{fmtcount}{Language `french' not defined}{You need |
---|
| 46 | to load babel before loading fmtcount}}{ |
---|
| 47 | \ifthenelse{\equal{#1}{france} |
---|
| 48 | \or\equal{#1}{swiss} |
---|
| 49 | \or\equal{#1}{belgian}}{% |
---|
| 50 | \def\fmtcount@french{#1}}{% |
---|
| 51 | \PackageError{fmtcount}{Invalid value `#1' to french key} |
---|
| 52 | {Option `french' can only take the values `france', |
---|
| 53 | `belgian' or `swiss'}} |
---|
| 54 | }} |
---|
| 55 | |
---|
| 56 | \define@key{fmtcount}{fmtord}{% |
---|
| 57 | \ifthenelse{\equal{#1}{level} |
---|
| 58 | \or\equal{#1}{raise} |
---|
| 59 | \or\equal{#1}{user}}{ |
---|
| 60 | \def\fmtcount@fmtord{#1}}{% |
---|
| 61 | \PackageError{fmtcount}{Invalid value `#1' to fmtord key} |
---|
| 62 | {Option `fmtord' can only take the values `level', `raise' |
---|
| 63 | or `user'}}} |
---|
| 64 | |
---|
| 65 | \newif\iffmtord@abbrv |
---|
| 66 | \fmtord@abbrvfalse |
---|
| 67 | \define@key{fmtcount}{abbrv}[true]{% |
---|
| 68 | \ifthenelse{\equal{#1}{true}\or\equal{#1}{false}}{ |
---|
| 69 | \csname fmtord@abbrv#1\endcsname}{% |
---|
| 70 | \PackageError{fmtcount}{Invalid value `#1' to fmtord key} |
---|
| 71 | {Option `fmtord' can only take the values `true' or |
---|
| 72 | `false'}}} |
---|
| 73 | |
---|
| 74 | \newcommand{\fmtcountsetoptions}[1]{% |
---|
| 75 | \def\fmtcount@fmtord{}% |
---|
| 76 | \setkeys{fmtcount}{#1}% |
---|
| 77 | \@ifundefined{datefrench}{}{% |
---|
| 78 | \edef\@ordinalstringMfrench{\noexpand\csname @ordinalstringMfrench\fmtcount@french\noexpand\endcsname}% |
---|
| 79 | \edef\@ordinalstringFfrench{\noexpand\csname @ordinalstringFfrench\fmtcount@french\noexpand\endcsname}% |
---|
| 80 | \edef\@OrdinalstringMfrench{\noexpand\csname @OrdinalstringMfrench\fmtcount@french\noexpand\endcsname}% |
---|
| 81 | \edef\@OrdinalstringFfrench{\noexpand\csname @OrdinalstringFfrench\fmtcount@french\noexpand\endcsname}% |
---|
| 82 | \edef\@numberstringMfrench{\noexpand\csname @numberstringMfrench\fmtcount@french\noexpand\endcsname}% |
---|
| 83 | \edef\@numberstringFfrench{\noexpand\csname @numberstringFfrench\fmtcount@french\noexpand\endcsname}% |
---|
| 84 | \edef\@NumberstringMfrench{\noexpand\csname @NumberstringMfrench\fmtcount@french\noexpand\endcsname}% |
---|
| 85 | \edef\@NumberstringFfrench{\noexpand\csname @NumberstringFfrench\fmtcount@french\noexpand\endcsname}% |
---|
| 86 | }% |
---|
| 87 | \ifthenelse{\equal{\fmtcount@fmtord}{level}}{% |
---|
| 88 | \renewcommand{\fmtord}[1]{##1}}{% |
---|
| 89 | \ifthenelse{\equal{\fmtcount@fmtord}{raise}}{% |
---|
| 90 | \renewcommand{\fmtord}[1]{\textsuperscript{##1}}}{% |
---|
| 91 | }} |
---|
| 92 | } |
---|
| 93 | \InputIfFileExists{fmtcount.cfg}{% |
---|
| 94 | \typeout{Using configuration file fmtcount.cfg}}{% |
---|
| 95 | \typeout{No configuration file fmtcount.cfg found.}} |
---|
| 96 | \DeclareOption{level}{\def\fmtcount@fmtord{level}% |
---|
| 97 | \def\fmtord#1{#1}} |
---|
| 98 | \DeclareOption{raise}{\def\fmtcount@fmtord{raise}% |
---|
| 99 | \def\fmtord#1{\textsuperscript{#1}}} |
---|
| 100 | |
---|
| 101 | \ProcessOptions |
---|
| 102 | |
---|
| 103 | \newcount\@DT@modctr |
---|
| 104 | \def\@modulo#1#2{% |
---|
| 105 | \@DT@modctr=#1\relax |
---|
| 106 | \divide \@DT@modctr by #2\relax |
---|
| 107 | \multiply \@DT@modctr by #2\relax |
---|
| 108 | \advance #1 by -\@DT@modctr} |
---|
| 109 | \newcount\@ordinalctr |
---|
| 110 | \newcount\@orgargctr |
---|
| 111 | \newcount\@strctr |
---|
| 112 | \newcount\@tmpstrctr |
---|
| 113 | \newif\if@DT@padzeroes |
---|
| 114 | \newcount\@DT@loopN |
---|
| 115 | \newcount\@DT@X |
---|
| 116 | \newcommand{\@binary}[1]{% |
---|
| 117 | \@DT@padzeroestrue |
---|
| 118 | \@DT@loopN=17\relax |
---|
| 119 | \@strctr=\@DT@loopN |
---|
| 120 | \whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by 1}% |
---|
| 121 | \@strctr=65536\relax |
---|
| 122 | \@DT@X=#1\relax |
---|
| 123 | \loop |
---|
| 124 | \@DT@modctr=\@DT@X |
---|
| 125 | \divide\@DT@modctr by \@strctr |
---|
| 126 | \ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\the\@DT@modctr}% |
---|
| 127 | \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi |
---|
| 128 | \multiply\@DT@modctr by \@strctr |
---|
| 129 | \advance\@DT@X by -\@DT@modctr |
---|
| 130 | \divide\@strctr by 2\relax |
---|
| 131 | \advance\@DT@loopN by -1\relax |
---|
| 132 | \ifnum\@strctr>1 |
---|
| 133 | \repeat |
---|
| 134 | \the\@DT@X} |
---|
| 135 | |
---|
| 136 | \let\binarynum=\@binary |
---|
| 137 | \newcommand{\@octal}[1]{% |
---|
| 138 | \ifnum#1>32768 |
---|
| 139 | \PackageError{fmtcount}{Value of counter too large for \protect\@octal}{Maximum value 32768} |
---|
| 140 | \else |
---|
| 141 | \@DT@padzeroestrue |
---|
| 142 | \@DT@loopN=6\relax |
---|
| 143 | \@strctr=\@DT@loopN |
---|
| 144 | \whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by 1}% |
---|
| 145 | \@strctr=32768\relax |
---|
| 146 | \@DT@X=#1\relax |
---|
| 147 | \loop |
---|
| 148 | \@DT@modctr=\@DT@X |
---|
| 149 | \divide\@DT@modctr by \@strctr |
---|
| 150 | \ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\the\@DT@modctr}% |
---|
| 151 | \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi |
---|
| 152 | \multiply\@DT@modctr by \@strctr |
---|
| 153 | \advance\@DT@X by -\@DT@modctr |
---|
| 154 | \divide\@strctr by 8\relax |
---|
| 155 | \advance\@DT@loopN by -1\relax |
---|
| 156 | \ifnum\@strctr>1 |
---|
| 157 | \repeat |
---|
| 158 | \the\@DT@X |
---|
| 159 | \fi} |
---|
| 160 | \let\octalnum=\@octal |
---|
| 161 | \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} |
---|
| 162 | |
---|
| 163 | \newcommand{\@hexadecimal}[1]{% |
---|
| 164 | \@DT@padzeroestrue |
---|
| 165 | \@DT@loopN=5\relax |
---|
| 166 | \@strctr=\@DT@loopN |
---|
| 167 | \whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by 1}% |
---|
| 168 | \@strctr=65536\relax |
---|
| 169 | \@DT@X=#1\relax |
---|
| 170 | \loop |
---|
| 171 | \@DT@modctr=\@DT@X |
---|
| 172 | \divide\@DT@modctr by \@strctr |
---|
| 173 | \ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\@@hexadecimal\@DT@modctr}% |
---|
| 174 | \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi |
---|
| 175 | \multiply\@DT@modctr by \@strctr |
---|
| 176 | \advance\@DT@X by -\@DT@modctr |
---|
| 177 | \divide\@strctr by 16\relax |
---|
| 178 | \advance\@DT@loopN by -1\relax |
---|
| 179 | \ifnum\@strctr>1 |
---|
| 180 | \repeat |
---|
| 181 | \@@hexadecimal\@DT@X} |
---|
| 182 | |
---|
| 183 | \let\hexadecimalnum=\@hexadecimal |
---|
| 184 | |
---|
| 185 | \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} |
---|
| 186 | |
---|
| 187 | \newcommand{\@Hexadecimal}[1]{% |
---|
| 188 | \@DT@padzeroestrue |
---|
| 189 | \@DT@loopN=5\relax |
---|
| 190 | \@strctr=\@DT@loopN |
---|
| 191 | \whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by 1}% |
---|
| 192 | \@strctr=65536\relax |
---|
| 193 | \@DT@X=#1\relax |
---|
| 194 | \loop |
---|
| 195 | \@DT@modctr=\@DT@X |
---|
| 196 | \divide\@DT@modctr by \@strctr |
---|
| 197 | \ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\@@Hexadecimal\@DT@modctr}% |
---|
| 198 | \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi |
---|
| 199 | \multiply\@DT@modctr by \@strctr |
---|
| 200 | \advance\@DT@X by -\@DT@modctr |
---|
| 201 | \divide\@strctr by 16\relax |
---|
| 202 | \advance\@DT@loopN by -1\relax |
---|
| 203 | \ifnum\@strctr>1 |
---|
| 204 | \repeat |
---|
| 205 | \@@Hexadecimal\@DT@X} |
---|
| 206 | |
---|
| 207 | \let\Hexadecimalnum=\@Hexadecimal |
---|
| 208 | \newcommand{\@aaalph}[1]{% |
---|
| 209 | \@DT@loopN=#1\relax |
---|
| 210 | \advance\@DT@loopN by -1\relax |
---|
| 211 | \divide\@DT@loopN by 26\relax |
---|
| 212 | \@DT@modctr=\@DT@loopN |
---|
| 213 | \multiply\@DT@modctr by 26\relax |
---|
| 214 | \@DT@X=#1\relax |
---|
| 215 | \advance\@DT@X by -1\relax |
---|
| 216 | \advance\@DT@X by -\@DT@modctr |
---|
| 217 | \advance\@DT@loopN by 1\relax |
---|
| 218 | \advance\@DT@X by 1\relax |
---|
| 219 | \loop |
---|
| 220 | \@alph\@DT@X |
---|
| 221 | \advance\@DT@loopN by -1\relax |
---|
| 222 | \ifnum\@DT@loopN>0 |
---|
| 223 | \repeat |
---|
| 224 | } |
---|
| 225 | |
---|
| 226 | \let\aaalphnum=\@aaalph |
---|
| 227 | |
---|
| 228 | \newcommand{\@AAAlph}[1]{% |
---|
| 229 | \@DT@loopN=#1\relax |
---|
| 230 | \advance\@DT@loopN by -1\relax |
---|
| 231 | \divide\@DT@loopN by 26\relax |
---|
| 232 | \@DT@modctr=\@DT@loopN |
---|
| 233 | \multiply\@DT@modctr by 26\relax |
---|
| 234 | \@DT@X=#1\relax |
---|
| 235 | \advance\@DT@X by -1\relax |
---|
| 236 | \advance\@DT@X by -\@DT@modctr |
---|
| 237 | \advance\@DT@loopN by 1\relax |
---|
| 238 | \advance\@DT@X by 1\relax |
---|
| 239 | \loop |
---|
| 240 | \@Alph\@DT@X |
---|
| 241 | \advance\@DT@loopN by -1\relax |
---|
| 242 | \ifnum\@DT@loopN>0 |
---|
| 243 | \repeat |
---|
| 244 | } |
---|
| 245 | |
---|
| 246 | \let\AAAlphnum=\@AAAlph |
---|
| 247 | \newcommand{\@abalph}[1]{% |
---|
| 248 | \ifnum#1>17576 |
---|
| 249 | \PackageError{fmtcount}{Value of counter too large for \protect\@abalph}{Maximum value 17576} |
---|
| 250 | \else |
---|
| 251 | \@DT@padzeroestrue |
---|
| 252 | \@strctr=17576\relax |
---|
| 253 | \@DT@X=#1\relax |
---|
| 254 | \advance\@DT@X by -1\relax |
---|
| 255 | \loop |
---|
| 256 | \@DT@modctr=\@DT@X |
---|
| 257 | \divide\@DT@modctr by \@strctr |
---|
| 258 | \ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=1\)}{}{\@alph\@DT@modctr}% |
---|
| 259 | \ifnum\@DT@modctr=1\else\@DT@padzeroesfalse\fi |
---|
| 260 | \multiply\@DT@modctr by \@strctr |
---|
| 261 | \advance\@DT@X by -\@DT@modctr |
---|
| 262 | \divide\@strctr by 26\relax |
---|
| 263 | \ifnum\@strctr>1 |
---|
| 264 | \repeat |
---|
| 265 | \advance\@DT@X by 1\relax |
---|
| 266 | \@alph\@DT@X |
---|
| 267 | \fi} |
---|
| 268 | |
---|
| 269 | \let\abalphnum=\@abalph |
---|
| 270 | |
---|
| 271 | \newcommand{\@ABAlph}[1]{% |
---|
| 272 | \ifnum#1>17576 |
---|
| 273 | \PackageError{fmtcount}{Value of counter too large for \protect\@ABAlph}{Maximum value 17576} |
---|
| 274 | \else |
---|
| 275 | \@DT@padzeroestrue |
---|
| 276 | \@strctr=17576\relax |
---|
| 277 | \@DT@X=#1\relax |
---|
| 278 | \advance\@DT@X by -1\relax |
---|
| 279 | \loop |
---|
| 280 | \@DT@modctr=\@DT@X |
---|
| 281 | \divide\@DT@modctr by \@strctr |
---|
| 282 | \ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=1\)}{}{\@Alph\@DT@modctr}% |
---|
| 283 | \ifnum\@DT@modctr=1\else\@DT@padzeroesfalse\fi |
---|
| 284 | \multiply\@DT@modctr by \@strctr |
---|
| 285 | \advance\@DT@X by -\@DT@modctr |
---|
| 286 | \divide\@strctr by 26\relax |
---|
| 287 | \ifnum\@strctr>1 |
---|
| 288 | \repeat |
---|
| 289 | \advance\@DT@X by 1\relax |
---|
| 290 | \@Alph\@DT@X |
---|
| 291 | \fi} |
---|
| 292 | |
---|
| 293 | \let\ABAlphnum=\@ABAlph |
---|
| 294 | |
---|
| 295 | \newcommand{\@decimal}[1]{% |
---|
| 296 | \ifnum#1>10000 |
---|
| 297 | \PackageError{fmtcount}{Value of counter too large for \protect\@decimal}{Maximum value 10000}\number#1\relax |
---|
| 298 | \else |
---|
| 299 | \@DT@padzeroestrue |
---|
| 300 | \@DT@loopN=6\relax |
---|
| 301 | \@strctr=\@DT@loopN |
---|
| 302 | \whiledo{\(\@strctr<\c@padzeroesN\) \TE@or \(\@strctr=\c@padzeroesN\)}{0\advance\@strctr by 1}% |
---|
| 303 | \@strctr=10000\relax |
---|
| 304 | \@DT@X=#1\relax |
---|
| 305 | \loop |
---|
| 306 | \@DT@modctr=\@DT@X |
---|
| 307 | \divide\@DT@modctr by \@strctr |
---|
| 308 | \ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\the\@DT@modctr}% |
---|
| 309 | \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi |
---|
| 310 | \multiply\@DT@modctr by \@strctr |
---|
| 311 | \advance\@DT@X by -\@DT@modctr |
---|
| 312 | \divide\@strctr by 10\relax |
---|
| 313 | \advance\@DT@loopN by -1\relax |
---|
| 314 | \ifnum\@strctr>1 |
---|
| 315 | \repeat |
---|
| 316 | \the\@DT@X |
---|
| 317 | \fi} |
---|
| 318 | |
---|
| 319 | \let\decimalnum=\@decimal |
---|
| 320 | \newcommand{\ordinal}[1]{% |
---|
| 321 | \expandafter\protect\expandafter\ordinalnum{% |
---|
| 322 | \expandafter\the\csname c@#1\endcsname}} |
---|
| 323 | |
---|
| 324 | \newcommand{\ordinalnum}[1]{\@ifnextchar[{\@ordinalnum{#1}}{% |
---|
| 325 | \@ordinalnum{#1}[m]}} |
---|
| 326 | |
---|
| 327 | \def\@ordinalnum#1[#2]{% |
---|
| 328 | \ifthenelse{\equal{#2}{f}}{% |
---|
| 329 | \protect\@ordinalF{#1}}{% |
---|
| 330 | \ifthenelse{\equal{#2}{m}}{}{% |
---|
| 331 | \PackageError{fmtcount}{Invalid gender option `#2' to |
---|
| 332 | \string\ordinal}{Available options are m or f}}% |
---|
| 333 | \protect\@ordinalM{#1}}} |
---|
| 334 | |
---|
| 335 | \newcommand{\ordinalstring}[1]{% |
---|
| 336 | \expandafter\protect\expandafter\ordinalstringnum{% |
---|
| 337 | \expandafter\the\csname c@#1\endcsname}} |
---|
| 338 | |
---|
| 339 | \newcommand{\ordinalstringnum}[1]{% |
---|
| 340 | \@ifnextchar[{\@ordinal@string{#1}}{\@ordinal@string{#1}[m]}} |
---|
| 341 | |
---|
| 342 | \def\@ordinal@string#1[#2]{% |
---|
| 343 | \ifthenelse{\equal{#2}{f}}{% |
---|
| 344 | \protect\@ordinalstringF{#1}}{% |
---|
| 345 | \ifthenelse{\equal{#2}{m}}{}{% |
---|
| 346 | \PackageError{fmtcount}{Invalid gender option `#2' to |
---|
| 347 | \string\ordinalstring}{Available options are m or f}}% |
---|
| 348 | \protect\@ordinalstringM{#1}}} |
---|
| 349 | |
---|
| 350 | \newcommand{\Ordinalstring}[1]{% |
---|
| 351 | \expandafter\protect\expandafter\Ordinalstringnum{% |
---|
| 352 | \expandafter\the\csname c@#1\endcsname}} |
---|
| 353 | |
---|
| 354 | \newcommand{\Ordinalstringnum}[1]{% |
---|
| 355 | \@ifnextchar[{\@Ordinal@string{#1}}{\@Ordinal@string{#1}[m]}} |
---|
| 356 | |
---|
| 357 | \def\@Ordinal@string#1[#2]{% |
---|
| 358 | \ifthenelse{\equal{#2}{f}}{% |
---|
| 359 | \protect\@OrdinalstringF{#1}}{% |
---|
| 360 | \ifthenelse{\equal{#2}{m}}{}{% |
---|
| 361 | \PackageError{fmtcount}{Invalid gender option `#2' to |
---|
| 362 | \string\Ordinalstring}{Available options are m or f}}% |
---|
| 363 | \protect\@OrdinalstringM{#1}}} |
---|
| 364 | |
---|
| 365 | \newcommand{\numberstring}[1]{% |
---|
| 366 | \expandafter\protect\expandafter\numberstringnum{% |
---|
| 367 | \expandafter\the\csname c@#1\endcsname}} |
---|
| 368 | |
---|
| 369 | \newcommand{\numberstringnum}[1]{% |
---|
| 370 | \@ifnextchar[{\@number@string{#1}}{\@number@string{#1}[m]}} |
---|
| 371 | |
---|
| 372 | \def\@number@string#1[#2]{% |
---|
| 373 | \ifthenelse{\equal{#2}{f}}{% |
---|
| 374 | \protect\@numberstringF{#1}}{% |
---|
| 375 | \ifthenelse{\equal{#2}{m}}{}{% |
---|
| 376 | \PackageError{fmtcount}{Invalid gender option `#2' to |
---|
| 377 | \string\numberstring}{Available options are m or f}}% |
---|
| 378 | \protect\@numberstringM{#1}}} |
---|
| 379 | |
---|
| 380 | \newcommand{\Numberstring}[1]{% |
---|
| 381 | \expandafter\protect\expandafter\Numberstringnum{% |
---|
| 382 | \expandafter\the\csname c@#1\endcsname}} |
---|
| 383 | |
---|
| 384 | \newcommand{\Numberstringnum}[1]{% |
---|
| 385 | \@ifnextchar[{\@Number@string{#1}}{\@Number@string{#1}[m]}} |
---|
| 386 | |
---|
| 387 | \def\@Number@string#1[#2]{% |
---|
| 388 | \ifthenelse{\equal{#2}{f}}{% |
---|
| 389 | \protect\@NumberstringF{#1}}{% |
---|
| 390 | \ifthenelse{\equal{#2}{m}}{}{% |
---|
| 391 | \PackageError{fmtcount}{Invalid gender option `#2' to |
---|
| 392 | \string\Numberstring}{Available options are m or f}}% |
---|
| 393 | \protect\@NumberstringM{#1}}} |
---|
| 394 | |
---|
| 395 | \providecommand{\binary}[1]{\expandafter\protect\expandafter\@binary{\expandafter\the\csname c@#1\endcsname}} |
---|
| 396 | \providecommand{\aaalph}[1]{\expandafter\protect\expandafter\@aaalph{\expandafter\the\csname c@#1\endcsname}} |
---|
| 397 | \providecommand{\AAAlph}[1]{\expandafter\protect\expandafter\@AAAlph{\expandafter\the\csname c@#1\endcsname}} |
---|
| 398 | \providecommand{\abalph}[1]{\expandafter\protect\expandafter\@abalph{\expandafter\the\csname c@#1\endcsname}} |
---|
| 399 | \providecommand{\ABAlph}[1]{\expandafter\protect\expandafter\@ABAlph{\expandafter\the\csname c@#1\endcsname}} |
---|
| 400 | \providecommand{\hexadecimal}[1]{\expandafter\protect\expandafter\@hexadecimal{\expandafter\the\csname c@#1\endcsname}} |
---|
| 401 | \providecommand{\Hexadecimal}[1]{\expandafter\protect\expandafter\@Hexadecimal{\expandafter\the\csname c@#1\endcsname}} |
---|
| 402 | \providecommand{\octal}[1]{\expandafter\protect\expandafter\@octal{\expandafter\the\csname c@#1\endcsname}} |
---|
| 403 | \providecommand{\decimal}[1]{\expandafter\protect\expandafter\@decimal{\expandafter\the\csname c@#1\endcsname}} |
---|
| 404 | \def\@setdef@ultfmtcount{ |
---|
| 405 | \@ifundefined{@ordinalenglish}{\input{fc-english.def}}{} |
---|
| 406 | \def\@ordinalstringM{\@ordinalstringMenglish} |
---|
| 407 | \let\@ordinalstringF=\@ordinalstringMenglish |
---|
| 408 | \def\@OrdinalstringM{\@OrdinalstringMenglish} |
---|
| 409 | \let\@OrdinalstringF=\@OrdinalstringMenglish |
---|
| 410 | \def\@numberstringM{\@numberstringMenglish} |
---|
| 411 | \let\@numberstringF=\@numberstringMenglish |
---|
| 412 | \def\@NumberstringM{\@NumberstringMenglish} |
---|
| 413 | \let\@NumberstringF=\@NumberstringMenglish |
---|
| 414 | \def\@ordinalM{\@ordinalMenglish} |
---|
| 415 | \let\@ordinalF=\@ordinalM} |
---|
| 416 | |
---|
| 417 | \@ifundefined{languagename}{% |
---|
| 418 | \@setdef@ultfmtcount}{ |
---|
| 419 | \ifthenelse{\equal{\languagename}{nohyphenation}}{\@setdef@ultfmtcount}{ |
---|
| 420 | \def\@numberstringM{\@ifundefined{@numberstringM\languagename}{% |
---|
| 421 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 422 | The fmtcount package currently does not support language |
---|
| 423 | '\languagename' for command \string\@numberstringM}}{% |
---|
| 424 | \csname @numberstringM\languagename\endcsname}} |
---|
| 425 | |
---|
| 426 | \def\@numberstringF{\@ifundefined{@numberstringF\languagename}{% |
---|
| 427 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 428 | The fmtcount package currently does not support language |
---|
| 429 | '\languagename' for command \string\@numberstringF}}{% |
---|
| 430 | \csname @numberstringF\languagename\endcsname}} |
---|
| 431 | |
---|
| 432 | \def\@NumberstringM{\@ifundefined{@NumberstringM\languagename}{% |
---|
| 433 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 434 | The fmtcount package currently does not support language |
---|
| 435 | '\languagename' for command \string\@NumberstringM}}{% |
---|
| 436 | \csname @NumberstringM\languagename\endcsname}} |
---|
| 437 | |
---|
| 438 | \def\@NumberstringF{\@ifundefined{@NumberstringF\languagename}{% |
---|
| 439 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 440 | The fmtcount package currently does not support language |
---|
| 441 | '\languagename' for command \string\@NumberstringF}}{% |
---|
| 442 | \csname @NumberstringF\languagename\endcsname}} |
---|
| 443 | |
---|
| 444 | \def\@ordinalM{\@ifundefined{@ordinalM\languagename}{% |
---|
| 445 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 446 | The fmtcount package currently does not support language |
---|
| 447 | '\languagename' for command \string\@ordinalM}}{% |
---|
| 448 | \csname @ordinalM\languagename\endcsname}} |
---|
| 449 | |
---|
| 450 | \def\@ordinalF{\@ifundefined{@ordinalF\languagename}{% |
---|
| 451 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 452 | The fmtcount package currently does not support language |
---|
| 453 | '\languagename' for command \string\@ordinalF}}{% |
---|
| 454 | \csname @ordinalF\languagename\endcsname}} |
---|
| 455 | |
---|
| 456 | \def\@ordinalstringM{\@ifundefined{@ordinalstringM\languagename}{% |
---|
| 457 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 458 | The fmtcount package currently does not support language |
---|
| 459 | '\languagename' for command \string\@ordinalstringM}}{% |
---|
| 460 | \csname @ordinalstringM\languagename\endcsname}} |
---|
| 461 | |
---|
| 462 | \def\@ordinalstringF{\@ifundefined{@ordinalstringF\languagename}{% |
---|
| 463 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 464 | The fmtcount package currently does not support language |
---|
| 465 | '\languagename' for command \string\@ordinalstringF}}{% |
---|
| 466 | \csname @ordinalstringF\languagename\endcsname}} |
---|
| 467 | |
---|
| 468 | \def\@OrdinalstringM{\@ifundefined{@OrdinalstringM\languagename}{% |
---|
| 469 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 470 | The fmtcount package currently does not support language |
---|
| 471 | '\languagename' for command \string\@OrdinalstringM}}{% |
---|
| 472 | \csname @OrdinalstringM\languagename\endcsname}} |
---|
| 473 | |
---|
| 474 | \def\@OrdinalstringF{\@ifundefined{@OrdinalstringF\languagename}{% |
---|
| 475 | \PackageError{fmtcount}{No support for language '\languagename'}{% |
---|
| 476 | The fmtcount package currently does not support language |
---|
| 477 | '\languagename' for command \string\@OrdinalstringF}}{% |
---|
| 478 | \csname @OrdinalstringF\languagename\endcsname}} |
---|
| 479 | }} |
---|
| 480 | \let\@ordinal=\@ordinalM |
---|
| 481 | \let\@ordinalstring=\@ordinalstringM |
---|
| 482 | \let\@Ordinalstring=\@OrdinalstringM |
---|
| 483 | \let\@numberstring=\@numberstringM |
---|
| 484 | \let\@Numberstring=\@NumberstringM |
---|
| 485 | \endinput |
---|
| 486 | %% |
---|
| 487 | %% End of file `fmtcount.sty'. |
---|