Debian Codegraph @

texmf-dist/source/latex/fmtcount/fmtcount.dtx

raw
1 %\iffalse
2 % fmtcount.dtx generated using makedtx version 1.2 (c) Nicola Talbot
3 % Command line args:
4 % -doc "fmtcount-manual.tex"
5 % -author "Nicola Talbot (inactive), Vincent Belaïche and Erik Nijenhuis"
6 % -src "(.+)\.(sty|def)$=>\1.\2"
7 % -setambles "(.*)\.(sty|def)=>\nopreamble\usepreamble\defaultpreamble"
8 % fmtcount
9 % Created on 2025/12/2 17:04
10 %\fi
11 %\iffalse
12 %<*package>
13 %% \CharacterTable
14 %% {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
15 %% 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
16 %% Digits \0\1\2\3\4\5\6\7\8\9
17 %% Exclamation \! Double quote \" Hash (number) \#
18 %% Dollar \$ Percent \% Ampersand \&
19 %% Acute accent \' Left paren \( Right paren \)
20 %% Asterisk \* Plus \+ Comma \,
21 %% Minus \- Point \. Solidus \/
22 %% Colon \: Semicolon \; Less than \<
23 %% Equals \= Greater than \> Question mark \?
24 %% Commercial at \@ Left bracket \[ Backslash \\
25 %% Right bracket \] Circumflex \^ Underscore \_
26 %% Grave accent \` Left brace \{ Vertical bar \|
27 %% Right brace \} Tilde \~}
28 %</package>
29 %\fi
30 % \iffalse
31 % Doc-Source file to use with LaTeX2e
32 % Copyright (C) 2025 Nicola Talbot (inactive), Vincent Belaïche and Erik Nijenhuis, all rights reserved.
33 % \fi
34 % \iffalse
35 %<*driver>
36 \documentclass{nlctdoc}
37 \usepackage{array}[=v2.5]
38
39 \usepackage{color}
40 \usepackage[utf8]{inputenc}
41 \usepackage[french,english]{babel}
42 \usepackage{amsmath,amssymb}
43 \usepackage{tabularx,supertabular,multirow}
44 \usepackage[T1]{fontenc}
45 \usepackage{cmap}
46 \usepackage{fmtcount}% needed for \fc@iterate@on@languages
47 \newcommand*\uref[1]{\href{#1}{#1}}
48 \DeclareMathOperator{\intv}{..}
49 \newcommand*\interface{}
50 \makeatletter
51 \newcommand*{\LanguagePackageOptionList}{{%
52 \def\@tempf##1{\texttt{##1}}% how to format each option
53 % we don't use \cs{newtoks} because anyway this is within a group
54 \toks0{}% token in which we accumulate result
55 % \toks1 token in which we place next dialect
56 \count0 0 % to distinguish first and second iteration, we need to do tricks because we want to insert `and'
57 % before the last item in the list.
58 \def\@tempb##1{%
59 \ifnum\count0=0 %
60 \else\ifnum\count0=1 %
61 \toks0\toks1 %
62 \else
63 \edef\@tempa{\the\toks0, \the\toks1}%
64 \toks0\expandafter{\@tempa}%
65 \fi\fi
66 \toks1\expandafter{\@tempf{##1}}%
67 \advance\count0 by 1 %
68 }%
69 \fc@iterate@on@languages\@tempb
70 \edef\@tempa{\the\toks0, and \the\toks1}%
71 \expandafter
72 }\@tempa}
73 \makeatother
74
75 \usepackage[colorlinks,
76 bookmarks,
77 bookmarksopen,
78 pdfauthor={Nicola L.C. Talbot, Vincent Belaïche and Erik Nijenhuis},
79 pdftitle={fmtcount.sty: Displaying the Values of LaTeX Counters},
80 pdfkeywords={LaTeX,counter}]{hyperref}
81
82 \doxitem{Option}{option}{options}
83
84 \newlength{\tabcolwidth}
85 \newlength{\coliwidth}
86 \newcommand*\cnab{\centering\arraybackslash}
87 \newcommand*\ColIRI[1]{}
88 \csname @ifpackageloaded\endcsname{tex4ht}{%
89 \newcommand*\ColIRII[1]{\parbox{\coliwidth}{\cnab #1}}
90 }{%
91 \newcommand*\ColIRII[1]{\multirow{-2}{\coliwidth}{\cnab #1}}
92 }
93
94 \begin{document}
95 \DocInput{fmtcount.dtx}
96 \end{document}
97 %</driver>
98 %\fi
99 %\RecordChanges
100 % \title{fmtcount.sty: Displaying the Values of
101 %\LaTeX\ Counters}
102 % \author{Nicola L.C. Talbot\\
103 % \href{https://www.dickimaw-books.com}{dickimaw-books.com}
104 % \and
105 % Vincent Bela\"iche
106 % \and
107 % Erik Nijenhuis\\
108 % \href{https://github.com/Xerdi/fmtcount}{github.com/Xerdi/fmtcount}}
109 % \date{2025-12-02 (version 3.12)\relax
110 %}
111 % \maketitle
112 % \tableofcontents
113 % \section{Introduction}
114 %
115 %The \styfmt{fmtcount} package provides commands to display
116 %the values of \LaTeX\ counters in a variety of formats. It also
117 %provides equivalent commands for actual numbers rather than
118 %counter names. Limited multilingual support is available.
119 %Currently, there is only support for English, French (including
120 %Belgian and Swiss variations), Spanish, Portuguese, German and
121 %Italian.
122 %
123 %\section{Available Commands}
124 %
125 %The commands can be divided into two categories: those that
126 %take the name of a counter as the argument, and those
127 %that take a number as the argument.
128 %
129 %\begin{definition}[\DescribeMacro{\ordinal}]
130 %\cs{ordinal}\marg{counter}\oarg{gender}
131 %\end{definition}
132 %This will print the value of a \LaTeX\ counter \meta{counter} as an
133 %ordinal, where the macro
134 %\begin{definition}[\DescribeMacro{\fmtord}]
135 %\cs{fmtord}\marg{text}
136 %\end{definition}
137 %is used to format the st, nd, rd, th bit. By default the ordinal is
138 %formatted as a superscript, if the package option \pkgopt{level} is
139 %used, it is level with the text. For example, if the current section
140 %is \arabic{section}, then \verb"\ordinal{section}" will produce the output:
141 %\ordinal{section}. Note that the optional argument \meta{gender}
142 %occurs \emph{at the end}. This argument may only take one of
143 %the following values: \texttt{m} (masculine), \texttt{f}
144 %(feminine) or \texttt{n} (neuter.) If \meta{gender} is omitted,
145 %or if the given gender has no meaning in the current language,
146 %\texttt{m} is assumed.
147 %
148 %\textbf{Notes:}
149 %\begin{enumerate}
150 %\item the \cls{memoir} class also defines a command called
151 %\cs{ordinal} which takes a number as an argument instead of a
152 %counter. In order to overcome this incompatiblity, if you want
153 %to use the \styfmt{fmtcount} package with the \cls{memoir} class
154 %you should use
155 %\begin{definition}[\DescribeMacro{\FCordinal}]
156 %\cs{FCordinal}
157 %\end{definition}
158 %to access \styfmt{fmtcount}'s version of \cs{ordinal}, and use
159 %\cs{ordinal} to use \cls{memoir}'s version of that command.
160 %\item When the \oarg{gender} optional argument is omitted, no ignoring of spaces
161 % following the final argument occurs. So both
162 % \verb"\ordinal{section}"\textvisiblespace\verb"!" and
163 % \verb"\ordinal{section}[m]"\textvisiblespace\verb"!" will produce:
164 % \ordinal{section}\textvisiblespace!, where \textvisiblespace\ denotes a space. See
165 % \S~\ref{sec:tailing-oarg}.
166 %\end{enumerate}
167 %
168 %The commands below only work for numbers in the range 0~to~99999.
169 %\begin{definition}[\DescribeMacro{\ordinalnum}]
170 %\cs{ordinalnum}\marg{n}\oarg{gender}
171 %\end{definition}
172 %This is like \cs{ordinal} but takes an actual number rather than a counter as the argument. For example:
173 %\verb"\ordinalnum{"\texttt{\arabic{section}}\verb"}" will produce: \ordinal{section}.
174 %
175 %\begin{definition}[\DescribeMacro{\numberstring}]
176 %\cs{numberstring}\marg{counter}\oarg{gender}
177 %\end{definition}
178 %This will print the value of \meta{counter} as text. E.g.\
179 %\verb"\numberstring{section}" will produce: three. The optional
180 %argument is the same as that for \cs{ordinal}.
181 %
182 %\begin{definition}[\DescribeMacro{\Numberstring}]
183 %\cs{Numberstring}\marg{counter}\oarg{gender}
184 %\end{definition}
185 %This does the same as \cs{numberstring}, but with initial letters in
186 %uppercase. For example, \verb"\Numberstring{section}" will produce:
187 %\Numberstring{section}.
188 %
189 %\begin{definition}[\DescribeMacro{\NUMBERstring}]
190 %\cs{NUMBERstring}\marg{counter}\oarg{gender}
191 %\end{definition}
192 %This does the same as \cs{numberstring}, but converts the string to
193 %upper case. Note that
194 %\verb"\MakeUppercase{\NUMBERstring{"\meta{counter}\verb'}}' doesn't
195 %work, due to the way that \cs{MakeUppercase} expands its
196 %argument\footnote{See all the various postings to
197 %\texttt{comp.text.tex} about \cs{MakeUppercase}}.
198 %
199 %\begin{definition}[\DescribeMacro{\numberstringnum}]
200 %\cs{numberstringnum}\marg{n}\oarg{gender}
201 %\end{definition}
202 %\begin{definition}[\DescribeMacro{\Numberstringnum}]
203 %\cs{Numberstringnum}\marg{n}\oarg{gender}
204 %\end{definition}
205 %\begin{definition}[\DescribeMacro{\NUMBERstringnum}]
206 %\cs{NUMBERstringnum}\marg{n}\oarg{gender}
207 %\end{definition}
208 %Theses macros work like
209 %\cs{numberstring}, \cs{Numberstring} and \cs{NUMBERstring},
210 %respectively, but take an actual number
211 %rather than a counter as the argument. For example:
212 %\verb'\Numberstringnum{105}' will produce: One Hundred and Five.
213 %
214 %\begin{definition}[\DescribeMacro{\ordinalstring}]
215 %\cs{ordinalstring}\marg{counter}\oarg{gender}
216 %\end{definition}
217 %This will print the value of \meta{counter} as a textual ordinal.
218 %E.g.\ \verb"\ordinalstring{section}" will produce: third. The
219 %optional argument is the same as that for \cs{ordinal}.
220 %
221 %\begin{definition}[\DescribeMacro{\Ordinalstring}]
222 %\cs{Ordinalstring}\marg{counter}\oarg{gender}
223 %\end{definition}
224 %This does the same as \cs{ordinalstring}, but with initial letters in
225 %uppercase. For example, \verb"\Ordinalstring{section}" will produce:
226 %\Ordinalstring{section}.
227 %
228 %\begin{definition}[\DescribeMacro{\ORDINALstring}]
229 %\cs{ORDINALstring}\marg{counter}\oarg{gender}
230 %\end{definition}
231 %This does the same as \cs{ordinalstring}, but with all words in upper
232 %case (see previous note about \cs{MakeUppercase}).
233 %
234 %\begin{definition}[\DescribeMacro{\ordinalstringnum}]
235 %\cs{ordinalstringnum}\marg{n}\oarg{gender}
236 %\end{definition}
237 %\begin{definition}[\DescribeMacro{\Ordinalstringnum}]
238 %\cs{Ordinalstringnum}\marg{n}\oarg{gender}
239 %\end{definition}
240 %\begin{definition}[\DescribeMacro{\ORDINALstringnum}]
241 %\cs{ORDINALstringnum}\marg{n}\oarg{gender}
242 %\end{definition}
243 %These macros work like \cs{ordinalstring}, \cs{Ordinalstring} and
244 %\cs{ORDINALstring}, respectively, but take an actual number rather than a
245 %counter as the argument. For example,
246 %\verb"\ordinalstringnum{"\texttt{\arabic{section}}\verb"}" will produce:
247 %\ordinalstring{section}.
248 %
249 %\changes{v.1.09}{21 Apr 2007}{store facility added}
250 %As from version 1.09, textual representations can be stored for
251 %later use. This overcomes the problems encountered when you
252 %attempt to use one of the above commands in \cs{edef}.
253 %
254 %Each of the following commands takes a label as the first argument,
255 %the other arguments are as the analogous commands above. These
256 %commands do not display anything, but store the textual
257 %representation. This can later be retrieved using
258 %
259 %\begin{definition}[\DescribeMacro{\FMCuse}]
260 %\cs{FMCuse}\marg{label}
261 %\end{definition}
262 %
263 %\begin{important}
264 %Note: with \cs{storeordinal} and \cs{storeordinalnum}, the
265 %only bit that doesn't get expanded is \cs{fmtord}. So, for
266 %example, \verb"\storeordinalnum{mylabel}{3}" will be stored as
267 %\verb"3\relax \fmtord{rd}".
268 %\end{important}
269 %
270 %\begin{definition}[\DescribeMacro{\storeordinal}]
271 %\cs{storeordinal}\marg{label}\marg{counter}\oarg{gender}
272 %\end{definition}
273 %
274 %\begin{definition}[\DescribeMacro{\storeordinalstring}]
275 %\cs{storeordinalstring}\marg{label}\marg{counter}\oarg{gender}
276 %\end{definition}
277 %
278 %\begin{definition}[\DescribeMacro{\storeOrdinalstring}]
279 %\cs{storeOrdinalstring}\marg{label}\marg{counter}\oarg{gender}
280 %\end{definition}
281 %
282 %
283 %\begin{definition}[\DescribeMacro{\storeORDINALstring}]
284 %\cs{storeORDINALstring}\marg{label}\marg{counter}\oarg{gender}
285 %\end{definition}
286 %
287 %\begin{definition}[\DescribeMacro{\storenumberstring}]
288 %\cs{storenumberstring}\marg{label}\marg{counter}\oarg{gender}
289 %\end{definition}
290 %
291 %\begin{definition}[\DescribeMacro{\storeNumberstring}]
292 %\cs{storeNumberstring}\marg{label}\marg{counter}\oarg{gender}
293 %\end{definition}
294 %
295 %\begin{definition}[\DescribeMacro{\storeNUMBERstring}]
296 %\cs{storeNUMBERstring}\marg{label}\marg{counter}\oarg{gender}
297 %\end{definition}
298 %
299 %\begin{definition}[\DescribeMacro{\storeordinalnum}]
300 %\cs{storeordinalnum}\marg{label}\marg{number}\oarg{gender}
301 %\end{definition}
302 %
303 %\begin{definition}[\DescribeMacro{\storeordinalstringnum}]
304 %\cs{storeordinalstring}\marg{label}\marg{number}\oarg{gender}
305 %\end{definition}
306 %
307 %\begin{definition}[\DescribeMacro{\storeOrdinalstringnum}]
308 %\cs{storeOrdinalstringnum}\marg{label}\marg{number}\oarg{gender}
309 %\end{definition}
310 %
311 %\begin{definition}[\DescribeMacro{\storeORDINALstringnum}]
312 %\cs{storeORDINALstringnum}\marg{label}\marg{number}\oarg{gender}
313 %\end{definition}
314 %
315 %\begin{definition}[\DescribeMacro{\storenumberstringnum}]
316 %\cs{storenumberstring}\marg{label}\marg{number}\oarg{gender}
317 %\end{definition}
318 %
319 %\begin{definition}[\DescribeMacro{\storeNumberstringnum}]
320 %\cs{storeNumberstring}\marg{label}\marg{number}\oarg{gender}
321 %\end{definition}
322 %
323 %\begin{definition}[\DescribeMacro{\storeNUMBERstringnum}]
324 %\cs{storeNUMBERstring}\marg{label}\marg{number}\oarg{gender}
325 %\end{definition}
326 %
327 %\begin{definition}[\DescribeMacro{\binary}]
328 %\cs{binary}\marg{counter}
329 %\end{definition}
330 %This will print the value of \meta{counter} as a binary number. E.g.\
331 %\verb"\binary{section}" will produce: \binary{section}. The declaration
332 %\begin{definition}[\DescribeMacro{\padzeroes}]
333 %\cs{padzeroes}\oarg{n}
334 %\end{definition}
335 %will ensure numbers are written to \meta{n} digits, padding with zeroes if
336 %necessary. E.g.\ \verb"\padzeroes"\discretionary{}{}{}\verb"[8]\binary{section}"
337 %will produce: \padzeroes[8]\binary{section}. The default value for \meta{n} is
338 %17.
339 %
340 %\begin{definition}[\DescribeMacro{\binarynum}]
341 %\cs{binary}\marg{n}
342 %\end{definition}
343 %This is like \cs{binary} but takes an actual number rather than a
344 %counter as the argument. For example: \verb"\binarynum{5}" will
345 %produce: 101.
346 %
347 %The octal commands only work for values in the range 0~to~32768.
348 %\begin{definition}[\DescribeMacro{\octal}]
349 %\cs{octal}\marg{counter}
350 %\end{definition}
351 %This will print the value of \meta{counter} as an octal number. For
352 %example, if you have a counter called, say \texttt{mycounter}, and
353 %you set the value to 125, then \verb"\octal{mycounter}" will produce:
354 %177. Again, the number will be padded with zeroes if necessary,
355 %depending on whether \cs{padzeroes} has been used.
356 %
357 %\begin{definition}[\DescribeMacro{\octalnum}]
358 %\cs{octalnum}\marg{n}
359 %\end{definition}
360 %This is like \cs{octal} but takes an actual number rather than a
361 %counter as the argument. For example: \verb"\octalnum{125}" will
362 %produce: 177.
363 %
364 %\begin{definition}[\DescribeMacro{\hexadecimal}]
365 %\cs{hexadecimal}\marg{counter}
366 %\end{definition}
367 %This will print the value of \meta{counter} as a hexadecimal number.
368 %Going back to the counter used in the previous example,
369 %\verb"\hexadecimal{mycounter}" will produce: 7d. Again, the number
370 %will be padded with zeroes if necessary, depending on whether
371 %\cs{padzeroes} has been used.
372 %
373 %\begin{definition}[\DescribeMacro{\HEXADecimal}]
374 %\cs{HEXADecimal}\marg{counter}
375 %\end{definition}
376 %This does the same thing, but uses uppercase characters, e.g.\
377 %\verb"\HEXADecimal{mycounter}" will produce: 7D.
378 %
379 %\DescribeMacro{\Hexadecimal}The macro \cs{Hexadecimal} is a deprecated alias of
380 %\cs{HEXADecimal}. Its name was confusing so it was
381 %changed. See~\ref{sec:macro-naming}.
382 %
383 %
384 %\begin{definition}[\DescribeMacro{\hexadecimalnum}]
385 %\cs{hexadecimalnum}\marg{n}
386 %\end{definition}
387 %
388 %\begin{definition}[\DescribeMacro{\HEXADecimalnum}]
389 %\cs{HEXADecimalnum}\marg{n}
390 %\end{definition}
391 %These are like \cs{hexadecimal} and \cs{Hexadecimal}
392 %but take an actual number rather than a counter as the
393 %argument. For example: \verb"\hexadecimalnum{125}" will
394 %produce: 7d, and \verb"\HEXADecimalnum{125}" will
395 %produce: 7D.
396 %
397 %\DescribeMacro{\Hexadecimalnum}The macro \cs{Hexadecimalnum} is a deprecated
398 %alias of \cs{HEXADecimalnum}. Its name was confusing so it was changed.
399 %See~\ref{sec:macro-naming}.
400 %
401 %
402 %\begin{definition}[\DescribeMacro{\decimal}]
403 %\cs{decimal}\marg{counter}
404 %\end{definition}
405 %This is similar to \cs{arabic} but the number can be padded with zeroes
406 %depending on whether \cs{padzeroes} has been used. For example:
407 %\verb"\padzeroes[8]\decimal{section}" will produce:
408 %\padzeroes[8]\decimal{section} still assuming current section is
409 %section~\arabic{section}.
410 %
411 %\begin{definition}[\DescribeMacro{\decimalnum}]
412 %\cs{decimalnum}\marg{n}
413 %\end{definition}
414 %This is like \cs{decimal} but takes an actual number rather than a
415 %counter as the argument. For example:
416 %\verb"\padzeroes[8]\decimalnum{5}" will produce: 00000005.
417 %
418 %\begin{definition}[\DescribeMacro{\aaalph}]
419 %\cs{aaalph}\marg{counter}
420 %\end{definition}
421 %This will print the value of \meta{counter} as: a b \ldots\ z aa bb \ldots\ zz
422 %etc. For example, \verb"\aaalpha"\discretionary{}{}{}\verb"{mycounter}" will
423 %produce: uuuuu if \texttt{mycounter} is set to 125.
424 %
425 %\begin{definition}[\DescribeMacro{\AAAlph}]
426 %\cs{AAAlph}\marg{counter}
427 %\end{definition}
428 %This does the same thing, but uses uppercase characters, e.g.\
429 %\verb"\AAAlph{mycounter}" will produce: UUUUU.
430 %
431 %\begin{definition}[\DescribeMacro{\aaalphnum}]
432 %\cs{aaalphnum}\marg{n}
433 %\end{definition}
434 %
435 %\begin{definition}[\DescribeMacro{\AAAlphnum}]
436 %\cs{AAAlphnum}\marg{n}
437 %\end{definition}
438 %These macros are like \cs{aaalph} and \cs{AAAlph}
439 %but take an actual number rather than a counter as the
440 %argument. For example: \verb"\aaalphnum{125}" will
441 %produce: uuuuu, and \verb"\AAAlphnum{125}" will
442 %produce: UUUUU.
443 %
444 %The abalph commands described below only work for values in the
445 %range 0~to~17576.
446 %\begin{definition}[\DescribeMacro{\abalph}]
447 %\cs{abalph}\marg{counter}
448 %\end{definition}
449 %This will print the value of \meta{counter} as: a b \ldots\ z aa ab
450 %\ldots\ az etc. For example, \verb"\abalpha{mycounter}" will
451 %produce: du if \texttt{mycounter} is set to 125.
452 %
453 %\begin{definition}[\DescribeMacro{\ABAlph}]
454 %\cs{ABAlph}\marg{counter}
455 %\end{definition}
456 %This does the same thing, but uses uppercase characters, e.g.\
457 %\verb"\ABAlph{mycounter}" will produce: DU.
458 %
459 %\begin{definition}[\DescribeMacro{\abalphnum}]
460 %\cs{abalphnum}\marg{n}
461 %\end{definition}
462 %
463 %\begin{definition}[\DescribeMacro{\ABAlphnum}]
464 %\cs{ABAlphnum}\marg{n}
465 %\end{definition}
466 %These macros are like \cs{abalph} and \cs{ABAlph}
467 %but take an actual number rather than a counter as the
468 %argument. For example: \verb"\abalphnum{125}" will
469 %produce: du, and \verb"\ABAlphnum{125}" will
470 %produce: DU.
471 %
472 %\section{Package Options}
473 %\label{sec:package-options}
474 %
475 %The following options can be passed to this package:
476 %
477 %\begin{description}
478 %\item[\meta{dialect}] load language \meta{dialect}, supported \meta{dialect} are the same as passed to
479 % \cs{FCloadlang}, see~\ref{sec:multilingual-support}
480 %\item[\pkgopt{raise}] make ordinal st,nd,rd,th appear as superscript
481 %\item[\pkgopt{level}] make ordinal st,nd,rd,th appear level with rest of text
482 %\end{description}
483 %
484 %
485 %\noindent Options \pkgopt{raise} and \pkgopt{level} can also be set using the command:
486 %
487 %\begin{definition}[\DescribeMacro{\fmtcountsetoptions}]
488 %\cs{fmtcountsetoptions}\verb"{fmtord="\meta{type}\verb'}'
489 %\end{definition}
490 %where \meta{type} is either \texttt{level} or \texttt{raise}. Since version~3.01 of \sty{fmtcount}, it is also
491 %possible to set \meta{type} on a language by language basis, see~\S~\ref{sec:multilingual-support}.
492 %
493 %\section{Multilingual Support}
494 %\label{sec:multilingual-support}
495 %
496 %Version 1.02 of the \sty{fmtcount} package now has
497 %limited multilingual support. The following languages are
498 %implemented: English, Spanish, Portuguese, French, French (Swiss)
499 %and French (Belgian). German support was added in version
500 %1.1.\footnote{Thanks to K. H. Fricke for supplying the information.}
501 %Italian support was added in version 1.31.\footnote{Thanks to
502 %Edoardo Pasca for supplying the information.}
503 %
504 %Actually, \sty{fmtcount} has two modes:
505 %\begin{itemize}
506 %\item a multilingual mode, in which the commands \cs{numberstring}, \cs{ordinalstring}, \cs{ordinal}, and
507 % their variants will be formatted in the currently selected language, as per the \cs{languagename} macro set
508 % by \sty{babel}, \sty{polyglossia} or suchlikes, and
509 %\item a default mode for backward compatibility in which these commands are formatted in English irrespective
510 % of \cs{languagename}, and to which \sty{fmtcount} falls back when it cannot detects packages such as
511 % \sty{babel} or \sty{polyglossia} are loaded.
512 %\end{itemize}
513 %
514 %For multilingual mode, \sty{fmtcount} needs to load correctly the language definition for document dialects. To
515 %do this use
516 %\begin{definition}[\DescribeMacro{\FCloadlang}]
517 %\cs{FCloadlang}\marg{dialect}
518 %\end{definition}
519 %in the preamble --- this will both switch on multilingual mode, and load the \meta{dialect} definition. The
520 %\meta{dialect} should match the options passed to \sty{babel} or \sty{polyglossia}. \sty{fmtcount} currently
521 %supports the following \meta{dialect}'s: \LanguagePackageOptionList.
522 %
523 %If you don't use \cs{FCloadlang}, \sty{fmtcount} will attempt to detect the required dialects and call
524 %\cs{FCloadlang} for you, but this isn't guaranteed to work. Notably, when \cs{FCloadlang} is not used and
525 %\sty{fmtcount} has switched on multilingual mode, but without detecting the needed dialects in the preamble,
526 %and \sty{fmtcount} has to format a number for a dialect for which definition has not been loaded (via
527 %\cs{FCloadlang} above), then if \sty{fmtcount} detects a definition file for this dialect it will attempt to
528 %load it, and cause an error otherwise. This loading in body has not been tested extensively, and may may cause
529 %problems such as spurious spaces insertion before the first formatted number, so it's best to use
530 %\cs{FCloadlang} explicitely in the preamble.
531 %
532 %If the French language is selected, the \texttt{french} option let you
533 %configure the dialect and other aspects. The \texttt{abbr} also has
534 %some influence with French. Please refer to \S~\ref
535 %{sec:options-french}.
536 %
537 %
538 %The male gender for all languages is used by default, however the
539 %feminine or neuter forms can be obtained by passing \texttt{f} or
540 %\texttt{n} as an optional argument to \cs{ordinal},
541 %\cs{ordinalnum} etc. For example:
542 %\verb"\numberstring{section}[f]". Note that the optional argument
543 %comes \emph{after} the compulsory argument. If a gender is
544 %not defined in a given language, the masculine version will
545 %be used instead.
546 %
547 %Let me know if you find any spelling mistakes (has been known
548 %to happen in English, let alone other languages with which I'm not so
549 %familiar.) If you want to add support for another language,
550 %you will need to let me know how to form the numbers and ordinals
551 %from~0 to~99999 in that language for each gender.
552 %
553 %\subsection{Options for setting ordinal ending position raise/level}
554 %\label{sec:options-fmtord}
555 %
556 %\begin{definition}[\DescribeMacro{\fmtcountsetoptions}]
557 %\cs{fmtcountsetoptions}\verb"{"\meta{language}\verb"={fmtord="\meta{type}\verb'}}'
558 %\end{definition}
559 %where \meta{language} is one of the supported language \meta{type} is either \texttt{level} or \texttt{raise}
560 %or \texttt{undefine}. If the value is \texttt{level} or \texttt{raise}, then that will set the \texttt{fmtord}
561 %option accordingly\footnote{see~\S~\ref{sec:package-options}} only for that language \meta{language}. If the
562 %value is \texttt{undefine}, then the non-language specific behaviour is followed.
563 %
564 %Some \meta{language} are synonyms, here is a table:
565 %
566 %\begin{center}
567 % \begin{tabular}{|l|l|}\hline
568 % \textbf{language}& \textbf{alias(es)}\\\hline
569 % english& british\\\hline
570 % french&frenchb\\\hline
571 % &germanb\\
572 % german&ngerman\\
573 % &ngermanb\\\hline
574 % USenglish&american\\\hline
575 % \end{tabular}
576 %\end{center}
577 %
578 %\subsection{Options for French}
579 %\label{sec:options-french}
580 %
581 %This section is in French, as it is most useful to French speaking people.
582 %
583 %\selectlanguage{french} Il est possible de configurer plusieurs
584 %aspects de la numérotation en français avec les options
585 %\texttt{french} et \texttt{abbr}. Ces options n'ont d'effet que si le
586 %langage \texttt{french} est chargé.
587 %
588 %\begin{definition}[\DescribeMacro{\fmtcountsetoptions}]
589 %\cs{fmtcountsetoptions}\verb"{french="\marg{french options}\verb'}'
590 %\end{definition}
591 %L'argument \meta{french options} est une liste entre accolades et
592 %séparée par des virgules de réglages de la forme
593 %``\meta{clef}\texttt{=}\meta{valeur}'', chacun de ces réglages est
594 %ci-après désigné par ``option française'' pour le distinguer des
595 %``options générales'' telles que \texttt{french}.
596 %
597 %Le dialecte peut être sélectionné avec l'option française
598 %\texttt{dialect} dont la valeur \meta{dialect} peut être
599 %\texttt{france}, \texttt{belgian} ou \texttt{swiss}.
600 %\begin{definition}[\DescribeOption{dialect}]
601 %\cs{fmtcountsetoptions}\verb"{french={dialect="\marg{dialect}\verb'}}'
602 %\end{definition}
603 %\begin{definition}[\DescribeOption{french}]
604 %\cs{fmtcountsetoptions}\verb"{french="\meta{dialect}\verb'}'
605 %\end{definition}
606 %
607 %Pour alléger la notation et par souci de rétro-compatibilité
608 %\texttt{france}, \texttt{belgian} ou \texttt{swiss} sont également des
609 %\meta{clef}s pour \meta{french options} à utiliser sans \meta{valeur}.
610 %
611 %L'effet de l'option \texttt{dialect} est illustré ainsi:\newline
612 %\begin{tabularx}{\linewidth}{@{}lX@{}}
613 % \pkgopt{france}& soixante-dix pour 70, quatre-vingts pour 80, et
614 % quatre-vingts-dix pour 90,\\
615 % \pkgopt{belgian} & septante pour 70, quatre-vingts pour 80, et
616 % nonante pour 90, \\
617 % \pkgopt{swiss} &septante pour 70, huitante\footnote{voir
618 % \href{http://www.alain.be/Boece/huitante_octante.html}{Octante et
619 % huitante} sur le site d'Alain Lassine} pour 80, et
620 % nonante pour 90
621 %\end{tabularx}
622 %Il est à noter que la variante \texttt{belgian} est parfaitement
623 %correcte pour les francophones français\footnote{je précise que
624 % l'auteur de ces lignes est français}, et qu'elle est également
625 %utilisée en Suisse Romande hormis dans les cantons de Vaud, du Valais
626 %et de Fribourg. En ce qui concerne le mot ``octante'', il n'est
627 %actuellement pas pris en charge et n'est guère plus utilisé, ce qui
628 %est sans doute dommage car il est sans doute plus acceptable que le
629 %``huitante'' de certains de nos amis suisses.
630 %
631 %\begin{definition}[\DescribeOption{abbr}]
632 %\cs{fmtcountsetoptions}\verb"{abbr="\meta{boolean}\verb'}'
633 %\end{definition}
634 %L'option générale \texttt{abbr} permet de changer l'effet de
635 %\cs{ordinal}. Selon \meta{boolean} on a:\newline
636 %\begin{tabularx}{\linewidth}{@{}lX@{}}
637 % \pkgopt{true}& pour produire des ordinaux de la forme
638 % {\def\languagename{french}\csname fmtord@abbrvtrue\endcsname\ordinalnum{2}} (par défaut), ou\\
639 % \pkgopt{false}& pour produire des ordinaux de la forme
640 % {\def\languagename{french}\csname fmtord@abbrvfalse\endcsname\ordinalnum{2}} \\
641 %\end{tabularx}
642 %
643 %\begin{definition}[\DescribeOption{vingt plural}]
644 %\cs{fmtcountsetoptions}\verb"{french={vingt plural="\meta{french plural control}\verb'}}'
645 %\end{definition}
646 %\begin{definition}[\DescribeOption{cent plural}]
647 %\cs{fmtcountsetoptions}\verb"{french={cent plural="\meta{french plural control}\verb'}}'
648 %\end{definition}
649 %\begin{definition}[\DescribeOption{mil plural}]
650 %\cs{fmtcountsetoptions}\verb"{french={mil plural="\meta{french plural control}\verb'}}'
651 %\end{definition}
652 %\begin{definition}[\DescribeOption{n-illion plural}]
653 %\cs{fmtcountsetoptions}\verb"{french={n-illion plural="\meta{french plural control}\verb'}}'
654 %\end{definition}
655 %\begin{definition}[\DescribeOption{n-illiard plural}]
656 %\cs{fmtcountsetoptions}\verb"{french={n-illiard plural="\meta{french plural control}\verb'}}'
657 %\end{definition}
658 %\begin{definition}[\DescribeOption{all plural}]
659 %\cs{fmtcountsetoptions}\verb"{french={all plural="\meta{french plural control}\verb'}}'
660 %\end{definition}
661 %Les options \texttt{vingt plural}, \texttt{cent plural}, \texttt{mil plural}, \texttt{n-illion plural}, et
662 %\texttt{n-illiard plural}, permettent de contrôler très finement l'accord en nombre des mots respectivement
663 %vingt, cent, mil, et des mots de la forme \meta{\(n\)}illion et \meta{\(n\)}illiard, où \meta{\(n\)} désigne
664 %`m' pour 1, `b' pour 2, 'tr' pour 3, etc. L'option \texttt{all plural} est un raccourci permettant de
665 %contrôler de concert l'accord en nombre de tous ces mots. Tous ces paramètres valent \texttt{reformed} par
666 %défaut.
667 %
668 %Attention, comme on va l'expliquer, seules quelques combinaisons de configurations de ces options donnent un
669 %orthographe correcte vis à vis des règles en vigueur. La raison d'être de ces options est la suivante~:
670 %\begin{itemize}
671 %\item la règle de l'accord en nombre des noms de nombre dans un numéral cardinal dépend de savoir s'il a
672 % vraiment une valeur cardinale ou bien une valeur ordinale, ainsi on écrit \og aller à la page deux-cent
673 % (sans s) d'un livre de deux-cents (avec s) pages\fg, il faut donc pouvoir changer la configuration pour
674 % sélectionner le cas considéré,
675 %\item un autre cas demandant quelque configurabilité est celui de \og mil\fg\ et \og mille\fg. Pour rappel \og
676 % mille\fg\ est le pluriel irrégulier de \og mil\fg, mais l'alternance mil/mille est rare, voire pédante, car
677 % aujourd'hui \og mille\fg\ n'est utilisé que comme un mot invariable, en effet le sort des pluriels étrangers
678 % est systématiquement de finir par disparaître comme par exemple \og scénarii\fg\ aujourd'hui supplanté par
679 % \og scénarios\fg. Pour continuer à pouvoir écrire \og mil\fg, il aurait fallu former le pluriel comme \og
680 % mils\fg, ce qui n'est pas l'usage. Certaines personnes utilisent toutefois encore \og mil\fg\ dans les
681 % dates, par exemple \og mil neuf cent quatre-vingt quatre\fg\ au lieu de \og mille neuf cent quatre-vingt
682 % quatre\fg,
683 %\item finalement les règles du français quoique bien définies ne sont pas très cohérentes et il est donc
684 % inévitable qu'un jour ou l'autre on on les simplifie. Le paquetage \styfmt{fmtcount} est déjà prêt à cette
685 % éventualité.
686 %\end{itemize}
687 %
688 %Le paramètre \meta{french plural control} peut prendre les valeurs suivantes:\newline
689 %\settowidth{\tabcolwidth}{\pkgopt{multiple lng-width}}
690 %\begin{supertabular}{@{}p{\tabcolwidth}p{\dimexpr\linewidth-\tabcolwidth-2\tabcolsep}@{}}
691 % \pkgopt{traditional}& pour sélectionner la règle en usage chez les adultes à la date de parution de ce
692 % document, et dans le cas des numéraux cardinaux, lorsqu'ils ont une valeur cardinale,\\
693 % \pkgopt{reformed}& pour suivre toute nouvelle recommandation à la date de parution de ce document, , et
694 % dans le cas des numéraux cardinaux, lorsqu'ils ont une valeur cardinale, l'idée des options
695 % \texttt{traditional} et \texttt{reformed} est donc de pouvoir contenter à la fois les anciens et les
696 % modernes, mais à dire vrai à la date où ce document est écrit elles ont exactement
697 % le même effet,\\
698 % \pkgopt{traditional o}& pareil que \texttt{traditional} mais dans le cas des numéraux cardinaux,
699 % lorsqu'ils
700 % ont une valeur ordinale,\\
701 % \pkgopt{reformed o}& pareil que \texttt{reformed} mais dans le cas des numéraux cardinaux, lorsqu'ils ont
702 % une valeur ordinale, de même que précédemment \texttt{reformed o} et \texttt{traditional o} ont
703 % exactement le même effet,\\
704 % \pkgopt{always}& pour marquer toujours le pluriel, ceci n'est correct que pour \og mil\fg\ vis à vis des
705 % règles en vigueur,\\
706 % \pkgopt{never}& pour ne jamais marquer le pluriel, ceci est incorrect vis à vis des règles d'orthographe
707 % en vigueur,\\
708 % \pkgopt{multiple}& pour marquer le pluriel lorsque le nombre considéré est multiplié par au moins 2, ceci
709 % est la règle en vigueur pour les nombres de la forme \meta{\(n\)}illion et \meta{\(n\)}illiard lorsque le
710 % nombre a une valeur cardinale,\\
711 % \pkgopt{multiple g-last}& pour marquer le pluriel lorsque le nombre considéré est multiplié par au moins 2
712 % est est \emph{\textbf{g}lobalement} en dernière position, où ``globalement'' signifie qu'on considère le
713 % nombre formaté en entier, ceci est incorrect vis à vis des règles d'orthographe
714 % en vigueur,\\
715 % \pkgopt{multiple l-last}& pour marquer le pluriel lorsque le nombre considéré est multiplié par au moins 2
716 % et est \emph{\textbf{l}ocalement} en dernière position, où ``localement'' siginifie qu'on considère
717 % seulement la portion du nombre qui multiplie soit l'unité, soit un \meta{\(n\)}illion ou un
718 % \meta{\(n\)}illiard~; ceci est la convention en vigueur pour le pluriel de ``vingt'' et de ``cent''
719 % lorsque le nombre formaté a une valeur cardinale,\\
720 % \pkgopt{multiple lng-last}& pour marquer le pluriel lorsque le nombre considéré est multiplié par au moins
721 % 2 et est \emph{\textbf{l}ocalement} mais \emph{\textbf{n}on \textbf{g}lobablement} en dernière position,
722 % où ``localement'' et \emph{globablement} on la même siginification que pour les options \texttt{multiple
723 % g-last} et \texttt{multiple l-last}~; ceci est la convention en vigueur pour le pluriel de ``vingt'' et
724 % de ``cent'' lorsque le nombre formaté a une valeur ordinale,\\
725 % \pkgopt{multiple ng-last}& pour marquer le pluriel lorsque le nombre considéré est multiplié par au moins
726 % 2, et \emph{\textbf{n}}'est pas \emph{\textbf{g}lobalement} en dernière position, où ``globalement'' a la
727 % même signification que pour l'option \texttt{multiple g-last}~; ceci est la règle que j'infère être en
728 % vigueur pour les nombres de la forme \meta{\(n\)}illion et \meta{\(n\)}illiard lorsque le nombre a une
729 % valeur ordinale, mais à dire vrai pour des nombres aussi grands, par exemple \og deux millions\fg, je
730 % pense qu'il n'est tout simplement pas d'usage de dire \og l'exemplaire deux million(s?)\fg\ pour \og le
731 % deux millionième
732 % exemplaire\fg.\\
733 %\end{supertabular}
734 %
735 %L'effet des paramètres \texttt{traditional}, \texttt{traditional o}, \texttt{reformed}, et \texttt{reformed
736 % o}, est le suivant~:
737 %
738 %\setlength{\tabcolwidth}{\linewidth}
739 %\addtolength{\tabcolwidth}{-10\tabcolsep}
740 %\addtolength{\tabcolwidth}{-6\arrayrulewidth}
741 %\setlength{\coliwidth}{0.398\tabcolwidth}
742 %\addtolength{\coliwidth}{\arrayrulewidth}
743 %\addtolength{\coliwidth}{2\tabcolsep}
744 %\noindent\begin{tabular*}{\linewidth}{|%
745 % >{\centering\arraybackslash\ttfamily}p{\dimexpr0.204\tabcolwidth-\arrayrulewidth-\doublerulesep}||%
746 % *{4}{>{\centering\arraybackslash\ttfamily}p{0.199\tabcolwidth}|}}\hline
747 % \textrm{\meta{x} dans ``\meta{x} }plural\textrm{''}&traditional&reformed&traditional o&reformed o\\\hline
748 % \hline
749 % vingt&\multicolumn{2}{c|}{\ColIRI{multiple l-last}}&\multicolumn{2}{c|}{\ColIRI{multiple lng-last}}\\\cline{1-1}
750 % cent&%
751 % \multicolumn{2}{c|}{\ColIRII{multiple l-last}}&%
752 % \multicolumn{2}{c|}{\ColIRII{multiple lng-last}}\\\hline
753 % mil&\multicolumn{4}{c|}{always}\\\hline
754 % n-illion&\multicolumn{2}{c|}{\ColIRI{multiple}}&%
755 % \multicolumn{2}{c|}{\ColIRI{multiple ng-last}}\\\cline{1-1}
756 % n-illiard&%
757 % \multicolumn{2}{c|}{\ColIRII{multiple}}&%
758 % \multicolumn{2}{c|}{\ColIRII{multiple ng-last}}\\\hline
759 %\end{tabular*}
760 %
761 %Les configurations qui respectent les règles d'orthographe sont les suivantes~:
762 %\begin{itemize}
763 %\item \verb"\fmtcountsetoptions{french={all plural=reformed o}}" pour formater les numéraux cardinaux à
764 % valeur ordinale,
765 %\item \verb"\fmtcountsetoptions{french={mil plural=multiple}}" pour activer l'alternance mil/mille.
766 %\item \verb"\fmtcountsetoptions{french={all plural=reformed}}" pour revenir dans la configuration par
767 % défaut.
768 %\end{itemize}
769 %
770 %\begin{definition}[\DescribeOption{dash or space}]
771 %\cs{fmtcountsetoptions}\verb"{french={dash or space="\meta{dash or space}\verb'}}'
772 %\end{definition}
773 %Avant la réforme de l'orthographe de 1990, on ne met des traits d'union qu'entre les dizaines et les unités,
774 %et encore sauf quand le nombre \(n\) considéré est tel que \(n\mod10=1\), dans ce cas on écrit ``et un''
775 %sans trait d'union. Après la réforme de 1990, on recommande de mettre des traits d'union de partout sauf
776 %autour de ``mille'', ``million'' et ``milliard'', et les mots analogues comme ``billion'',
777 %``billiard''. Cette exception a toutefois été contestée par de nombreux auteurs, et on peut aussi mettre des
778 %traits d'union de partout. Mettre l'option \meta{dash or space} à:\newline
779 %\begin{tabularx}{\linewidth}{lX}
780 % \pkgopt{traditional}& pour sélectionner la règle d'avant la réforme de 1990,\\
781 % \pkgopt{1990}& pour suivre la recommandation de la réforme de 1990, \\
782 % \pkgopt{reformed}& pour suivre la recommandation de la dernière
783 % réforme pise en charge, actuellement l'effet est le même que \textrm{1990}, ou à\\
784 % \pkgopt{always}& pour mettre systématiquement des traits d'union de partout.\\
785 %\end{tabularx}
786 %Par défaut, l'option vaut \texttt{reformed}.
787 %
788 %
789 %\begin{definition}[\DescribeOption{scale}]
790 %\cs{fmtcountsetoptions}\verb"{french={scale="\meta{scale}\verb'}}'
791 %\end{definition}
792 %L'option \texttt{scale} permet de configurer l'écriture des grands
793 %nombres. Mettre \meta{scale} à:\newline
794 %\begin{tabularx}{\linewidth}{lX}
795 % \pkgopt{recursive}& dans ce cas \(10^{30}\) donne mille milliards de
796 % milliards de milliards, pour \(10^n\), on écrit \(10^{n-9\times
797 % \max\{(n\div 9)-1,0\}}\) suivi de la répétition \(\max\{(n\div
798 % 9)-1,0\}\) fois de ``de milliards''\\
799 % \pkgopt{long}& \(10^{6\times n}\) donne un \meta{\(n\)}illion où
800 % \meta{\(n\)} est remplacé par ``bi'' pour 2, ``tri'' pour 3, etc. et
801 % \(10^{6\times n+3}\) donne un \meta{\(n\)}illiard avec la même
802 % convention pour \meta{\(n\)}. L'option \texttt{long} est correcte en
803 % Europe, par contre j'ignore l'usage au
804 % Québec.\\
805 % \pkgopt{short}& \(10^{6\times n}\) donne un \meta{\(n\)}illion où
806 % \meta{\(n\)} est remplacé par ``bi'' pour 2, ``tri'' pour 3,
807 % etc. L'option \texttt{short} est incorrecte en Europe.
808 %\end{tabularx}
809 %Par défaut, l'option vaut \texttt{recursive}.
810 %
811 %\begin{definition}[\DescribeOption{n-illiard upto}]
812 %\cs{fmtcountsetoptions}\verb"{french={n-illiard upto="\meta{n-illiard upto}\verb'}}'
813 %\end{definition}
814 %Cette option n'a de sens que si \texttt{scale} vaut
815 %\texttt{long}. Certaines personnes préfèrent dire ``mille
816 %\meta{$n$}illions'' qu'un ``\meta{$n$}illiard''. Mettre l'option
817 %\texttt{n-illiard upto} à:\newline
818 %\begin{tabularx}{\linewidth}{lX}
819 % \pkgopt{infinity}& pour que \(10^{6\times n +3}\) donne
820 % \meta{$n$}illiards pour tout \(n>0\),\\
821 % \pkgopt{infty}& même effet que \texttt{infinity}, \\
822 % \(k\)& où \(k\) est un entier quelconque strictement positif, dans
823 % ce cas \(10^{6\times n +3}\) donne ``mille \meta{\(n\)}illions''
824 % lorsque \(n>k\), et donne ``\meta{\(n\)}illiard'' sinon\\
825 %\end{tabularx}
826 %
827 %\begin{definition}[\DescribeOption{mil plural mark}]
828 %\cs{fmtcountsetoptions}\verb"{french={mil plural mark="\meta{any text}\verb'}}'
829 %\end{definition}
830 %La valeur par défaut de cette option est \og\texttt{le}\fg. Il s'agit de la terminaison ajoutée à \og
831 %mil\fg\ pour former le pluriel, c'est à dire \og mille\fg, cette option ne sert pas à grand chose sauf dans
832 %l'éventualité où ce pluriel serait francisé un jour --- à dire vrai si cela se produisait une alternance
833 %mille/milles est plus vraisemblable, car \og mille\fg\ est plus fréquent que \og mil\fg\ et que les
834 %pluriels francisés sont formés en ajoutant \og s\fg\ à la forme la plus fréquente, par exemple \og
835 %blini/blinis\fg, alors que \og blini\fg\ veut dire \og crêpes\fg\ (au pluriel).
836 %
837 %
838 %\selectlanguage{english}
839 %
840 %\subsection{Prefixes}
841 %\label{sec:latin-prefixes}
842 %
843 %\begin{definition}[\DescribeMacro{\latinnumeralstring}]
844 %\cs{latinnumeralstring}\marg{counter}\oarg{prefix options}
845 %\end{definition}
846 %
847 %\begin{definition}[\DescribeMacro{\latinnumeralstringnum}]
848 %\cs{latinnumeralstringnum}\marg{number}\oarg{prefix options}
849 %\end{definition}
850 %
851 %
852 %\section{Configuration File \texttt{fmtcount.cfg}}
853 %
854 %You can save your preferred default settings to a file called
855 %\texttt{fmtcount.cfg}, and place it on the \TeX\ path. These
856 %settings will then be loaded by the \sty{fmtcount}
857 %package.
858 %
859 %Note that if you are using the \sty{datetime} package,
860 %the \texttt{datetime.cfg} configuration file will override
861 %the \texttt{fmtcount.cfg} configuration file.
862 %For example, if \texttt{datetime.cfg} has the line:
863 %\begin{verbatim}
864 %\renewcommand{\fmtord}[1]{\textsuperscript{\underline{#1}}}
865 %\end{verbatim}
866 %and if \texttt{fmtcount.cfg} has the line:
867 %\begin{verbatim}
868 %\fmtcountsetoptions{fmtord=level}
869 %\end{verbatim}
870 %then the former definition of \cs{fmtord} will take
871 %precedence.
872 %
873 %\section{LaTeX2HTML style}
874 %
875 %The \LaTeX2HTML\ style file \texttt{fmtcount.perl} is provided.
876 %The following limitations apply:
877 %
878 %\begin{itemize}
879 %\item \cs{padzeroes} only has an effect in the preamble.
880 %
881 %\item The configuration file
882 %\texttt{fmtcount.cfg} is currently ignored. (This is because
883 %I can't work out the correct code to do this. If you
884 %know how to do this, please let me know.) You can however
885 %do:
886 %\begin{verbatim}
887 %\usepackage{fmtcount}
888 %\html{\input{fmtcount.cfg}}
889 %\end{verbatim}
890 %This, I agree, is an unpleasant cludge.
891 %
892 %\end{itemize}
893 %
894 %\section{Miscellaneous}
895 %\label{sec:misc}
896 %
897 %\subsection{Handling of spaces with tailing optional argument}
898 %\label{sec:tailing-oarg}
899 %
900 %Quite some of the commands in \styfmt{fmtcount} have a tailing optional argument, notably a \oarg{gender}
901 %argument, which is due to historical reasons, and is a little unfortunate.
902 %
903 %When the tailing optional argument is omitted, then any subsequent space will:
904 %\begin{itemize}
905 %\item \texttt{not} be gobbled if the command make some typset output, like \cs{ordinal} or \cs{numbestring}, and
906 %\item be gobbled if the command stores a number into a label like \cs{storeordinalnum} or
907 % \cs{storenumberstring}, or make some other border effect like \cs{padzeroes} without any typeset output.
908 %\end{itemize}
909 %
910 %So (where we use visible spaces ``\verb*! !'' to demonstrate the point):
911 %\begin{itemize}
912 %\item ``x\cs{ordinalnum\{2\}}\verb*! !\texttt{x}'' will be typeset to ``x\ordinalnum{2}\textvisiblespace x'', while
913 %\item ``x\cs{storeordinalnum\{mylabel\}\{2\}}\verb*! !\texttt{x}'' will be typeset to ``xx''.
914 %\end{itemize}
915 %
916 %The reason for this design choice is that the commands like like \cs{ordinal} or \cs{numbestring} are usually
917 %inserted in the flow of text, and one usually does not want subsequent spaces gobbled, while the commands like
918 %\cs{storeordinalnum} or \cs{storenumberstring} usually stands on their own line, and one usually does not want
919 %the tailing end-of-line to produce an extra-space.
920 %
921 %\subsection{Macro naming conventions}
922 %\label{sec:macro-naming}
923 %
924 %Macros that refer to upper-casing have upper case only in the main part of their name. That is to say the
925 %words ``store'', ``string'' or ``num'' are not upper-cased for instance in \cs{storeORDINALstringnum},
926 %\cs{storeOrdinalstringnum} or in \cs{NUMBERstringnum}.
927 %
928 %Furthermore, when upper-casing all the number letters is considered, the main part of the name is:
929 %\begin{itemize}
930 %\item all in upper-case when it consist of a single word that is not composed of a prefix+radix, for instance
931 % ``ORDINAL'' or ``NUMBER'', and
932 %\item with the prefix all in upper-case, and only the first letter of the radix in upper-case for words that
933 % consist of a prefix+radix, for instance ``HEXADecimal'' or ``AAAlph'' because they can be considered as a
934 % prefix+radix construct ``hexa+decimal'' or ``aa+alph''.
935 %\end{itemize}
936 %
937 %Observance of this rule is the reason why macros \cs{Hexadecimal} and \cs{Hexadecimalnum} were respectively
938 %renamed as \cs{HEXADecimal} and \cs{HEXADecimalnum} from v3.06.
939 %
940 %
941 %\section{Acknowledgements}
942 %
943 %I would like to thank all the people who have provided translations and made bug reports.
944 %
945 %\section{Troubleshooting}
946 %
947 %Bug reporting should be done via the GitHub issue manager at:
948 %
949 %\href{https://github.com/Xerdi/fmtcount/issues/}{github.com/Xerdi/fmtcount/issues/}.
950 %
951 %
952 %
953 %\StopEventually{}
954 %\section{The Code}
955 %\iffalse
956 % \begin{macrocode}
957 %<*fc-american.def>
958 % \end{macrocode}
959 %\fi
960 % \subsection{Language definition files}
961 % \subsubsection{fc-american.def}
962 % American English definitions
963 % \begin{macrocode}
964 \ProvidesFCLanguage{american}[2016/01/12]%
965 % \end{macrocode}
966 % Loaded fc-USenglish.def if not already loaded
967 % \begin{macrocode}
968 \FCloadlang{USenglish}%
969 % \end{macrocode}
970 % These are all just synonyms for the commands provided by
971 % \styfmt{fc-USenglish.def}.
972 % \begin{macrocode}
973 \global\let\@ordinalMamerican\@ordinalMUSenglish
974 \global\let\@ordinalFamerican\@ordinalMUSenglish
975 \global\let\@ordinalNamerican\@ordinalMUSenglish
976 \global\let\@numberstringMamerican\@numberstringMUSenglish
977 \global\let\@numberstringFamerican\@numberstringMUSenglish
978 \global\let\@numberstringNamerican\@numberstringMUSenglish
979 \global\let\@NumberstringMamerican\@NumberstringMUSenglish
980 \global\let\@NumberstringFamerican\@NumberstringMUSenglish
981 \global\let\@NumberstringNamerican\@NumberstringMUSenglish
982 \global\let\@ordinalstringMamerican\@ordinalstringMUSenglish
983 \global\let\@ordinalstringFamerican\@ordinalstringMUSenglish
984 \global\let\@ordinalstringNamerican\@ordinalstringMUSenglish
985 \global\let\@OrdinalstringMamerican\@OrdinalstringMUSenglish
986 \global\let\@OrdinalstringFamerican\@OrdinalstringMUSenglish
987 \global\let\@OrdinalstringNamerican\@OrdinalstringMUSenglish
988 % \end{macrocode}
989 % \setcounter{CodelineNo}{0}
990 %\iffalse
991 % \begin{macrocode}
992 %</fc-american.def>
993 % \end{macrocode}
994 %\fi
995 %\iffalse
996 % \begin{macrocode}
997 %<*fc-brazilian.def>
998 % \end{macrocode}
999 %\fi
1000 % \subsubsection{fc-brazilian.def}
1001 % Brazilian definitions.
1002 % \begin{macrocode}
1003 \ProvidesFCLanguage{brazilian}[2017/12/26]%
1004 % \end{macrocode}
1005 % Load \sty{fc-portuges.def} if not already loaded.
1006 % \begin{macrocode}
1007 \FCloadlang{portuges}%
1008 % \end{macrocode}
1009 % Set \verb|brazilian| to be equivalent to \verb|portuges| for all the numeral ordinals, and string ordinals.
1010 % \begin{macrocode}
1011 \global\let\@ordinalMbrazilian=\@ordinalMportuges
1012 \global\let\@ordinalFbrazilian=\@ordinalFportuges
1013 \global\let\@ordinalNbrazilian=\@ordinalNportuges
1014 \global\let\@ordinalstringFbrazilian\@ordinalstringFportuges
1015 \global\let\@ordinalstringMbrazilian\@ordinalstringMportuges
1016 \global\let\@ordinalstringNbrazilian\@ordinalstringMportuges
1017 \global\let\@OrdinalstringMbrazilian\@OrdinalstringMportuges
1018 \global\let\@OrdinalstringFbrazilian\@OrdinalstringFportuges
1019 \global\let\@OrdinalstringNbrazilian\@OrdinalstringMportuges
1020 % \end{macrocode}
1021 % Convert a number to a textual representation. To make it easier, split it up into units, tens, teens and
1022 % hundreds. Units, tens, and hundreds are the same as for \verb|portuges| and are not redefined, only the teens are
1023 % Brazilian specific.\\
1024 % Teens (argument must be a number from 0 to 9):
1025 % \begin{macrocode}
1026 \newcommand*\@@teenstringbrazilian[1]{%
1027 \ifcase#1\relax
1028 dez%
1029 \or onze%
1030 \or doze%
1031 \or treze%
1032 \or quatorze%
1033 \or quinze%
1034 \or dezesseis%
1035 \or dezessete%
1036 \or dezoito%
1037 \or dezenove%
1038 \fi
1039 }%
1040 \global\let\@@teenstringbrazilian\@@teenstringbrazilian
1041 % \end{macrocode}
1042 % Teens (with initial letter in upper case):
1043 % \begin{macrocode}
1044 \newcommand*\@@Teenstringbrazilian[1]{%
1045 \ifcase#1\relax
1046 Dez%
1047 \or Onze%
1048 \or Doze%
1049 \or Treze%
1050 \or Quatorze%
1051 \or Quinze%
1052 \or Dezesseis%
1053 \or Dezessete%
1054 \or Dezoito%
1055 \or Dezenove%
1056 \fi
1057 }%
1058 \global\let\@@Teenstringbrazilian\@@Teenstringbrazilian
1059 % \end{macrocode}
1060 % This has changed in version 1.08, so that it now stores
1061 % the result in the second argument, but doesn't display
1062 % anything. Since it only affects internal macros, it shouldn't
1063 % affect documents created with older versions. (These internal
1064 % macros are not meant for use in documents.)
1065 % \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by
1066 % \cs{newcommand*} as robustness is handled now at top level in
1067 % \texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned macros
1068 % are \cs{@numberstringMbrazilian}, \cs{@numberstringFbrazilian},
1069 % \cs{@NumberstringMbrazilian}, \cs{@NumberstringFbrazilian},
1070 % \cs{@ordinalstringMbrazilian}, \cs{@ordinalstringFbrazilian},
1071 % \cs{@OrdinalstringMbrazilian}, and \cs{@OrdinalstringFbrazilian}.}
1072 % \changes{3.03}{2017/07/21}{Fix bug
1073 % \#\href{https://github.com/nlct/fmtcount/issues/25}{25}.}
1074 % \begin{macrocode}
1075 \newcommand*{\@numberstringMbrazilian}[2]{%
1076 \let\@unitstring=\@@unitstringportuges
1077 \let\@teenstring=\@@teenstringbrazilian
1078 \let\@tenstring=\@@tenstringportuges
1079 \let\@hundredstring=\@@hundredstringportuges
1080 \def\@hundred{cem}\def\@thousand{mil}%
1081 \def\@andname{e}%
1082 \@@numberstringportuges{#1}{#2}%
1083 }%
1084 \global\let\@numberstringMbrazilian\@numberstringMbrazilian
1085 % \end{macrocode}
1086 % As above, but feminine form:
1087 % \begin{macrocode}
1088 \newcommand*{\@numberstringFbrazilian}[2]{%
1089 \let\@unitstring=\@@unitstringFportuges
1090 \let\@teenstring=\@@teenstringbrazilian
1091 \let\@tenstring=\@@tenstringportuges
1092 \let\@hundredstring=\@@hundredstringFportuges
1093 \def\@hundred{cem}\def\@thousand{mil}%
1094 \def\@andname{e}%
1095 \@@numberstringportuges{#1}{#2}%
1096 }%
1097 \global\let\@numberstringFbrazilian\@numberstringFbrazilian
1098 % \end{macrocode}
1099 % Make neuter same as masculine:
1100 % \begin{macrocode}
1101 \global\let\@numberstringNbrazilian\@numberstringMbrazilian
1102 % \end{macrocode}
1103 % As above, but initial letters in upper case:
1104 % \begin{macrocode}
1105 \newcommand*{\@NumberstringMbrazilian}[2]{%
1106 \let\@unitstring=\@@unitstringportuges
1107 \let\@teenstring=\@@Teenstringbrazilian
1108 \let\@tenstring=\@@Tenstringportuges
1109 \let\@hundredstring=\@@hundredstringportuges
1110 \def\@hundred{Cem}\def\@thousand{Mil}%
1111 \def\@andname{e}%
1112 \@@numberstringportuges{#1}{#2}%
1113 }%
1114 \global\let\@NumberstringMbrazilian\@NumberstringMbrazilian
1115 % \end{macrocode}
1116 % As above, but feminine form:
1117 % \begin{macrocode}
1118 \newcommand*{\@NumberstringFbrazilian}[2]{%
1119 \let\@unitstring=\@@UnitstringFportuges
1120 \let\@teenstring=\@@Teenstringbrazilian
1121 \let\@tenstring=\@@Tenstringportuges
1122 \let\@hundredstring=\@@HundredstringFportuges
1123 \def\@hundred{Cem}\def\@thousand{Mil}%
1124 \def\@andname{e}%
1125 \@@numberstringportuges{#1}{#2}%
1126 }%
1127 \global\let\@NumberstringFbrazilian\@NumberstringFbrazilian
1128 % \end{macrocode}
1129 % Make neuter same as masculine:
1130 % \begin{macrocode}
1131 \global\let\@NumberstringNbrazilian\@NumberstringMbrazilian
1132 % \end{macrocode}
1133 % \setcounter{CodelineNo}{0}
1134 %\iffalse
1135 % \begin{macrocode}
1136 %</fc-brazilian.def>
1137 % \end{macrocode}
1138 %\fi
1139 %\iffalse
1140 % \begin{macrocode}
1141 %<*fc-british.def>
1142 % \end{macrocode}
1143 %\fi
1144 % \subsubsection{fc-british.def}
1145 % British definitions
1146 % \begin{macrocode}
1147 \ProvidesFCLanguage{british}[2013/08/17]%
1148 % \end{macrocode}
1149 % Load fc-english.def, if not already loaded
1150 % \begin{macrocode}
1151 \FCloadlang{english}%
1152 % \end{macrocode}
1153 % These are all just synonyms for the commands provided by
1154 % fc-english.def.
1155 % \begin{macrocode}
1156 \global\let\@ordinalMbritish\@ordinalMenglish
1157 \global\let\@ordinalFbritish\@ordinalMenglish
1158 \global\let\@ordinalNbritish\@ordinalMenglish
1159 \global\let\@numberstringMbritish\@numberstringMenglish
1160 \global\let\@numberstringFbritish\@numberstringMenglish
1161 \global\let\@numberstringNbritish\@numberstringMenglish
1162 \global\let\@NumberstringMbritish\@NumberstringMenglish
1163 \global\let\@NumberstringFbritish\@NumberstringMenglish
1164 \global\let\@NumberstringNbritish\@NumberstringMenglish
1165 \global\let\@ordinalstringMbritish\@ordinalstringMenglish
1166 \global\let\@ordinalstringFbritish\@ordinalstringMenglish
1167 \global\let\@ordinalstringNbritish\@ordinalstringMenglish
1168 \global\let\@OrdinalstringMbritish\@OrdinalstringMenglish
1169 \global\let\@OrdinalstringFbritish\@OrdinalstringMenglish
1170 \global\let\@OrdinalstringNbritish\@OrdinalstringMenglish
1171 % \end{macrocode}
1172 % \setcounter{CodelineNo}{0}
1173 %\iffalse
1174 % \begin{macrocode}
1175 %</fc-british.def>
1176 % \end{macrocode}
1177 %\fi
1178 %\iffalse
1179 % \begin{macrocode}
1180 %<*fc-dutch.def>
1181 % \end{macrocode}
1182 %\fi
1183 % \subsubsection{fc-dutch.def}
1184 % Dutch definitions, initially added by Erik Nijenhuis.
1185 % \begin{macrocode}
1186 \ProvidesFCLanguage{dutch}[2024/01/27]%
1187 % \end{macrocode}
1188 % Define macro that converts a number or count register (first
1189 % argument) to a numeric ordinal, and stores the result in the
1190 % second argument, which should be a control sequence.
1191 % Dutch numeric ordinals use ``ste'' for multiples of 10 from 20
1192 % upward (e.g., 20ste, 30ste, 100ste, 120ste), and ``e'' for all
1193 % other numbers (e.g., 1e, 10e, 18e, 21e, 101e).
1194 % \begin{macrocode}
1195 \newcommand{\@ordinalMdutch}[2]{%
1196 \@tempcnta=#1\relax
1197 \@FCmodulo{\@tempcnta}{10}%
1198 \ifnum\@tempcnta=0\relax
1199 \ifnum#1<20\relax
1200 \edef#2{\number#1\relax e}%
1201 \else
1202 \edef#2{\number#1\relax ste}%
1203 \fi
1204 \else
1205 \edef#2{\number#1\relax e}%
1206 \fi
1207 }%
1208 \global\let\@ordinalMdutch\@ordinalMdutch
1209 % \end{macrocode}
1210 % Like English, there is no gender difference in Dutch,
1211 % so make feminine and neuter the same as the masculine.
1212 % \begin{macrocode}
1213 \global\let\@ordinalFdutch\@ordinalMdutch
1214 \global\let\@ordinalNdutch\@ordinalMdutch
1215 % \end{macrocode}
1216 % Define the macro that prints the value of a \TeX\ count register
1217 % as text. To make it easier, break it up into units, teens and
1218 % tens. First, the units: the argument should be between 0 and 9
1219 % inclusive.
1220 % \begin{macrocode}
1221 \newcommand*\@@unitstringdutch[1]{%
1222 \ifcase#1%
1223 nul%
1224 \or een% één and \'e\'en not working atm
1225 \or twee%
1226 \or drie%
1227 \or vier%
1228 \or vijf%
1229 \or zes%
1230 \or zeven%
1231 \or acht%
1232 \or negen%
1233 \fi
1234 }%
1235 \global\let\@@unitstringdutch\@@unitstringdutch
1236 % \end{macrocode}
1237 % Next the tens, again the argument should be between 0 and 9
1238 % inclusive.
1239 % \begin{macrocode}
1240 \global\let\@@unitstringdutch\@@unitstringdutch
1241 \newcommand*\@@tenstringdutch[1]{%
1242 \ifcase#1%
1243 \or tien%
1244 \or twintig%
1245 \or dertig%
1246 \or veertig%
1247 \or vijftig%
1248 \or zestig%
1249 \or zeventig%
1250 \or tachtig%
1251 \or negentig%
1252 \or honderd%
1253 \fi
1254 }%
1255 \global\let\@@tenstringdutch\@@tenstringdutch
1256 % \end{macrocode}
1257 % Finally the teens, again the argument should be between 0 and 9
1258 % inclusive.
1259 % \begin{macrocode}
1260 \newcommand*\@@teenstringdutch[1]{%
1261 \ifcase#1%
1262 tien%
1263 \or elf%
1264 \or twaalf%
1265 \or dertien%
1266 \or veertien%
1267 \or vijftien%
1268 \or zestien%
1269 \or zeventien%
1270 \or achttien%
1271 \or negentien%
1272 \fi
1273 }%
1274 \global\let\@@teenstringdutch\@@teenstringdutch
1275 % \end{macrocode}
1276 % Hunderd and thousand:
1277 % \begin{macrocode}
1278 \providecommand*{\honderd}{honderd}%
1279 \providecommand*{\duizend}{duizend}%
1280 \global\let\honderd\honderd
1281 \global\let\duizend\duizend
1282 % \end{macrocode}
1283 % The numberstring implementation. Converts numbers to Dutch words
1284 % (e.g., 18 becomes ``achttien'', 100 becomes ``honderd'').
1285 % Supports numbers from 0 to 99999.
1286 % \begin{macrocode}
1287 \newcommand*\@@numberstringdutch[2]{%
1288 \ifnum#1>99999\relax
1289 \PackageError{fmtcount}{Out of range}%
1290 {This macro only works for values less than 100000}%
1291 \else
1292 \ifnum#1<0\relax
1293 \PackageError{fmtcount}{Negative numbers not permitted}%
1294 {This macro does not work for negative numbers, however
1295 you can try typing "minus" first, and then pass the modulus of
1296 this number}%
1297 \fi
1298 \fi
1299 \def#2{}%
1300 \@strctr=#1\relax \divide\@strctr by 1000\relax
1301 \ifnum\@strctr>1\relax
1302 \@@numberunderhundreddutch{\@strctr}{#2}%
1303 \appto#2{duizend}%
1304 \else
1305 \ifnum\@strctr=1\relax
1306 \eappto#2{\duizend}%
1307 \fi
1308 \fi
1309 \@strctr=#1\relax
1310 \@FCmodulo{\@strctr}{1000}%
1311 \divide\@strctr by 100\relax
1312 \ifnum\@strctr>1\relax
1313 \eappto#2{\@unitstring{\@strctr}honderd}%
1314 \else
1315 \ifnum\@strctr=1\relax
1316 \ifnum#1>1000\relax
1317 \appto#2{honderd}%
1318 \else
1319 \eappto#2{\honderd}%
1320 \fi
1321 \fi
1322 \fi
1323 \@strctr=#1\relax
1324 \@FCmodulo{\@strctr}{100}%
1325 \ifnum#1=0\relax
1326 \def#2{null}%
1327 \else
1328 \ifnum\@strctr=1\relax
1329 \appto#2{een}% één and \'e\'en not working atm
1330 \else
1331 \@@numberunderhundreddutch{\@strctr}{#2}%
1332 \fi
1333 \fi
1334 }%
1335 \global\let\@@numberstringdutch\@@numberstringdutch
1336 % \end{macrocode}
1337 % All lower case version, the second argument must be a control
1338 % sequence.
1339 % \begin{macrocode}
1340 \newcommand*{\@numberstringMdutch}[2]{%
1341 \let\@unitstring=\@@unitstringdutch%
1342 \let\@teenstring=\@@teenstringdutch%
1343 \let\@tenstring=\@@tenstringdutch%
1344 \def\@hundred{honderd}\def\@thousand{duizend}%
1345 \@@numberstringdutch{#1}{#2}%
1346 }%
1347 \global\let\@numberstringMdutch\@numberstringMdutch
1348 % \end{macrocode}
1349 % There is no gender in Dutch, so make feminine and neuter the
1350 % same
1351 % as the masculine.
1352 % \begin{macrocode}
1353 \global\let\@numberstringFdutch=\@numberstringMdutch
1354 \global\let\@numberstringNdutch=\@numberstringMdutch
1355 % \end{macrocode}
1356 % This version makes the first letter of each word an uppercase
1357 % character (except ``and''). The second argument must be a control
1358 % sequence.
1359 % \begin{macrocode}
1360 \newcommand*{\@NumberstringMdutch}[2]{%
1361 \@numberstringMdutch{#1}{\@@num@str}%
1362 \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
1363 }%
1364 \global\let\@NumberstringMdutch\@NumberstringMdutch
1365 % \end{macrocode}
1366 % There is no gender in Dutch, so make feminine and neuter the
1367 % same
1368 % as the masculine.
1369 % \begin{macrocode}
1370 \global\let\@NumberstringFdutch=\@NumberstringMdutch
1371 \global\let\@NumberstringNdutch=\@NumberstringMdutch
1372 % \end{macrocode}
1373 % Define a macro that produces an ordinal as a string. Again, break
1374 % it up into units, teens and tens. First the units:
1375 % \begin{macrocode}
1376 \newcommand*\@@unitthstringdutch[1]{%
1377 \ifcase#1%
1378 nulde%
1379 \or eerste% éérste and \'e\'erste not working atm
1380 \or tweede%
1381 \or derde%
1382 \or vierde%
1383 \or vijfde%
1384 \or zesde%
1385 \or zevende%
1386 \or achtste%
1387 \or negende%
1388 \fi
1389 }%
1390 \global\let\@@unitthstringdutch\@@unitthstringdutch
1391 % \end{macrocode}
1392 % Next the tens:
1393 % \begin{macrocode}
1394 \newcommand*\@@tenthstringdutch[1]{%
1395 \ifcase#1%
1396 \or tiende%
1397 \or twintigste%
1398 \or dertigste%
1399 \or veertigste%
1400 \or vijftigste%
1401 \or zestigste%
1402 \or zeventigste%
1403 \or tachtigste%
1404 \or negentigste%
1405 \fi
1406 }%
1407 \global\let\@@tenthstringdutch\@@tenthstringdutch
1408 % \end{macrocode}
1409 % The teens:
1410 % \begin{macrocode}
1411 \newcommand*\@@teenthstringdutch[1]{%
1412 \ifcase#1%
1413 tiende%
1414 \or elfde%
1415 \or twaalfde%
1416 \or dertiende%
1417 \or veertiende%
1418 \or vijftiende%
1419 \or zestiende%
1420 \or zeventiende%
1421 \or achttiende%
1422 \or negentiende%
1423 \fi
1424 }%
1425 \global\let\@@teenthstringdutch\@@teenthstringdutch
1426 % \end{macrocode}
1427 % The ordinalstring implementation. Converts numbers to Dutch ordinal
1428 % words (e.g., 18 becomes ``achttiende'', 100 becomes ``honderdste'').
1429 % Supports numbers from 0 to 99999.
1430 % \begin{macrocode}
1431 \newcommand*\@@ordinalstringdutch[2]{%
1432 \@orgargctr=#1\relax
1433 \ifnum\@orgargctr>99999\relax
1434 \PackageError{fmtcount}{Out of range}%
1435 {This macro only works for values less than 100000}%
1436 \else
1437 \ifnum\@orgargctr<0\relax
1438 \PackageError{fmtcount}{Negative numbers not permitted}%
1439 {This macro does not work for negative numbers, however
1440 you can try typing "minus" first, and then pass the modulus of
1441 this number}%
1442 \fi
1443 \fi
1444 \def#2{}%
1445 \@strctr=\@orgargctr\divide\@strctr by 1000\relax
1446 \ifnum\@strctr>1\relax
1447 \@@numberunderhundreddutch{\@strctr}{#2}%
1448 \@tmpstrctr=\@orgargctr\@FCmodulo{\@tmpstrctr}{1000}%
1449 \ifnum\@tmpstrctr=0\relax
1450 \eappto#2{\@thousandth}%
1451 \else
1452 \appto#2{duizend}%
1453 \fi
1454 \else
1455 \ifnum\@strctr=1\relax
1456 \ifnum\@orgargctr=1000\relax
1457 \eappto#2{\@thousandth}%
1458 \else
1459 \eappto#2{\duizend}%
1460 \fi
1461 \fi
1462 \fi
1463 \@strctr=\@orgargctr%
1464 \@FCmodulo{\@strctr}{1000}%
1465 \divide\@strctr by 100\relax
1466 \ifnum\@strctr>1\relax
1467 \@tmpstrctr=\@orgargctr \@FCmodulo{\@tmpstrctr}{100}%
1468 \ifnum\@tmpstrctr=0\relax
1469 \ifnum\@strctr=1\relax
1470 \eappto#2{\@hundredth}%
1471 \else
1472 \eappto#2{\@unitstring{\@strctr}\@hundredth}%
1473 \fi
1474 \else
1475 \eappto#2{\@unitstring{\@strctr}honderd}%
1476 \fi
1477 \else
1478 \ifnum\@strctr=1\relax
1479 \@tmpstrctr=\@orgargctr \@FCmodulo{\@tmpstrctr}{100}%
1480 \ifnum\@tmpstrctr=0\relax
1481 \eappto#2{\@hundredth}%
1482 \else
1483 \ifnum\@orgargctr>1000\relax
1484 \appto#2{honderd}%
1485 \else
1486 \eappto#2{\honderd}%
1487 \fi
1488 \fi
1489 \fi
1490 \fi
1491 \@strctr=\@orgargctr%
1492 \@FCmodulo{\@strctr}{100}%
1493 \ifthenelse{\@strctr=0 \and \@orgargctr>0 }{}{%
1494 \@@numberunderhundredthdutch{\@strctr}{#2}%
1495 }%
1496 }%
1497 \global\let\@@ordinalstringdutch\@@ordinalstringdutch
1498 % \end{macrocode}
1499 % All lower case version. Again, the second argument must be a
1500 % control sequence in which the resulting text is stored.
1501 % \begin{macrocode}
1502 \newcommand*{\@ordinalstringMdutch}[2]{%
1503 \let\@unitthstring=\@@unitthstringdutch%
1504 \let\@teenthstring=\@@teenthstringdutch%
1505 \let\@tenthstring=\@@tenthstringdutch%
1506 \let\@unitstring=\@@unitstringdutch%
1507 \let\@teenstring=\@@teenstringdutch%
1508 \let\@tenstring=\@@tenstringdutch%
1509 \def\@thousandth{duizendste}%
1510 \def\@hundredth{honderdste}%
1511 \@@ordinalstringdutch{#1}{#2}%
1512 }%
1513 \global\let\@ordinalstringMdutch\@ordinalstringMdutch
1514 % \end{macrocode}
1515 % No gender in Dutch, so make feminine and neuter same as
1516 % masculine:
1517 % \begin{macrocode}
1518 \global\let\@ordinalstringFdutch=\@ordinalstringMdutch
1519 \global\let\@ordinalstringNdutch=\@ordinalstringMdutch
1520 % \end{macrocode}
1521 % First letter of each word in upper case:
1522 % \begin{macrocode}
1523 \newcommand*{\@OrdinalstringMdutch}[2]{%
1524 \@ordinalstringMdutch{#1}{\@@num@str}%
1525 \def\@hundred{Honderd}\def\@thousand{Duizend}%
1526 \def\@hundredth{Honderdste}\def\@thousandth{Duizendste}%
1527 \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
1528 }%
1529 \global\let\@OrdinalstringMdutch\@OrdinalstringMdutch
1530 % \end{macrocode}
1531 % No gender in Dutch, so make feminine and neuter same as
1532 % masculine:
1533 % \begin{macrocode}
1534 \global\let\@OrdinalstringFdutch=\@OrdinalstringMdutch
1535 \global\let\@OrdinalstringNdutch=\@OrdinalstringMdutch
1536 % \end{macrocode}
1537 % Helper macro for formatting numbers under 100 as words.
1538 % Handles units (1--9), teens (10--19), and compound numbers (20--99)
1539 % with proper diaeresis where needed.
1540 % \begin{macrocode}
1541 \newcommand*{\@@numberunderhundreddutch}[2]{%
1542 \ifnum#1<10\relax
1543 \ifnum#1>0\relax
1544 \eappto#2{\@unitstring{#1}}%
1545 \fi
1546 \else
1547 \@tmpstrctr=#1\relax
1548 \@FCmodulo{\@tmpstrctr}{10}%
1549 \ifnum#1<20\relax
1550 \eappto#2{\@teenstring{\@tmpstrctr}}%
1551 \else
1552 \ifnum\@tmpstrctr=0\relax
1553 \else
1554 % \end{macrocode}
1555 % For digits ending with an `e', a diaeresis (trema) gets added to
1556 % \cs{@andname} to prevent ambiguity in pronunciation.
1557 % Examples: drieëntwintig (23), tweeënveertig (42).
1558 % \begin{macrocode}
1559 \ifnum\@tmpstrctr=2\relax\def\@andname{ën}%
1560 \else\ifnum\@tmpstrctr=3\relax\def\@andname{ën}%
1561 \else\def\@andname{en}%
1562 \fi\fi%
1563 \eappto#2{\@unitstring{\@tmpstrctr}\@andname}%
1564 \fi
1565 \@tmpstrctr=#1\relax
1566 \divide\@tmpstrctr by 10\relax
1567 \eappto#2{\@tenstring{\@tmpstrctr}}%
1568 \fi
1569 \fi
1570 }%
1571 \global\let\@@numberunderhundreddutch\@@numberunderhundreddutch
1572 \newcommand*{\@@numberunderhundredthdutch}[2]{%
1573 \ifnum#1<10\relax
1574 \eappto#2{\@unitthstring{#1}}%
1575 \else
1576 \@tmpstrctr=#1\relax
1577 \@FCmodulo{\@tmpstrctr}{10}%
1578 \ifnum#1<20\relax
1579 \eappto#2{\@teenthstring{\@tmpstrctr}}%
1580 \else
1581 \ifnum\@tmpstrctr=0\relax
1582 \else
1583 % \end{macrocode}
1584 % Again, for digits ending with an `e', a trema gets added for \cs{@andname} (drieëntwintig or tweeënveertig).
1585 % \begin{macrocode}
1586 \ifnum\@tmpstrctr=2\relax\def\@andname{ën}%
1587 \else\ifnum\@tmpstrctr=3\relax\def\@andname{ën}%
1588 \else\def\@andname{en}%
1589 \fi\fi%
1590 \eappto#2{\@unitstring{\@tmpstrctr}\@andname}%
1591 \fi
1592 \@tmpstrctr=#1\relax
1593 \divide\@tmpstrctr by 10\relax
1594 \eappto#2{\@tenthstring{\@tmpstrctr}}%
1595 \fi
1596 \fi
1597 }%
1598 \global\let\@@numberunderhundredthdutch\@@numberunderhundredthdutch
1599 % \end{macrocode}
1600 % \setcounter{CodelineNo}{0}
1601 %\iffalse
1602 % \begin{macrocode}
1603 %</fc-dutch.def>
1604 % \end{macrocode}
1605 %\fi
1606 %\iffalse
1607 % \begin{macrocode}
1608 %<*fc-english.def>
1609 % \end{macrocode}
1610 %\fi
1611 % \subsubsection{fc-english.def}
1612 % English definitions
1613 % \begin{macrocode}
1614 \ProvidesFCLanguage{english}[2016/01/12]%
1615 % \end{macrocode}
1616 % Define macro that converts a number or count register (first
1617 % argument) to an ordinal, and stores the result in the
1618 % second argument, which should be a control sequence.
1619 % \begin{macrocode}
1620 \newcommand*\@ordinalMenglish[2]{%
1621 \def\@fc@ord{}%
1622 \@orgargctr=#1\relax
1623 \@ordinalctr=#1%
1624 \@FCmodulo{\@ordinalctr}{100}%
1625 \ifnum\@ordinalctr=11\relax
1626 \def\@fc@ord{th}%
1627 \else
1628 \ifnum\@ordinalctr=12\relax
1629 \def\@fc@ord{th}%
1630 \else
1631 \ifnum\@ordinalctr=13\relax
1632 \def\@fc@ord{th}%
1633 \else
1634 \@FCmodulo{\@ordinalctr}{10}%
1635 \ifcase\@ordinalctr
1636 \def\@fc@ord{th}% case 0
1637 \or \def\@fc@ord{st}% case 1
1638 \or \def\@fc@ord{nd}% case 2
1639 \or \def\@fc@ord{rd}% case 3
1640 \else
1641 \def\@fc@ord{th}% default case
1642 \fi
1643 \fi
1644 \fi
1645 \fi
1646 \edef#2{\number#1\relax\noexpand\fmtord{\@fc@ord}}%
1647 }%
1648 \global\let\@ordinalMenglish\@ordinalMenglish
1649 % \end{macrocode}
1650 % There is no gender difference in English, so make feminine and
1651 % neuter the same as the masculine.
1652 % \begin{macrocode}
1653 \global\let\@ordinalFenglish=\@ordinalMenglish
1654 \global\let\@ordinalNenglish=\@ordinalMenglish
1655 % \end{macrocode}
1656 % Define the macro that prints the value of a \TeX\ count register
1657 % as text. To make it easier, break it up into units, teens and
1658 % tens. First, the units: the argument should be between 0 and 9
1659 % inclusive.
1660 % \begin{macrocode}
1661 \newcommand*\@@unitstringenglish[1]{%
1662 \ifcase#1\relax
1663 zero%
1664 \or one%
1665 \or two%
1666 \or three%
1667 \or four%
1668 \or five%
1669 \or six%
1670 \or seven%
1671 \or eight%
1672 \or nine%
1673 \fi
1674 }%
1675 \global\let\@@unitstringenglish\@@unitstringenglish
1676 % \end{macrocode}
1677 % Next the tens, again the argument should be between 0 and 9
1678 % inclusive.
1679 % \begin{macrocode}
1680 \newcommand*\@@tenstringenglish[1]{%
1681 \ifcase#1\relax
1682 \or ten%
1683 \or twenty%
1684 \or thirty%
1685 \or forty%
1686 \or fifty%
1687 \or sixty%
1688 \or seventy%
1689 \or eighty%
1690 \or ninety%
1691 \fi
1692 }%
1693 \global\let\@@tenstringenglish\@@tenstringenglish
1694 % \end{macrocode}
1695 % Finally the teens, again the argument should be between 0 and 9
1696 % inclusive.
1697 % \begin{macrocode}
1698 \newcommand*\@@teenstringenglish[1]{%
1699 \ifcase#1\relax
1700 ten%
1701 \or eleven%
1702 \or twelve%
1703 \or thirteen%
1704 \or fourteen%
1705 \or fifteen%
1706 \or sixteen%
1707 \or seventeen%
1708 \or eighteen%
1709 \or nineteen%
1710 \fi
1711 }%
1712 \global\let\@@teenstringenglish\@@teenstringenglish
1713 % \end{macrocode}
1714 % As above, but with the initial letter in uppercase. The units:
1715 % \begin{macrocode}
1716 \newcommand*\@@Unitstringenglish[1]{%
1717 \ifcase#1\relax
1718 Zero%
1719 \or One%
1720 \or Two%
1721 \or Three%
1722 \or Four%
1723 \or Five%
1724 \or Six%
1725 \or Seven%
1726 \or Eight%
1727 \or Nine%
1728 \fi
1729 }%
1730 \global\let\@@Unitstringenglish\@@Unitstringenglish
1731 % \end{macrocode}
1732 % The tens:
1733 % \begin{macrocode}
1734 \newcommand*\@@Tenstringenglish[1]{%
1735 \ifcase#1\relax
1736 \or Ten%
1737 \or Twenty%
1738 \or Thirty%
1739 \or Forty%
1740 \or Fifty%
1741 \or Sixty%
1742 \or Seventy%
1743 \or Eighty%
1744 \or Ninety%
1745 \fi
1746 }%
1747 \global\let\@@Tenstringenglish\@@Tenstringenglish
1748 % \end{macrocode}
1749 % The teens:
1750 % \begin{macrocode}
1751 \newcommand*\@@Teenstringenglish[1]{%
1752 \ifcase#1\relax
1753 Ten%
1754 \or Eleven%
1755 \or Twelve%
1756 \or Thirteen%
1757 \or Fourteen%
1758 \or Fifteen%
1759 \or Sixteen%
1760 \or Seventeen%
1761 \or Eighteen%
1762 \or Nineteen%
1763 \fi
1764 }%
1765 \global\let\@@Teenstringenglish\@@Teenstringenglish
1766 % \end{macrocode}
1767 % This has changed in version 1.09, so that it now stores
1768 % the result in the second argument, but doesn't display anything.
1769 % Since it only affects internal macros, it shouldn't affect
1770 % documents created with older versions. (These internal macros are
1771 % not meant for use in documents.)
1772 % \begin{macrocode}
1773 \newcommand*\@@numberstringenglish[2]{%
1774 \ifnum#1>99999
1775 \PackageError{fmtcount}{Out of range}%
1776 {This macro only works for values less than 100000}%
1777 \else
1778 \ifnum#1<0
1779 \PackageError{fmtcount}{Negative numbers not permitted}%
1780 {This macro does not work for negative numbers, however
1781 you can try typing "minus" first, and then pass the modulus of
1782 this number}%
1783 \fi
1784 \fi
1785 \def#2{}%
1786 \@strctr=#1\relax \divide\@strctr by 1000\relax
1787 \ifnum\@strctr>9
1788 \divide\@strctr by 10
1789 \ifnum\@strctr>1\relax
1790 \let\@@fc@numstr#2\relax
1791 \edef#2{\@@fc@numstr\@tenstring{\@strctr}}%
1792 \@strctr=#1 \divide\@strctr by 1000\relax
1793 \@FCmodulo{\@strctr}{10}%
1794 \ifnum\@strctr>0\relax
1795 \let\@@fc@numstr#2\relax
1796 \edef#2{\@@fc@numstr-\@unitstring{\@strctr}}%
1797 \fi
1798 \else
1799 \@strctr=#1\relax
1800 \divide\@strctr by 1000\relax
1801 \@FCmodulo{\@strctr}{10}%
1802 \let\@@fc@numstr#2\relax
1803 \edef#2{\@@fc@numstr\@teenstring{\@strctr}}%
1804 \fi
1805 \let\@@fc@numstr#2\relax
1806 \edef#2{\@@fc@numstr\ \@thousand}%
1807 \else
1808 \ifnum\@strctr>0\relax
1809 \let\@@fc@numstr#2\relax
1810 \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ \@thousand}%
1811 \fi
1812 \fi
1813 \@strctr=#1\relax \@FCmodulo{\@strctr}{1000}%
1814 \divide\@strctr by 100
1815 \ifnum\@strctr>0\relax
1816 \ifnum#1>1000\relax
1817 \let\@@fc@numstr#2\relax
1818 \edef#2{\@@fc@numstr\ }%
1819 \fi
1820 \let\@@fc@numstr#2\relax
1821 \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ \@hundred}%
1822 \fi
1823 \@strctr=#1\relax \@FCmodulo{\@strctr}{100}%
1824 \ifnum#1>100\relax
1825 \ifnum\@strctr>0\relax
1826 \let\@@fc@numstr#2\relax
1827 \edef#2{\@@fc@numstr\ \@andname\ }%
1828 \fi
1829 \fi
1830 \ifnum\@strctr>19\relax
1831 \divide\@strctr by 10\relax
1832 \let\@@fc@numstr#2\relax
1833 \edef#2{\@@fc@numstr\@tenstring{\@strctr}}%
1834 \@strctr=#1\relax \@FCmodulo{\@strctr}{10}%
1835 \ifnum\@strctr>0\relax
1836 \let\@@fc@numstr#2\relax
1837 \edef#2{\@@fc@numstr-\@unitstring{\@strctr}}%
1838 \fi
1839 \else
1840 \ifnum\@strctr<10\relax
1841 \ifnum\@strctr=0\relax
1842 \ifnum#1<100\relax
1843 \let\@@fc@numstr#2\relax
1844 \edef#2{\@@fc@numstr\@unitstring{\@strctr}}%
1845 \fi
1846 \else
1847 \let\@@fc@numstr#2\relax
1848 \edef#2{\@@fc@numstr\@unitstring{\@strctr}}%
1849 \fi
1850 \else
1851 \@FCmodulo{\@strctr}{10}%
1852 \let\@@fc@numstr#2\relax
1853 \edef#2{\@@fc@numstr\@teenstring{\@strctr}}%
1854 \fi
1855 \fi
1856 }%
1857 \global\let\@@numberstringenglish\@@numberstringenglish
1858 % \end{macrocode}
1859 % All lower case version, the second argument must be a control
1860 % sequence.%
1861 % \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by
1862 % \cs{newcommand*} as robustness is handled now at top level in
1863 % \texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned
1864 % macros are \cs{@numberstringMenglish}, \cs{@ordinalstringMenglish},
1865 % and \cs{@OrdinalstringMenglish}}
1866 % \begin{macrocode}
1867 \newcommand*{\@numberstringMenglish}[2]{%
1868 \let\@unitstring=\@@unitstringenglish
1869 \let\@teenstring=\@@teenstringenglish
1870 \let\@tenstring=\@@tenstringenglish
1871 \def\@hundred{hundred}\def\@thousand{thousand}%
1872 \def\@andname{and}%
1873 \@@numberstringenglish{#1}{#2}%
1874 }%
1875 \global\let\@numberstringMenglish\@numberstringMenglish
1876 % \end{macrocode}
1877 % There is no gender in English, so make feminine and neuter the
1878 % same
1879 % as the masculine.
1880 % \begin{macrocode}
1881 \global\let\@numberstringFenglish=\@numberstringMenglish
1882 \global\let\@numberstringNenglish=\@numberstringMenglish
1883 % \end{macrocode}
1884 % This version makes the first letter of each word an uppercase
1885 % character (except ``and''). The second argument must be a control
1886 % sequence.
1887 % \begin{macrocode}
1888 \newcommand*\@NumberstringMenglish[2]{%
1889 \let\@unitstring=\@@Unitstringenglish
1890 \let\@teenstring=\@@Teenstringenglish
1891 \let\@tenstring=\@@Tenstringenglish
1892 \def\@hundred{Hundred}\def\@thousand{Thousand}%
1893 \def\@andname{and}%
1894 \@@numberstringenglish{#1}{#2}%
1895 }%
1896 \global\let\@NumberstringMenglish\@NumberstringMenglish
1897 % \end{macrocode}
1898 % There is no gender in English, so make feminine and neuter the
1899 % same
1900 % as the masculine.
1901 % \begin{macrocode}
1902 \global\let\@NumberstringFenglish=\@NumberstringMenglish
1903 \global\let\@NumberstringNenglish=\@NumberstringMenglish
1904 % \end{macrocode}
1905 % Define a macro that produces an ordinal as a string. Again, break
1906 % it up into units, teens and tens. First the units:
1907 % \begin{macrocode}
1908 \newcommand*\@@unitthstringenglish[1]{%
1909 \ifcase#1\relax
1910 zeroth%
1911 \or first%
1912 \or second%
1913 \or third%
1914 \or fourth%
1915 \or fifth%
1916 \or sixth%
1917 \or seventh%
1918 \or eighth%
1919 \or ninth%
1920 \fi
1921 }%
1922 \global\let\@@unitthstringenglish\@@unitthstringenglish
1923 % \end{macrocode}
1924 % Next the tens:
1925 % \begin{macrocode}
1926 \newcommand*\@@tenthstringenglish[1]{%
1927 \ifcase#1\relax
1928 \or tenth%
1929 \or twentieth%
1930 \or thirtieth%
1931 \or fortieth%
1932 \or fiftieth%
1933 \or sixtieth%
1934 \or seventieth%
1935 \or eightieth%
1936 \or ninetieth%
1937 \fi
1938 }%
1939 \global\let\@@tenthstringenglish\@@tenthstringenglish
1940 % \end{macrocode}
1941 % The teens:
1942 % \begin{macrocode}
1943 \newcommand*\@@teenthstringenglish[1]{%
1944 \ifcase#1\relax
1945 tenth%
1946 \or eleventh%
1947 \or twelfth%
1948 \or thirteenth%
1949 \or fourteenth%
1950 \or fifteenth%
1951 \or sixteenth%
1952 \or seventeenth%
1953 \or eighteenth%
1954 \or nineteenth%
1955 \fi
1956 }%
1957 \global\let\@@teenthstringenglish\@@teenthstringenglish
1958 % \end{macrocode}
1959 % As before, but with the first letter in upper case. The units:
1960 % \begin{macrocode}
1961 \newcommand*\@@Unitthstringenglish[1]{%
1962 \ifcase#1\relax
1963 Zeroth%
1964 \or First%
1965 \or Second%
1966 \or Third%
1967 \or Fourth%
1968 \or Fifth%
1969 \or Sixth%
1970 \or Seventh%
1971 \or Eighth%
1972 \or Ninth%
1973 \fi
1974 }%
1975 \global\let\@@Unitthstringenglish\@@Unitthstringenglish
1976 % \end{macrocode}
1977 % The tens:
1978 % \begin{macrocode}
1979 \newcommand*\@@Tenthstringenglish[1]{%
1980 \ifcase#1\relax
1981 \or Tenth%
1982 \or Twentieth%
1983 \or Thirtieth%
1984 \or Fortieth%
1985 \or Fiftieth%
1986 \or Sixtieth%
1987 \or Seventieth%
1988 \or Eightieth%
1989 \or Ninetieth%
1990 \fi
1991 }%
1992 \global\let\@@Tenthstringenglish\@@Tenthstringenglish
1993 % \end{macrocode}
1994 % The teens:
1995 % \begin{macrocode}
1996 \newcommand*\@@Teenthstringenglish[1]{%
1997 \ifcase#1\relax
1998 Tenth%
1999 \or Eleventh%
2000 \or Twelfth%
2001 \or Thirteenth%
2002 \or Fourteenth%
2003 \or Fifteenth%
2004 \or Sixteenth%
2005 \or Seventeenth%
2006 \or Eighteenth%
2007 \or Nineteenth%
2008 \fi
2009 }%
2010 \global\let\@@Teenthstringenglish\@@Teenthstringenglish
2011 % \end{macrocode}
2012 % Again, as from version 1.09, this has been changed to take two
2013 % arguments, where the second argument is a control sequence.
2014 % The resulting text is stored in the control sequence, and nothing
2015 % is displayed.
2016 % \begin{macrocode}
2017 \newcommand*\@@ordinalstringenglish[2]{%
2018 \@strctr=#1\relax
2019 \ifnum#1>99999
2020 \PackageError{fmtcount}{Out of range}%
2021 {This macro only works for values less than 100000 (value given: \number\@strctr)}%
2022 \else
2023 \ifnum#1<0
2024 \PackageError{fmtcount}{Negative numbers not permitted}%
2025 {This macro does not work for negative numbers, however
2026 you can try typing "minus" first, and then pass the modulus of
2027 this number}%
2028 \fi
2029 \def#2{}%
2030 \fi
2031 \@strctr=#1\relax \divide\@strctr by 1000\relax
2032 \ifnum\@strctr>9\relax
2033 % \end{macrocode}
2034 % \#1 is greater or equal to 10000
2035 % \begin{macrocode}
2036 \divide\@strctr by 10
2037 \ifnum\@strctr>1\relax
2038 \let\@@fc@ordstr#2\relax
2039 \edef#2{\@@fc@ordstr\@tenstring{\@strctr}}%
2040 \@strctr=#1\relax
2041 \divide\@strctr by 1000\relax
2042 \@FCmodulo{\@strctr}{10}%
2043 \ifnum\@strctr>0\relax
2044 \let\@@fc@ordstr#2\relax
2045 \edef#2{\@@fc@ordstr-\@unitstring{\@strctr}}%
2046 \fi
2047 \else
2048 \@strctr=#1\relax \divide\@strctr by 1000\relax
2049 \@FCmodulo{\@strctr}{10}%
2050 \let\@@fc@ordstr#2\relax
2051 \edef#2{\@@fc@ordstr\@teenstring{\@strctr}}%
2052 \fi
2053 \@strctr=#1\relax \@FCmodulo{\@strctr}{1000}%
2054 \ifnum\@strctr=0\relax
2055 \let\@@fc@ordstr#2\relax
2056 \edef#2{\@@fc@ordstr\ \@thousandth}%
2057 \else
2058 \let\@@fc@ordstr#2\relax
2059 \edef#2{\@@fc@ordstr\ \@thousand}%
2060 \fi
2061 \else
2062 \ifnum\@strctr>0\relax
2063 \let\@@fc@ordstr#2\relax
2064 \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}%
2065 \@strctr=#1\relax \@FCmodulo{\@strctr}{1000}%
2066 \let\@@fc@ordstr#2\relax
2067 \ifnum\@strctr=0\relax
2068 \edef#2{\@@fc@ordstr\ \@thousandth}%
2069 \else
2070 \edef#2{\@@fc@ordstr\ \@thousand}%
2071 \fi
2072 \fi
2073 \fi
2074 \@strctr=#1\relax \@FCmodulo{\@strctr}{1000}%
2075 \divide\@strctr by 100
2076 \ifnum\@strctr>0\relax
2077 \ifnum#1>1000\relax
2078 \let\@@fc@ordstr#2\relax
2079 \edef#2{\@@fc@ordstr\ }%
2080 \fi
2081 \let\@@fc@ordstr#2\relax
2082 \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}%
2083 \@strctr=#1\relax \@FCmodulo{\@strctr}{100}%
2084 \let\@@fc@ordstr#2\relax
2085 \ifnum\@strctr=0\relax
2086 \edef#2{\@@fc@ordstr\ \@hundredth}%
2087 \else
2088 \edef#2{\@@fc@ordstr\ \@hundred}%
2089 \fi
2090 \fi
2091 \@strctr=#1\relax \@FCmodulo{\@strctr}{100}%
2092 \ifnum#1>100\relax
2093 \ifnum\@strctr>0\relax
2094 \let\@@fc@ordstr#2\relax
2095 \edef#2{\@@fc@ordstr\ \@andname\ }%
2096 \fi
2097 \fi
2098 \ifnum\@strctr>19\relax
2099 \@tmpstrctr=\@strctr
2100 \divide\@strctr by 10\relax
2101 \@FCmodulo{\@tmpstrctr}{10}%
2102 \let\@@fc@ordstr#2\relax
2103 \ifnum\@tmpstrctr=0\relax
2104 \edef#2{\@@fc@ordstr\@tenthstring{\@strctr}}%
2105 \else
2106 \edef#2{\@@fc@ordstr\@tenstring{\@strctr}}%
2107 \fi
2108 \@strctr=#1\relax \@FCmodulo{\@strctr}{10}%
2109 \ifnum\@strctr>0\relax
2110 \let\@@fc@ordstr#2\relax
2111 \edef#2{\@@fc@ordstr-\@unitthstring{\@strctr}}%
2112 \fi
2113 \else
2114 \ifnum\@strctr<10\relax
2115 \ifnum\@strctr=0\relax
2116 \ifnum#1<100\relax
2117 \let\@@fc@ordstr#2\relax
2118 \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}%
2119 \fi
2120 \else
2121 \let\@@fc@ordstr#2\relax
2122 \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}%
2123 \fi
2124 \else
2125 \@FCmodulo{\@strctr}{10}%
2126 \let\@@fc@ordstr#2\relax
2127 \edef#2{\@@fc@ordstr\@teenthstring{\@strctr}}%
2128 \fi
2129 \fi
2130 }%
2131 \global\let\@@ordinalstringenglish\@@ordinalstringenglish
2132 % \end{macrocode}
2133 % All lower case version. Again, the second argument must be a
2134 % control sequence in which the resulting text is stored.
2135 % \begin{macrocode}
2136 \newcommand*{\@ordinalstringMenglish}[2]{%
2137 \let\@unitthstring=\@@unitthstringenglish
2138 \let\@teenthstring=\@@teenthstringenglish
2139 \let\@tenthstring=\@@tenthstringenglish
2140 \let\@unitstring=\@@unitstringenglish
2141 \let\@teenstring=\@@teenstringenglish
2142 \let\@tenstring=\@@tenstringenglish
2143 \def\@andname{and}%
2144 \def\@hundred{hundred}\def\@thousand{thousand}%
2145 \def\@hundredth{hundredth}\def\@thousandth{thousandth}%
2146 \@@ordinalstringenglish{#1}{#2}%
2147 }%
2148 \global\let\@ordinalstringMenglish\@ordinalstringMenglish
2149 % \end{macrocode}
2150 % No gender in English, so make feminine and neuter same as
2151 % masculine:
2152 % \begin{macrocode}
2153 \global\let\@ordinalstringFenglish=\@ordinalstringMenglish
2154 \global\let\@ordinalstringNenglish=\@ordinalstringMenglish
2155 % \end{macrocode}
2156 % First letter of each word in upper case:
2157 % \begin{macrocode}
2158 \newcommand*{\@OrdinalstringMenglish}[2]{%
2159 \let\@unitthstring=\@@Unitthstringenglish
2160 \let\@teenthstring=\@@Teenthstringenglish
2161 \let\@tenthstring=\@@Tenthstringenglish
2162 \let\@unitstring=\@@Unitstringenglish
2163 \let\@teenstring=\@@Teenstringenglish
2164 \let\@tenstring=\@@Tenstringenglish
2165 \def\@andname{and}%
2166 \def\@hundred{Hundred}\def\@thousand{Thousand}%
2167 \def\@hundredth{Hundredth}\def\@thousandth{Thousandth}%
2168 \@@ordinalstringenglish{#1}{#2}%
2169 }%
2170 \global\let\@OrdinalstringMenglish\@OrdinalstringMenglish
2171 % \end{macrocode}
2172 % No gender in English, so make feminine and neuter same as
2173 % masculine:
2174 % \begin{macrocode}
2175 \global\let\@OrdinalstringFenglish=\@OrdinalstringMenglish
2176 \global\let\@OrdinalstringNenglish=\@OrdinalstringMenglish
2177 % \end{macrocode}
2178 % \setcounter{CodelineNo}{0}
2179 %\iffalse
2180 % \begin{macrocode}
2181 %</fc-english.def>
2182 % \end{macrocode}
2183 %\fi
2184 %\iffalse
2185 % \begin{macrocode}
2186 %<*fc-francais.def>
2187 % \end{macrocode}
2188 %\fi
2189 % \subsubsection{fc-francais.def}
2190 % \begin{macrocode}
2191 \ProvidesFCLanguage{francais}[2013/08/17]%
2192 \FCloadlang{french}%
2193 % \end{macrocode}
2194 % Set \verb|francais| to be equivalent to \verb|french|.
2195 % \begin{macrocode}
2196 \global\let\@ordinalMfrancais=\@ordinalMfrench
2197 \global\let\@ordinalFfrancais=\@ordinalFfrench
2198 \global\let\@ordinalNfrancais=\@ordinalNfrench
2199 \global\let\@numberstringMfrancais=\@numberstringMfrench
2200 \global\let\@numberstringFfrancais=\@numberstringFfrench
2201 \global\let\@numberstringNfrancais=\@numberstringNfrench
2202 \global\let\@NumberstringMfrancais=\@NumberstringMfrench
2203 \global\let\@NumberstringFfrancais=\@NumberstringFfrench
2204 \global\let\@NumberstringNfrancais=\@NumberstringNfrench
2205 \global\let\@ordinalstringMfrancais=\@ordinalstringMfrench
2206 \global\let\@ordinalstringFfrancais=\@ordinalstringFfrench
2207 \global\let\@ordinalstringNfrancais=\@ordinalstringNfrench
2208 \global\let\@OrdinalstringMfrancais=\@OrdinalstringMfrench
2209 \global\let\@OrdinalstringFfrancais=\@OrdinalstringFfrench
2210 \global\let\@OrdinalstringNfrancais=\@OrdinalstringNfrench
2211 % \end{macrocode}
2212 % \setcounter{CodelineNo}{0}
2213 %\iffalse
2214 % \begin{macrocode}
2215 %</fc-francais.def>
2216 % \end{macrocode}
2217 %\fi
2218 %\iffalse
2219 % \begin{macrocode}
2220 %<*fc-french.def>
2221 % \end{macrocode}
2222 %\fi
2223 % \subsubsection{fc-french.def}
2224 % Definitions for French.
2225 % \begin{macrocode}
2226 \ProvidesFCLanguage{french}[2017/06/15]%
2227 % \end{macrocode}
2228 % Package \styfmt{fcprefix} is needed to format the prefix \meta{$n$}
2229 % in \meta{$n$}illion or \meta{$n$}illiard. Big numbers were
2230 % developped based on reference: \uref
2231 % {http://www.alain.be/boece/noms\_de\_nombre.html}. Package \styfmt
2232 % {fcprefix} is now loaded by \styfmt{fmtcount}.
2233 %
2234 % First of all we define two macros \cs{fc@gl@let} and \cs{fc@gl@def}
2235 % used in place of \cs{let} and \cs{def} within options setting
2236 % macros. This way we can control from outside these macros whether
2237 % the respective \cs{let} or \cs{def} is group-local or global. By
2238 % default they are defined to be group-local.
2239 % \changes{3.02}{2016/01/12}{First of all, make command definitions, as well as
2240 % options initial setting global. That is mainly a matter of:
2241 % \protect\begin{itemize}
2242 % \protect\item using \cs{gdef} instead of \cs{def},
2243 % \protect\item using \cs{global}\cs{let} instead of \cs{let}, and
2244 % \protect\item following \cs{newcommand*}\cs{\meta{foo}} by \cs{global}\cs{let}\cs{\meta{foo}}\cs{\meta{foo}}.
2245 % \protect\item using \cs{fc@gl@let} and \cs{fc@gl@def} in place of \cs{let}
2246 % \protect\item and \cs{def} within options setting macros in order to make intial
2247 % \protect\item setting global.
2248 % \protect\end{itemize}
2249 % Second, replace any \cs{DeclareRobustCommand} by \cs{newcommand*}
2250 % }
2251 % \begin{macrocode}
2252 \ifcsundef{fc@gl@let}{\global\let\fc@gl@let\let}{\PackageError{fmtcount}{Command already defined}{Command
2253 \protect\fc@gl@let\space already defined.}}
2254 \ifcsundef{fc@gl@def}{\global\let\fc@gl@def\def}{\PackageError{fmtcount}{Command already defined}{Command
2255 \protect\fc@gl@def\space already defined.}}
2256 % \end{macrocode}
2257 %
2258 % Options for controlling plural mark. First of all we define some temporary macro \cs{fc@french@set@plural}
2259 % in order to factorize code that defines an plural mark option:\newline\noindent
2260 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
2261 % \#1&key name,\\
2262 % \#2&key value,\\
2263 % \#3&configuration index for `\texttt{reformed}', \\
2264 % \#4&configuration index for `\texttt{traditional}',\\
2265 % \#5&configuration index for `\texttt{reformed o}', and\\
2266 % \#6&configuration index for `\texttt{traditional o}'.
2267 % \end{tabularx}
2268 % \begin{macrocode}
2269 \gdef\fc@french@set@plural#1#2#3#4#5#6{%
2270 \ifthenelse{\equal{#2}{reformed}}{%
2271 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{#3}%
2272 }{%
2273 \ifthenelse{\equal{#2}{traditional}}{%
2274 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{#4}%
2275 }{%
2276 \ifthenelse{\equal{#2}{reformed o}}{%
2277 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{#5}%
2278 }{%
2279 \ifthenelse{\equal{#2}{traditional o}}{%
2280 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{#6}%
2281 }{%
2282 \ifthenelse{\equal{#2}{always}}{%
2283 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{0}%
2284 }{%
2285 \ifthenelse{\equal{#2}{never}}{%
2286 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{1}%
2287 }{%
2288 \ifthenelse{\equal{#2}{multiple}}{%
2289 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{2}%
2290 }{%
2291 \ifthenelse{\equal{#2}{multiple g-last}}{%
2292 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{3}%
2293 }{%
2294 \ifthenelse{\equal{#2}{multiple l-last}}{%
2295 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{4}%
2296 }{%
2297 \ifthenelse{\equal{#2}{multiple lng-last}}{%
2298 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{5}%
2299 }{%
2300 \ifthenelse{\equal{#2}{multiple ng-last}}{%
2301 \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{6}%
2302 }{%
2303 \PackageError{fmtcount}{Unexpected argument}{%
2304 `#2' was unexpected: french option `#1 plural' expects `reformed', `traditional',
2305 `reformed o', `traditional o', `always', `never', `multiple', `multiple g-last',
2306 `multiple l-last', `multiple lng-last', or `multiple ng-last'.%
2307 }}}}}}}}}}}}}%
2308 % \end{macrocode}
2309 % Now a shorthand \cs{@tempa} is defined just to define all the options controlling plural mark. This
2310 % shorthand takes into account that `\texttt{reformed}' and `\texttt{traditional}' have the same effect, and
2311 % so do `\texttt{reformed o}' and `\texttt{traditional o}'.
2312 % \begin{macrocode}
2313 \def\@tempa#1#2#3{%
2314 \define@key{fcfrench}{#1 plural}[reformed]{%
2315 \fc@french@set@plural{#1}{##1}{#2}{#2}{#3}{#3}%
2316 }%
2317 % \end{macrocode}
2318 % Macro \cs{@tempb} takes a macro as argument, and makes its current
2319 % definition global. Like here it is useful when the macro name
2320 % contains non-letters, and we have to resort to the
2321 % \cs{csname}\ldots\cs{endcsname} construct.
2322 % \begin{macrocode}
2323 \expandafter\@tempb\csname KV@fcfrench@#1 plural\endcsname
2324 }%
2325 \def\@tempb#1{%
2326 \global\let#1#1
2327 }%
2328 \@tempa{vingt}{4}{5}
2329 \@tempa{cent}{4}{5}
2330 \@tempa{mil}{0}{0}
2331 \@tempa{n-illion}{2}{6}
2332 \@tempa{n-illiard}{2}{6}
2333 % \end{macrocode}
2334 % For option `\texttt{all plural}' we cannot use the \cs{@tempa} shorthand, because `\texttt{all plural}'
2335 % is just a multiplexer.
2336 % \begin{macrocode}
2337 \define@key{fcfrench}{all plural}[reformed]{%
2338 \csname KV@fcfrench@vingt plural\endcsname{#1}%
2339 \csname KV@fcfrench@cent plural\endcsname{#1}%
2340 \csname KV@fcfrench@mil plural\endcsname{#1}%
2341 \csname KV@fcfrench@n-illion plural\endcsname{#1}%
2342 \csname KV@fcfrench@n-illiard plural\endcsname{#1}%
2343 }%
2344 \expandafter\@tempb\csname KV@fcfrench@all plural\endcsname
2345 % \end{macrocode}
2346 % Now options `\texttt{dash or space}', we have three possible key values:\newline\noindent
2347 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
2348 % traditional& use dash for numbers below 100, except when `et' is used, and space otherwise\\
2349 % reformed& reform of 1990, use dash except with million \& milliard, and suchlikes,
2350 % i.e. \meta{$n$}illion and \meta{$n$}illiard,\\
2351 % always& always use dashes to separate all words
2352 % \end{tabularx}
2353 % \begin{macrocode}
2354 \define@key{fcfrench}{dash or space}[reformed]{%
2355 \ifthenelse{\equal{#1}{traditional}}{%
2356 \let\fc@frenchoptions@supermillion@dos\space%
2357 \let\fc@frenchoptions@submillion@dos\space
2358 }{%
2359 \ifthenelse{\equal{#1}{reformed}\or\equal{#1}{1990}}{%
2360 \let\fc@frenchoptions@supermillion@dos\space
2361 \def\fc@frenchoptions@submillion@dos{-}%
2362 }{%
2363 \ifthenelse{\equal{#1}{always}}{%
2364 \def\fc@frenchoptions@supermillion@dos{-}%
2365 \def\fc@frenchoptions@submillion@dos{-}%
2366 }{%
2367 \PackageError{fmtcount}{Unexpected argument}{%
2368 French option `dash or space' expects `always', `reformed' or `traditional'
2369 }
2370 }%
2371 }%
2372 }%
2373 }%
2374 % \end{macrocode}
2375 % Option `\texttt{scale}', can take 3 possible values:\newline\noindent
2376 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
2377 % long& for which \meta{\(n\)}illions \& \meta{\(n\)}illiards are used with \(10^{6\times n} = 1
2378 % \textrm{\meta{$n$}}illion\), and \(10^{6\times n+3} = 1 \textrm{\meta{$n$}}illiard\)\\
2379 % short& for which \meta{$n$}illions only are used with \(10^{3\times n+3} = 1
2380 % \textrm{\meta{$n$}illion}\)\\
2381 % recursive& for which \(10^{18} = \textrm{un milliard de milliards}\)
2382 % \end{tabularx}
2383 % \begin{macrocode}
2384 \define@key{fcfrench}{scale}[recursive]{%
2385 \ifthenelse{\equal{#1}{long}}{%
2386 \let\fc@poweroften\fc@@pot@longscalefrench
2387 }{%
2388 \ifthenelse{\equal{#1}{recursive}}{%
2389 \let\fc@poweroften\fc@@pot@recursivefrench
2390 }{%
2391 \ifthenelse{\equal{#1}{short}}{%
2392 \let\fc@poweroften\fc@@pot@shortscalefrench
2393 }{%
2394 \PackageError{fmtcount}{Unexpected argument}{%
2395 French option `scale' expects `long', `recursive' or `short'
2396 }
2397 }%
2398 }%
2399 }%
2400 }%
2401 % \end{macrocode}
2402 % Option `\texttt{n-illiard upto}' is ignored if `\texttt{scale}' is different from `\texttt{long}'. It can
2403 % take the following values:\newline\noindent
2404 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
2405 % infinity&in that case \meta{$n$}illard are never disabled,\\
2406 % infty&this is just a shorthand for `\texttt{infinity}', and\\
2407 % \textrm{\(n\)}& any integer that is such that \(n>0\), and that \(\forall k\in\mathbb{N}, k\geq n\),
2408 % number \(10^{6\times k+3}\) will be formatted as ``mille \meta{$n$}illions''
2409 % \end{tabularx}
2410 % \begin{macrocode}
2411 \define@key{fcfrench}{n-illiard upto}[infinity]{%
2412 \ifthenelse{\equal{#1}{infinity}}{%
2413 \def\fc@longscale@nilliard@upto{0}%
2414 }{%
2415 \ifthenelse{\equal{#1}{infty}}{%
2416 \def\fc@longscale@nilliard@upto{0}%
2417 }{%
2418 \if Q\ifnum9<1#1Q\fi\else
2419 \PackageError{fmtcount}{Unexpected argument}{%
2420 French option `milliard threshold' expects `infinity', or equivalently `infty', or a non negative
2421 integer.}%
2422 \fi
2423 \def\fc@longscale@nilliard@upto{#1}%
2424 }}%
2425 }%
2426 % \end{macrocode}
2427 % Now, the options `\texttt{france}', `\texttt{swiss}' and `\texttt{belgian}' are defined to select the
2428 % dialect to use. Macro \cs{@tempa} is just a local shorthand to define each one of this option.
2429 % \begin{macrocode}
2430 \def\@tempa#1{%
2431 \define@key{fcfrench}{#1}[]{%
2432 \PackageError{fmtcount}{Unexpected argument}{French option with key `#1' does not take
2433 any value}}%
2434 \csgdef{KV@fcfrench@#1@default}{%
2435 \fc@gl@def\fmtcount@french{#1}}%
2436 }%
2437 \@tempa{france}\@tempa{swiss}\@tempa{belgian}%
2438 % \end{macrocode}
2439 % Make `\texttt{france}' the default dialect for `\texttt{french}' language
2440 % \changes{3.01}{2014-12-18}{Move French specific stuff from \styfmt{fmtcount.sty} to \styfmt{fc-french.def}.}
2441 % \begin{macrocode}
2442 \gdef\fmtcount@french{france}%
2443 % \end{macrocode}
2444 % Now, option `\texttt{dialect}' is now defined so that `\texttt{france}', `\texttt{swiss}' and
2445 % `\texttt{belgian}' can also be used as key values, which is more conventional although less concise.
2446 % \begin{macrocode}
2447 \define@key{fcfrench}{dialect}[france]{%
2448 \ifthenelse{\equal{#1}{france}
2449 \or\equal{#1}{swiss}
2450 \or\equal{#1}{belgian}}{%
2451 \def\fmtcount@french{#1}}{%
2452 \PackageError{fmtcount}{Invalid value `#1' to french option dialect key}
2453 {Option `french' can only take the values `france',
2454 `belgian' or `swiss'}}}%
2455 \expandafter\@tempb\csname KV@fcfrench@dialect\endcsname
2456 % \end{macrocode}
2457 % The option \texttt{mil plural mark} allows to make the plural of \texttt{mil} to be regular,
2458 % i.e. \texttt{mils}, instead of \texttt{mille}. By default it is `\texttt{le}'.
2459 % \begin{macrocode}
2460 \define@key{fcfrench}{mil plural mark}[le]{%
2461 \def\fc@frenchoptions@mil@plural@mark{#1}}
2462 \expandafter\@tempb\csname KV@fcfrench@mil plural mark\endcsname
2463 % \end{macrocode}
2464 % Definition of case handling macros. This should be moved somewhere else to be commonalized between all
2465 % languages.\newline
2466 % \DescribeMacro{\fc@UpperCaseFirstLetter}The macro \cs{fc@UpperCaseFirstLetter} is such that
2467 % \cs{fc@UpperCaseFirstLetter}\meta{word}\cs{@nil} expands to \cs{word} with first letter capitalized and
2468 % remainder unchanged.
2469 % \begin{macrocode}
2470 \gdef\fc@UpperCaseFirstLetter#1#2\@nil{%
2471 \uppercase{#1}#2}
2472 % \end{macrocode}
2473 % \DescribeMacro{\fc@CaseIden}The macro \cs{fc@CaseIden} is such that \cs{fc@CaseIden}\meta{word}\cs{@nil}
2474 % expands to \cs{word} unchanged.
2475 % \begin{macrocode}
2476 \gdef\fc@CaseIden#1\@nil{%
2477 #1%
2478 }%
2479 % \end{macrocode}
2480 % \DescribeMacro{\fc@UpperCaseAll}The macro \cs{fc@UpperCaseAll} is such that \cs{fc@UpperCaseAll}\meta{word}\cs{@nil}
2481 % expands to \cs{word} all capitalized.
2482 % \begin{macrocode}
2483 \gdef\fc@UpperCaseAll#1\@nil{%
2484 \uppercase{#1}%
2485 }%
2486 % \end{macrocode}
2487 % \DescribeMacro{\fc@wcase}The macro \cs{fc@wcase} is the capitalizing macro for word-by-word
2488 % capitalization. By default we set it to identity, ie.\ no capitalization.
2489 % \begin{macrocode}
2490 \global\let\fc@wcase\fc@CaseIden
2491 % \end{macrocode}
2492 % \DescribeMacro{\fc@gcase}The macro \cs{fc@gcase} is the capitalizing macro for global (the completed number)
2493 % capitalization. By default we set it to identity, ie.\ no capitalization.
2494 % \changes{3.02}{2017/06/15}{Create new macro \cs{fc@gcase} for solving
2495 % \uref{http://github.com/nlct/fmtcount/issues/24}{Issue \#24} about capitalization in French.}
2496 % \begin{macrocode}
2497 \global\let\fc@gcase\fc@CaseIden
2498 % \end{macrocode}
2499 % \DescribeMacro{\fc@apply@gcase}The macro \cs{fc@apply@gcase} simply applies \cs{fc@gcase} to \cs{@tempa},
2500 % knowing that \cs{@tempa} is the macro containing the result of formatting.
2501 % \begin{macrocode}
2502 \gdef\fc@apply@gcase{%
2503 % \end{macrocode}
2504 % First of all we expand whatever \cs{fc@wcase}\ldots\cs{@nil} found within \cs{@tempa}.
2505 % \begin{macrocode}
2506 \protected@edef\@tempa{\@tempa}%
2507 \protected@edef\@tempa{\expandafter\fc@gcase\@tempa\@nil}%
2508 }
2509 % \end{macrocode}
2510 % \DescribeMacro{\@ordinalMfrench}
2511 % \changes{3.01}{2014-11-12}{Protect \cs{`}, for solving
2512 % \uref{http://github.com/nlct/fmtcount/issues/15}{Issue \#15}, and
2513 % correct non abbreviated ordinal finals}
2514 % \changes{3.01}{2014-11-20}{Add a package warning about non
2515 % abbreviated ordinals in French being incorrect. Change ``i\`eme''
2516 % to ``\`eme'' which is the most frequent non abbreviated form.}
2517 % \begin{macrocode}
2518 \newcommand*{\@ordinalMfrench}[2]{%
2519 \iffmtord@abbrv
2520 \ifnum#1=1 %
2521 \edef#2{\number#1\relax\noexpand\fmtord{er}}%
2522 \else
2523 \edef#2{\number#1\relax\noexpand\fmtord{e}}%
2524 \fi
2525 \else
2526 \PackageWarning{fmtcount}{Non abbreviated ordinal finals (`eme) are
2527 considered incorrect in French.}%
2528 \ifnum#1=1 %
2529 \edef#2{\number#1\relax\noexpand\fmtord{er}}%
2530 \else
2531 \protected@edef#2{\number#1\relax\noexpand\fmtord{\protect\`eme}}%
2532 \fi
2533 \fi}
2534 \global\let\@ordinalMfrench\@ordinalMfrench
2535 % \end{macrocode}
2536 % \DescribeMacro{\@ordinalFfrench}
2537 % \changes{3.01}{2014-11-10}{Protect \cs{`}, for solving
2538 % \uref{http://github.com/nlct/fmtcount/issues/15}{Issue \#15}}
2539 % \changes{3.01}{2014-11-20}{Add a package warning about non
2540 % abbreviated ordinals in French being incorrect. Change ``i\`eme''
2541 % to ``\`eme'' which is the most frequent non abbreviated form.}
2542 % \begin{macrocode}
2543 \newcommand*{\@ordinalFfrench}[2]{%
2544 \iffmtord@abbrv
2545 \ifnum#1=1 %
2546 \edef#2{\number#1\relax\noexpand\fmtord{re}}%
2547 \else
2548 \edef#2{\number#1\relax\noexpand\fmtord{e}}%
2549 \fi
2550 \else
2551 \PackageWarning{fmtcount}{Non abbreviated ordinal finals (`eme) are
2552 considered incorrect in French.}%
2553 \ifnum#1=1 %
2554 \protected@edef#2{\number#1\relax\noexpand\fmtord{\protect\`ere}}%
2555 \else
2556 \protected@edef#2{\number#1\relax\noexpand\fmtord{\protect\`eme}}%
2557 \fi
2558 \fi}
2559 \global\let\@ordinalFfrench\@ordinalFfrench
2560 % \end{macrocode}
2561 % In French neutral gender and masculine gender are formally identical.
2562 % \begin{macrocode}
2563 \global\let\@ordinalNfrench\@ordinalMfrench
2564 % \end{macrocode}
2565 % \DescribeMacro{\@@unitstringfrench}
2566 % \begin{macrocode}
2567 \newcommand*{\@@unitstringfrench}[1]{%
2568 \noexpand\fc@wcase
2569 \ifcase#1 %
2570 z\'ero%
2571 \or un%
2572 \or deux%
2573 \or trois%
2574 \or quatre%
2575 \or cinq%
2576 \or six%
2577 \or sept%
2578 \or huit%
2579 \or neuf%
2580 \fi
2581 \noexpand\@nil
2582 }%
2583 \global\let\@@unitstringfrench\@@unitstringfrench
2584 % \end{macrocode}
2585 % \DescribeMacro{\@@tenstringfrench}
2586 % \begin{macrocode}
2587 \newcommand*{\@@tenstringfrench}[1]{%
2588 \noexpand\fc@wcase
2589 \ifcase#1 %
2590 \or dix%
2591 \or vingt%
2592 \or trente%
2593 \or quarante%
2594 \or cinquante%
2595 \or soixante%
2596 \or septante%
2597 \or huitante%
2598 \or nonante%
2599 \or cent%
2600 \fi
2601 \noexpand\@nil
2602 }%
2603 \global\let\@@tenstringfrench\@@tenstringfrench
2604 % \end{macrocode}
2605 % \DescribeMacro{\@@teenstringfrench}
2606 % \begin{macrocode}
2607 \newcommand*{\@@teenstringfrench}[1]{%
2608 \noexpand\fc@wcase
2609 \ifcase#1 %
2610 dix%
2611 \or onze%
2612 \or douze%
2613 \or treize%
2614 \or quatorze%
2615 \or quinze%
2616 \or seize%
2617 \or dix\noexpand\@nil-\noexpand\fc@wcase sept%
2618 \or dix\noexpand\@nil-\noexpand\fc@wcase huit%
2619 \or dix\noexpand\@nil-\noexpand\fc@wcase neuf%
2620 \fi
2621 \noexpand\@nil
2622 }%
2623 \global\let\@@teenstringfrench\@@teenstringfrench
2624 % \end{macrocode}
2625 % \DescribeMacro{\@@seventiesfrench}
2626 % \begin{macrocode}
2627 \newcommand*{\@@seventiesfrench}[1]{%
2628 \@tenstring{6}%
2629 \ifnum#1=1 %
2630 \fc@frenchoptions@submillion@dos\@andname\fc@frenchoptions@submillion@dos
2631 \else
2632 -%
2633 \fi
2634 \@teenstring{#1}%
2635 }%
2636 \global\let\@@seventiesfrench\@@seventiesfrench
2637 % \end{macrocode}
2638 % \DescribeMacro{\@@eightiesfrench}Macro \cs{@@eightiesfrench} is used to format numbers in the interval
2639 % \([80\intv 89]\). Argument as follows:\newline
2640 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
2641 % \#1&digit \(d_{w}\) such that the number to be formatted is \(80 + d_{w}\)\\
2642 % \end{tabularx}
2643 % Implicit arguments as:\newline
2644 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
2645 % \cs{count0}&weight \(w\) of the number \(d_{w+1}d_{w}\) to be formatted\\
2646 % \cs{count1}&same as \cs{\#1}\\
2647 % \cs{count6}&input, counter giving the least weight of non zero digits in top level formatted number
2648 % integral part, with rounding down to a multiple of 3,\\
2649 % \cs{count9}&input, counter giving the power type of the power of ten following the eighties to be
2650 % formatted; that is `1' for ``mil'' and `2' for ``\meta{$n$}illion\textbar \meta{$n$}illiard''.
2651 % \end{tabularx}
2652 % \begin{macrocode}
2653 \newcommand*\@@eightiesfrench[1]{%
2654 \fc@wcase quatre\@nil-\noexpand\fc@wcase vingt%
2655 \ifnum#1>0 %
2656 \ifnum\fc@frenchoptions@vingt@plural=0 % vingt plural=always
2657 s%
2658 \fi
2659 \noexpand\@nil
2660 -\@unitstring{#1}%
2661 \else
2662 \ifcase\fc@frenchoptions@vingt@plural\space
2663 s% 0: always
2664 \or
2665 % 1: never
2666 \or
2667 s% 2: multiple
2668 \or
2669 % 3: multiple g-last
2670 \ifnum\count0=\count6\ifnum\count9=0 s\fi\fi
2671 \or
2672 % 4: multiple l-last
2673 \ifnum\count9=1 %
2674 \else
2675 s%
2676 \fi
2677 \or
2678 % 5: multiple lng-last
2679 \ifnum\count9=1 %
2680 \else
2681 \ifnum\count0>0 %
2682 s%
2683 \fi
2684 \fi
2685 \or
2686 % or 6: multiple ng-last
2687 \ifnum\count0>0 %
2688 s%
2689 \fi
2690 \fi
2691 \noexpand\@nil
2692 \fi
2693 }%
2694 \global\let\@@eightiesfrench\@@eightiesfrench
2695 \newcommand*{\@@ninetiesfrench}[1]{%
2696 \fc@wcase quatre\@nil-\noexpand\fc@wcase vingt%
2697 \ifnum\fc@frenchoptions@vingt@plural=0 % vingt plural=always
2698 s%
2699 \fi
2700 \noexpand\@nil
2701 -\@teenstring{#1}%
2702 }%
2703 \global\let\@@ninetiesfrench\@@ninetiesfrench
2704 \newcommand*{\@@seventiesfrenchswiss}[1]{%
2705 \@tenstring{7}%
2706 \ifnum#1=1\ \@andname\ \fi
2707 \ifnum#1>1-\fi
2708 \ifnum#1>0 \@unitstring{#1}\fi
2709 }%
2710 \global\let\@@seventiesfrenchswiss\@@seventiesfrenchswiss
2711 \newcommand*{\@@eightiesfrenchswiss}[1]{%
2712 \@tenstring{8}%
2713 \ifnum#1=1\ \@andname\ \fi
2714 \ifnum#1>1-\fi
2715 \ifnum#1>0 \@unitstring{#1}\fi
2716 }%
2717 \global\let\@@eightiesfrenchswiss\@@eightiesfrenchswiss
2718 \newcommand*{\@@ninetiesfrenchswiss}[1]{%
2719 \@tenstring{9}%
2720 \ifnum#1=1\ \@andname\ \fi
2721 \ifnum#1>1-\fi
2722 \ifnum#1>0 \@unitstring{#1}\fi
2723 }%
2724 \global\let\@@ninetiesfrenchswiss\@@ninetiesfrenchswiss
2725 % \end{macrocode}
2726 % \DescribeMacro{\fc@french@common}Macro \cs{fc@french@common} does all the preliminary settings common to all
2727 % French dialects \& formatting options.
2728 % \begin{macrocode}
2729 \newcommand*\fc@french@common{%
2730 \let\fc@wcase\fc@CaseIden
2731 \let\@unitstring=\@@unitstringfrench
2732 \let\@teenstring=\@@teenstringfrench
2733 \let\@tenstring=\@@tenstringfrench
2734 \def\@hundred{cent}%
2735 \def\@andname{et}%
2736 }%
2737 \global\let\fc@french@common\fc@french@common
2738 % \end{macrocode}
2739 % \begin{macrocode}
2740 \newcommand*{\@numberstringMfrenchswiss}[2]{%
2741 \fc@french@common
2742 \let\fc@gcase\fc@CaseIden
2743 \let\@seventies=\@@seventiesfrenchswiss
2744 \let\@eighties=\@@eightiesfrenchswiss
2745 \let\@nineties=\@@ninetiesfrenchswiss
2746 \let\fc@nbrstr@preamble\@empty
2747 \let\fc@nbrstr@postamble\@empty
2748 \@@numberstringfrench{#1}{#2}}
2749 \global\let\@numberstringMfrenchswiss\@numberstringMfrenchswiss
2750 \newcommand*{\@numberstringMfrenchfrance}[2]{%
2751 \fc@french@common
2752 \let\fc@gcase\fc@CaseIden
2753 \let\@seventies=\@@seventiesfrench
2754 \let\@eighties=\@@eightiesfrench
2755 \let\@nineties=\@@ninetiesfrench
2756 \let\fc@nbrstr@preamble\@empty
2757 \let\fc@nbrstr@postamble\@empty
2758 \@@numberstringfrench{#1}{#2}}
2759 \global\let\@numberstringMfrenchfrance\@numberstringMfrenchfrance
2760 \newcommand*{\@numberstringMfrenchbelgian}[2]{%
2761 \fc@french@common
2762 \let\fc@gcase\fc@CaseIden
2763 \let\@seventies=\@@seventiesfrenchswiss
2764 \let\@eighties=\@@eightiesfrench
2765 \let\@nineties=\@@ninetiesfrench
2766 \let\fc@nbrstr@preamble\@empty
2767 \let\fc@nbrstr@postamble\@empty
2768 \@@numberstringfrench{#1}{#2}}
2769 \global\let\@numberstringMfrenchbelgian\@numberstringMfrenchbelgian
2770 \let\@numberstringMfrench=\@numberstringMfrenchfrance
2771 \newcommand*{\@numberstringFfrenchswiss}[2]{%
2772 \fc@french@common
2773 \let\fc@gcase\fc@CaseIden
2774 \let\@seventies=\@@seventiesfrenchswiss
2775 \let\@eighties=\@@eightiesfrenchswiss
2776 \let\@nineties=\@@ninetiesfrenchswiss
2777 \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble
2778 \let\fc@nbrstr@postamble\@empty
2779 \@@numberstringfrench{#1}{#2}}
2780 \global\let\@numberstringFfrenchswiss\@numberstringFfrenchswiss
2781 \newcommand*{\@numberstringFfrenchfrance}[2]{%
2782 \fc@french@common
2783 \let\fc@gcase\fc@CaseIden
2784 \let\@seventies=\@@seventiesfrench
2785 \let\@eighties=\@@eightiesfrench
2786 \let\@nineties=\@@ninetiesfrench
2787 \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble
2788 \let\fc@nbrstr@postamble\@empty
2789 \@@numberstringfrench{#1}{#2}}
2790 \global\let\@numberstringFfrenchfrance\@numberstringFfrenchfrance
2791 \newcommand*{\@numberstringFfrenchbelgian}[2]{%
2792 \fc@french@common
2793 \let\fc@gcase\fc@CaseIden
2794 \let\@seventies=\@@seventiesfrenchswiss
2795 \let\@eighties=\@@eightiesfrench
2796 \let\@nineties=\@@ninetiesfrench
2797 \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble
2798 \let\fc@nbrstr@postamble\@empty
2799 \@@numberstringfrench{#1}{#2}}
2800 \global\let\@numberstringFfrenchbelgian\@numberstringFfrenchbelgian
2801 \global\let\@numberstringFfrench=\@numberstringFfrenchfrance
2802 \global\let\@ordinalstringNfrench\@ordinalstringMfrench
2803 \newcommand*{\@NumberstringMfrenchswiss}[2]{%
2804 \fc@french@common
2805 \let\fc@gcase\fc@UpperCaseFirstLetter
2806 \let\@seventies=\@@seventiesfrenchswiss
2807 \let\@eighties=\@@eightiesfrenchswiss
2808 \let\@nineties=\@@ninetiesfrenchswiss
2809 \let\fc@nbrstr@preamble\@empty
2810 \let\fc@nbrstr@postamble\fc@apply@gcase
2811 \@@numberstringfrench{#1}{#2}}
2812 \global\let\@NumberstringMfrenchswiss\@NumberstringMfrenchswiss
2813 \newcommand*{\@NumberstringMfrenchfrance}[2]{%
2814 \fc@french@common
2815 \let\fc@gcase\fc@UpperCaseFirstLetter
2816 \let\@seventies=\@@seventiesfrench
2817 \let\@eighties=\@@eightiesfrench
2818 \let\@nineties=\@@ninetiesfrench
2819 \let\fc@nbrstr@preamble\@empty
2820 \let\fc@nbrstr@postamble\fc@apply@gcase
2821 \@@numberstringfrench{#1}{#2}}
2822 \global\let\@NumberstringMfrenchfrance\@NumberstringMfrenchfrance
2823 \newcommand*{\@NumberstringMfrenchbelgian}[2]{%
2824 \fc@french@common
2825 \let\fc@gcase\fc@UpperCaseFirstLetter
2826 \let\@seventies=\@@seventiesfrenchswiss
2827 \let\@eighties=\@@eightiesfrench
2828 \let\@nineties=\@@ninetiesfrench
2829 \let\fc@nbrstr@preamble\@empty
2830 \let\fc@nbrstr@postamble\fc@apply@gcase
2831 \@@numberstringfrench{#1}{#2}}
2832 \global\let\@NumberstringMfrenchbelgian\@NumberstringMfrenchbelgian
2833 \global\let\@NumberstringMfrench=\@NumberstringMfrenchfrance
2834 \newcommand*{\@NumberstringFfrenchswiss}[2]{%
2835 \fc@french@common
2836 \let\fc@gcase\fc@UpperCaseFirstLetter
2837 \let\@seventies=\@@seventiesfrenchswiss
2838 \let\@eighties=\@@eightiesfrenchswiss
2839 \let\@nineties=\@@ninetiesfrenchswiss
2840 \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble
2841 \let\fc@nbrstr@postamble\fc@apply@gcase
2842 \@@numberstringfrench{#1}{#2}}
2843 \global\let\@NumberstringFfrenchswiss\@NumberstringFfrenchswiss
2844 \newcommand*{\@NumberstringFfrenchfrance}[2]{%
2845 \fc@french@common
2846 \let\fc@gcase\fc@UpperCaseFirstLetter
2847 \let\@seventies=\@@seventiesfrench
2848 \let\@eighties=\@@eightiesfrench
2849 \let\@nineties=\@@ninetiesfrench
2850 \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble
2851 \let\fc@nbrstr@postamble\fc@apply@gcase
2852 \@@numberstringfrench{#1}{#2}}
2853 \global\let\@NumberstringFfrenchfrance\@NumberstringFfrenchfrance
2854 \newcommand*{\@NumberstringFfrenchbelgian}[2]{%
2855 \fc@french@common
2856 \let\fc@gcase\fc@UpperCaseFirstLetter
2857 \let\@seventies=\@@seventiesfrenchswiss
2858 \let\@eighties=\@@eightiesfrench
2859 \let\@nineties=\@@ninetiesfrench
2860 \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble
2861 \let\fc@nbrstr@postamble\fc@apply@gcase
2862 \@@numberstringfrench{#1}{#2}}
2863 \global\let\@NumberstringFfrenchbelgian\@NumberstringFfrenchbelgian
2864 \global\let\@NumberstringFfrench=\@NumberstringFfrenchfrance
2865 \global\let\@NumberstringNfrench\@NumberstringMfrench
2866 \newcommand*{\@ordinalstringMfrenchswiss}[2]{%
2867 \fc@french@common
2868 \let\fc@gcase\fc@CaseIden
2869 \let\fc@first\fc@@firstfrench
2870 \let\@seventies=\@@seventiesfrenchswiss
2871 \let\@eighties=\@@eightiesfrenchswiss
2872 \let\@nineties=\@@ninetiesfrenchswiss
2873 \@@ordinalstringfrench{#1}{#2}%
2874 }%
2875 \global\let\@ordinalstringMfrenchswiss\@ordinalstringMfrenchswiss
2876 \newcommand*\fc@@firstfrench{premier}
2877 \global\let\fc@@firstfrench\fc@@firstfrench
2878 % \end{macrocode}
2879 % \changes{3.01}{2014-11-10}{Protect \cs{`}, for solving
2880 % \uref{http://github.com/nlct/fmtcount/issues/15}{Issue \#15}}
2881 % \begin{macrocode}
2882 \newcommand*\fc@@firstFfrench{premi\protect\`ere}
2883 \global\let\fc@@firstFfrench\fc@@firstFfrench
2884 \newcommand*{\@ordinalstringMfrenchfrance}[2]{%
2885 \fc@french@common
2886 \let\fc@gcase\fc@CaseIden
2887 \let\fc@first=\fc@@firstfrench
2888 \let\@seventies=\@@seventiesfrench
2889 \let\@eighties=\@@eightiesfrench
2890 \let\@nineties=\@@ninetiesfrench
2891 \@@ordinalstringfrench{#1}{#2}}
2892 \global\let\@ordinalstringMfrenchfrance\@ordinalstringMfrenchfrance
2893 \newcommand*{\@ordinalstringMfrenchbelgian}[2]{%
2894 \fc@french@common
2895 \let\fc@gcase\fc@CaseIden
2896 \let\fc@first=\fc@@firstfrench
2897 \let\@seventies=\@@seventiesfrench
2898 \let\@eighties=\@@eightiesfrench
2899 \let\@nineties=\@@ninetiesfrench
2900 \@@ordinalstringfrench{#1}{#2}%
2901 }%
2902 \global\let\@ordinalstringMfrenchbelgian\@ordinalstringMfrenchbelgian
2903 \global\let\@ordinalstringMfrench=\@ordinalstringMfrenchfrance
2904 \newcommand*{\@ordinalstringFfrenchswiss}[2]{%
2905 \fc@french@common
2906 \let\fc@gcase\fc@CaseIden
2907 \let\fc@first\fc@@firstFfrench
2908 \let\@seventies=\@@seventiesfrenchswiss
2909 \let\@eighties=\@@eightiesfrenchswiss
2910 \let\@nineties=\@@ninetiesfrenchswiss
2911 \@@ordinalstringfrench{#1}{#2}%
2912 }%
2913 \global\let\@ordinalstringFfrenchswiss\@ordinalstringFfrenchswiss
2914 \newcommand*{\@ordinalstringFfrenchfrance}[2]{%
2915 \fc@french@common
2916 \let\fc@gcase\fc@CaseIden
2917 \let\fc@first=\fc@@firstFfrench
2918 \let\@seventies=\@@seventiesfrench
2919 \let\@eighties=\@@eightiesfrench
2920 \let\@nineties=\@@ninetiesfrench
2921 \@@ordinalstringfrench{#1}{#2}%
2922 }%
2923 \global\let\@ordinalstringFfrenchfrance\@ordinalstringFfrenchfrance
2924 \newcommand*{\@ordinalstringFfrenchbelgian}[2]{%
2925 \fc@french@common
2926 \let\fc@gcase\fc@CaseIden
2927 \let\fc@first=\fc@@firstFfrench
2928 \let\@seventies=\@@seventiesfrench
2929 \let\@eighties=\@@eightiesfrench
2930 \let\@nineties=\@@ninetiesfrench
2931 \@@ordinalstringfrench{#1}{#2}%
2932 }%
2933 \global\let\@ordinalstringFfrenchbelgian\@ordinalstringFfrenchbelgian
2934 \global\let\@ordinalstringFfrench=\@ordinalstringFfrenchfrance
2935 \global\let\@ordinalstringNfrench\@ordinalstringMfrench
2936 \newcommand*{\@OrdinalstringMfrenchswiss}[2]{%
2937 \fc@french@common
2938 \let\fc@gcase\fc@UpperCaseFirstLetter
2939 \let\fc@first=\fc@@firstfrench
2940 \let\@seventies=\@@seventiesfrenchswiss
2941 \let\@eighties=\@@eightiesfrenchswiss
2942 \let\@nineties=\@@ninetiesfrenchswiss
2943 \@@ordinalstringfrench{#1}{#2}%
2944 }%
2945 \global\let\@OrdinalstringMfrenchswiss\@OrdinalstringMfrenchswiss
2946 \newcommand*{\@OrdinalstringMfrenchfrance}[2]{%
2947 \fc@french@common
2948 \let\fc@gcase\fc@UpperCaseFirstLetter
2949 \let\fc@first\fc@@firstfrench
2950 \let\@seventies=\@@seventiesfrench
2951 \let\@eighties=\@@eightiesfrench
2952 \let\@nineties=\@@ninetiesfrench
2953 \@@ordinalstringfrench{#1}{#2}%
2954 }%
2955 \global\let\@OrdinalstringMfrenchfrance\@OrdinalstringMfrenchfrance
2956 \newcommand*{\@OrdinalstringMfrenchbelgian}[2]{%
2957 \fc@french@common
2958 \let\fc@gcase\fc@UpperCaseFirstLetter
2959 \let\fc@first\fc@@firstfrench
2960 \let\@seventies=\@@seventiesfrench
2961 \let\@eighties=\@@eightiesfrench
2962 \let\@nineties=\@@ninetiesfrench
2963 \@@ordinalstringfrench{#1}{#2}%
2964 }%
2965 \global\let\@OrdinalstringMfrenchbelgian\@OrdinalstringMfrenchbelgian
2966 \global\let\@OrdinalstringMfrench=\@OrdinalstringMfrenchfrance
2967 \newcommand*{\@OrdinalstringFfrenchswiss}[2]{%
2968 \fc@french@common
2969 \let\fc@gcase\fc@UpperCaseFirstLetter
2970 \let\fc@first\fc@@firstfrench
2971 \let\@seventies=\@@seventiesfrenchswiss
2972 \let\@eighties=\@@eightiesfrenchswiss
2973 \let\@nineties=\@@ninetiesfrenchswiss
2974 \@@ordinalstringfrench{#1}{#2}%
2975 }%
2976 \global\let\@OrdinalstringFfrenchswiss\@OrdinalstringFfrenchswiss
2977 \newcommand*{\@OrdinalstringFfrenchfrance}[2]{%
2978 \fc@french@common
2979 \let\fc@gcase\fc@UpperCaseFirstLetter
2980 \let\fc@first\fc@@firstFfrench
2981 \let\@seventies=\@@seventiesfrench
2982 \let\@eighties=\@@eightiesfrench
2983 \let\@nineties=\@@ninetiesfrench
2984 \@@ordinalstringfrench{#1}{#2}%
2985 }%
2986 \global\let\@OrdinalstringFfrenchfrance\@OrdinalstringFfrenchfrance
2987 \newcommand*{\@OrdinalstringFfrenchbelgian}[2]{%
2988 \fc@french@common
2989 \let\fc@gcase\fc@UpperCaseFirstLetter
2990 \let\fc@first\fc@@firstFfrench
2991 \let\@seventies=\@@seventiesfrench
2992 \let\@eighties=\@@eightiesfrench
2993 \let\@nineties=\@@ninetiesfrench
2994 \@@ordinalstringfrench{#1}{#2}%
2995 }%
2996 \global\let\@OrdinalstringFfrenchbelgian\@OrdinalstringFfrenchbelgian
2997 \global\let\@OrdinalstringFfrench=\@OrdinalstringFfrenchfrance
2998 \global\let\@OrdinalstringNfrench\@OrdinalstringMfrench
2999 % \end{macrocode}
3000 % \DescribeMacro{\fc@@do@plural@mark}Macro \cs{fc@@do@plural@mark} will expand to the plural mark of
3001 % \meta{$n$}illiard, \meta{$n$}illion, mil, cent or vingt, whichever is applicable. First check that the macro
3002 % is not yet defined.
3003 % \begin{macrocode}
3004 \ifcsundef{fc@@do@plural@mark}{}%
3005 {\PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3006 `fc@@do@plural@mark'}}
3007 % \end{macrocode}
3008 % Arguments as follows:\newline
3009 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3010 % \#1&plural mark, `s' in general, but for mil it is \cs{fc@frenchoptions@mil@plural@mark}\\
3011 % \end{tabularx}
3012 % Implicit arguments as follows:\newline
3013 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3014 % \cs{count0}&input, counter giving the weight \(w\), this is expected to be multiple of 3,\\
3015 % \cs{count1}&input, counter giving the plural value of multiplied object \meta{$n$}illiard,
3016 % \meta{$n$}illion, mil, cent or vingt, whichever is applicable, that is to say it is 1 when the considered
3017 % objet is not multiplied, and 2 or more when it is multiplied,\\
3018 % \cs{count6}&input, counter giving the least weight of non zero digits in top level formatted number
3019 % integral part, with rounding down to a multiple of 3,\\
3020 % \cs{count10}&input, counter giving the plural mark control option.\\
3021 % \end{tabularx}
3022 % \begin{macrocode}
3023 \def\fc@@do@plural@mark#1{%
3024 \ifcase\count10 %
3025 #1% 0=always
3026 \or% 1=never
3027 \or% 2=multiple
3028 \ifnum\count1>1 %
3029 #1%
3030 \fi
3031 \or% 3= multiple g-last
3032 \ifnum\count1>1 %
3033 \ifnum\count0=\count6 %
3034 #1%
3035 \fi
3036 \fi
3037 \or% 4= multiple l-last
3038 \ifnum\count1>1 %
3039 \ifnum\count9=1 %
3040 \else
3041 #1%
3042 \fi
3043 \fi
3044 \or% 5= multiple lng-last
3045 \ifnum\count1>1 %
3046 \ifnum\count9=1 %
3047 \else
3048 \if\count0>\count6 %
3049 #1%
3050 \fi
3051 \fi
3052 \fi
3053 \or% 6= multiple ng-last
3054 \ifnum\count1>1 %
3055 \ifnum\count0>\count6 %
3056 #1%
3057 \fi
3058 \fi
3059 \fi
3060 }%
3061 \global\let\fc@@do@plural@mark\fc@@do@plural@mark
3062 % \end{macrocode}
3063 % \DescribeMacro{\fc@@nbrstr@Fpreamble}Macro \cs{fc@@nbrstr@Fpreamble} do the necessary preliminaries before
3064 % formatting a cardinal with feminine gender.
3065 % \begin{macrocode}
3066 \ifcsundef{fc@@nbrstr@Fpreamble}{}{%
3067 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3068 `fc@@nbrstr@Fpreamble'}}
3069 % \end{macrocode}
3070 % \DescribeMacro{\fc@@nbrstr@Fpreamble}
3071 % \begin{macrocode}
3072 \def\fc@@nbrstr@Fpreamble{%
3073 \fc@read@unit{\count1}{0}%
3074 \ifnum\count1=1 %
3075 \let\fc@wcase@save\fc@wcase
3076 \def\fc@wcase{\noexpand\fc@wcase}%
3077 \def\@nil{\noexpand\@nil}%
3078 \let\fc@nbrstr@postamble\fc@@nbrstr@Fpostamble
3079 \fi
3080 }%
3081 \global\let\fc@@nbrstr@Fpreamble\fc@@nbrstr@Fpreamble
3082 % \end{macrocode}
3083 % \DescribeMacro{\fc@@nbrstr@Fpostamble}
3084 % \begin{macrocode}
3085 \def\fc@@nbrstr@Fpostamble{%
3086 \let\fc@wcase\fc@wcase@save
3087 \expandafter\fc@get@last@word\expandafter{\@tempa}\@tempb\@tempc
3088 \def\@tempd{un}%
3089 \ifx\@tempc\@tempd
3090 \let\@tempc\@tempa
3091 \edef\@tempa{\@tempb\fc@wcase une\@nil}%
3092 \fi
3093 }%
3094 \global\let\fc@@nbrstr@Fpostamble\fc@@nbrstr@Fpostamble
3095 % \end{macrocode}
3096 % \DescribeMacro{\fc@@pot@longscalefrench}Macro \cs{fc@@pot@longscalefrench} is used to produce
3097 % powers of ten with long scale convention. The long scale convention is correct for French and elsewhere in
3098 % Europe. First we check that the macro is not yet defined.
3099 % \begin{macrocode}
3100 \ifcsundef{fc@@pot@longscalefrench}{}{%
3101 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3102 `fc@@pot@longscalefrench'}}
3103 % \end{macrocode}
3104 % Argument are as follows:\def\interface{\newline\noindent
3105 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3106 % \#1&input, plural value of \(d\), that is to say: let \(d\) be the number multiplying the considered power
3107 % of ten, then the plural value \texttt{\#2} is expected to be \(0\) if \(d=0\), \(1\) if \(d=1\), or \(>1\)
3108 % if \(d>1\)\\
3109 % \#2&output, counter, maybe \(0\) when power of ten is \(1\), \(1\) when power of ten starts with
3110 % ``mil(le)'', or \(2\) when power of ten is a ``\meta{$n$}illion(s)\textbar\meta{$n$}illiard(s)''\\
3111 % \#3&output, macro into which to place the formatted power of ten
3112 % \end{tabularx}
3113 % Implicit arguments as follows:\newline
3114 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3115 % \cs{count0}&input, counter giving the weight \(w\), this is expected to be multiple of 3\\
3116 % \end{tabularx}
3117 % }\interface
3118 % \begin{macrocode}
3119 \def\fc@@pot@longscalefrench#1#2#3{%
3120 {%
3121 % \end{macrocode}
3122 % First the input arguments are saved into local objects: \texttt{\#1} and \texttt{\#1} are respectively saved
3123 % into \cs{@tempa} and \cs{@tempb}.
3124 % \begin{macrocode}
3125 \edef\@tempb{\number#1}%
3126 % \end{macrocode}
3127 % Let \cs{count1} be the plural value.
3128 % \begin{macrocode}
3129 \count1=\@tempb
3130 % \end{macrocode}
3131 % Let \(n\) and \(r\) the the quotient and remainder of division of weight \(w\) by \(6\), that is to say \(w
3132 % = n\times 6 + r\) and \(0\leq r < 6\), then \cs{count2} is set to \(n\) and \cs{count3} is set to \(r\).
3133 % \begin{macrocode}
3134 \count2\count0 %
3135 \divide\count2 by 6 %
3136 \count3\count2 %
3137 \multiply\count3 by 6 %
3138 \count3-\count3 %
3139 \advance\count3 by \count0 %
3140 \ifnum\count0>0 %
3141 % \end{macrocode}
3142 % If weight \(w\) (a.k.a. \cs{count0}) is such that \(w>0\), then \(w\geq 3\) because \(w\) is a multiple of
3143 % \(3\). So we \emph{may} have to append ``mil(le)'' or ``\meta{$n$}illion(s)'' or ``\meta{$n$}illiard(s)''.
3144 % \begin{macrocode}
3145 \ifnum\count1>0 %
3146 % \end{macrocode}
3147 % Plural value is \(>0\) so have at least one ``mil(le)'' or ``\meta{$n$}illion(s)'' or
3148 % ``\meta{$n$}illiard(s)''. We need to distinguish between the case of ``mil(le)'' and that of
3149 % ``\meta{$n$}illion(s)'' or ``\meta{$n$}illiard(s)'', so we \cs{def}ine \cs{@temph} to `\texttt{1}' for
3150 % ``mil(le)'', and to `\texttt{2}' otherwise.
3151 % \begin{macrocode}
3152 \edef\@temph{%
3153 \ifnum\count2=0 % weight=3
3154 % \end{macrocode}
3155 % Here \(n=0\), with \(n=w\div 6\),but we also know that \(w\geq 3\), so we have \(w=3\) which means we are in
3156 % the ``mil(le)'' case.
3157 % \begin{macrocode}
3158 1%
3159 \else
3160 \ifnum\count3>2 %
3161 % \end{macrocode}
3162 % Here we are in the case of \(3\leq r < 6\), with \(r\) the remainder of division of weight \(w\) by \(6\),
3163 % we should have ``\meta{$n$}illiard(s)'', but that may also be ``mil(le)'' instead depending on
3164 % option `\texttt{n-illiard upto}', known as \cs{fc@longscale@nilliard@upto}.
3165 % \begin{macrocode}
3166 \ifnum\fc@longscale@nilliard@upto=0 %
3167 % \end{macrocode}
3168 % Here option `\texttt{n-illiard upto}' is `\texttt{infinity}', so we always use ``\meta{$n$}illiard(s)''.
3169 % \begin{macrocode}
3170 2%
3171 \else
3172 % \end{macrocode}
3173 % Here option `\texttt{n-illiard upto}' indicate some threshold to which to compare \(n\)
3174 % (a.k.a. \cs{count2}).
3175 % \begin{macrocode}
3176 \ifnum\count2>\fc@longscale@nilliard@upto
3177 1%
3178 \else
3179 2%
3180 \fi
3181 \fi
3182 \else
3183 2%
3184 \fi
3185 \fi
3186 }%
3187 \ifnum\@temph=1 %
3188 % \end{macrocode}
3189 % Here \(10^w\) is formatted as ``mil(le)''.
3190 % \begin{macrocode}
3191 \count10=\fc@frenchoptions@mil@plural\space
3192 \edef\@tempe{%
3193 \noexpand\fc@wcase
3194 mil%
3195 \fc@@do@plural@mark\fc@frenchoptions@mil@plural@mark
3196 \noexpand\@nil
3197 }%
3198 \else
3199 % weight >= 6
3200 \expandafter\fc@@latin@cardinal@pefix\expandafter{\the\count2}\@tempg
3201 % now form the xxx-illion(s) or xxx-illiard(s) word
3202 \ifnum\count3>2 %
3203 \toks10{illiard}%
3204 \count10=\csname fc@frenchoptions@n-illiard@plural\endcsname\space
3205 \else
3206 \toks10{illion}%
3207 \count10=\csname fc@frenchoptions@n-illion@plural\endcsname\space
3208 \fi
3209 \edef\@tempe{%
3210 \noexpand\fc@wcase
3211 \@tempg
3212 \the\toks10 %
3213 \fc@@do@plural@mark s%
3214 \noexpand\@nil
3215 }%
3216 \fi
3217 \else
3218 % \end{macrocode}
3219 % Here plural indicator of \(d\) indicates that \(d = 0\), so we have \(0\times10^{w}\), and it is not worth
3220 % to format \(10^{w}\), because there are none of them.
3221 % \begin{macrocode}
3222 \let\@tempe\@empty
3223 \def\@temph{0}%
3224 \fi
3225 \else
3226 % \end{macrocode}
3227 % Case of \(w=0\).
3228 % \begin{macrocode}
3229 \let\@tempe\@empty
3230 \def\@temph{0}%
3231 \fi
3232 % \end{macrocode}
3233 % Now place into \@cs{@tempa} the assignment of results \cs{@temph} and \cs{@tempe} to \texttt{\#2} and
3234 % \texttt{\#3} for further propagation after closing brace.
3235 % \begin{macrocode}
3236 \expandafter\toks\expandafter1\expandafter{\@tempe}%
3237 \toks0{#2}%
3238 \edef\@tempa{\the\toks0 \@temph \def\noexpand#3{\the\toks1}}%
3239 \expandafter
3240 }\@tempa
3241 }%
3242 \global\let\fc@@pot@longscalefrench\fc@@pot@longscalefrench
3243 % \end{macrocode}
3244 % \DescribeMacro{\fc@@pot@shortscalefrench}Macro \cs{fc@@pot@shortscalefrench} is used to produce
3245 % powers of ten with short scale convention. This convention is the US convention and is not correct for
3246 % French and elsewhere in Europe. First we check that the macro is not yet defined.
3247 % \begin{macrocode}
3248 \ifcsundef{fc@@pot@shortscalefrench}{}{%
3249 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3250 `fc@@pot@shortscalefrench'}}
3251 % \end{macrocode}
3252 % Arguments as follows --- same interface as for \cs{fc@@pot@longscalefrench}:\interface
3253 % \begin{macrocode}
3254 \def\fc@@pot@shortscalefrench#1#2#3{%
3255 {%
3256 % \end{macrocode}
3257 % First save input arguments \texttt{\#1}, \texttt{\#2}, and \texttt{\#3} into local macros
3258 % respectively \cs{@tempa}, \cs{@tempb}, \cs{@tempc} and \cs{@tempd}.
3259 % \begin{macrocode}
3260 \edef\@tempb{\number#1}%
3261 % \end{macrocode}
3262 % And let \cs{count1} be the plural value.
3263 % \begin{macrocode}
3264 \count1=\@tempb
3265 % \end{macrocode}
3266 % Now, let \cs{count2} be the integer \(n\) generating the pseudo latin prefix, i.e. \(n\) is such that \(w =
3267 % 3\times n + 3\).
3268 % \begin{macrocode}
3269 \count2\count0 %
3270 \divide\count2 by 3 %
3271 \advance\count2 by -1 %
3272 % \end{macrocode}
3273 % Here is the real job, the formatted power of ten will go to \cs{@tempe}, and its power type will go to
3274 % \cs{@temph}. Please remember that the power type is an index in \([0\intv 2]\) indicating whether \(10^w\)
3275 % is formatted as \meta{nothing}, ``mil(le)'' or ``\meta{$n$}illion(s)\textbar\meta{$n$}illiard(s)''.
3276 % \begin{macrocode}
3277 \ifnum\count0>0 % If weight>=3, i.e we do have to append thousand or n-illion(s)/n-illiard(s)
3278 \ifnum\count1>0 % we have at least one thousand/n-illion/n-illiard
3279 \ifnum\count2=0 %
3280 \def\@temph{1}%
3281 \count1=\fc@frenchoptions@mil@plural\space
3282 \edef\@tempe{%
3283 mil%
3284 \fc@@do@plural@mark\fc@frenchoptions@mil@plural@mark
3285 }%
3286 \else
3287 \def\@temph{2}%
3288 % weight >= 6
3289 \expandafter\fc@@latin@cardinal@pefix\expandafter{\the\count2}\@tempg
3290 \count10=\csname fc@frenchoptions@n-illion@plural\endcsname\space
3291 \edef\@tempe{%
3292 \noexpand\fc@wcase
3293 \@tempg
3294 illion%
3295 \fc@@do@plural@mark s%
3296 \noexpand\@nil
3297 }%
3298 \fi
3299 \else
3300 % \end{macrocode}
3301 % Here we have \(d=0\), so nothing is to be formatted for \(d\times 10^w\).
3302 % \begin{macrocode}
3303 \def\@temph{0}%
3304 \let\@tempe\@empty
3305 \fi
3306 \else
3307 % \end{macrocode}
3308 % Here \(w=0\).
3309 % \begin{macrocode}
3310 \def\@temph{0}%
3311 \let\@tempe\@empty
3312 \fi
3313 % now place into \@cs{@tempa} the assignment of results \cs{@temph} and \cs{@tempe} to to \texttt{\#2} and
3314 % \texttt{\#3} for further propagation after closing brace.
3315 % \begin{macrocode}
3316 \expandafter\toks\expandafter1\expandafter{\@tempe}%
3317 \toks0{#2}%
3318 \edef\@tempa{\the\toks0 \@temph \def\noexpand#3{\the\toks1}}%
3319 \expandafter
3320 }\@tempa
3321 }%
3322 \global\let\fc@@pot@shortscalefrench\fc@@pot@shortscalefrench
3323 % \end{macrocode}
3324 % \DescribeMacro{\fc@@pot@recursivefrench}Macro \cs{fc@@pot@recursivefrench} is used to produce
3325 % power of tens that are of the form ``million de milliards de milliards'' for \(10^{24}\). First we check
3326 % that the macro is not yet defined.
3327 % \begin{macrocode}
3328 \ifcsundef{fc@@pot@recursivefrench}{}{%
3329 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3330 `fc@@pot@recursivefrench'}}
3331 % \end{macrocode}
3332 % The arguments are as follows --- same interface as for \cs{fc@@pot@longscalefrench}:\interface
3333 % \begin{macrocode}
3334 \def\fc@@pot@recursivefrench#1#2#3{%
3335 {%
3336 % \end{macrocode}
3337 % First the input arguments are saved into local objects: \texttt{\#1} and \texttt{\#1} are respectively saved
3338 % into \cs{@tempa} and \cs{@tempb}.
3339 % \begin{macrocode}
3340 \edef\@tempb{\number#1}%
3341 \let\@tempa\@@tempa
3342 % \end{macrocode}
3343 % New get the inputs \texttt{\#1} and \texttt{\#1} into counters \cs{count0} and \cs{count1} as this is more
3344 % practical.
3345 % \begin{macrocode}
3346 \count1=\@tempb\space
3347 % \end{macrocode}
3348 % Now compute into \cs{count2} how many times ``de milliards'' has to be repeated.
3349 % \begin{macrocode}
3350 \ifnum\count1>0 %
3351 \count2\count0 %
3352 \divide\count2 by 9 %
3353 \advance\count2 by -1 %
3354 \let\@tempe\@empty
3355 \edef\@tempf{\fc@frenchoptions@supermillion@dos
3356 de\fc@frenchoptions@supermillion@dos\fc@wcase milliards\@nil}%
3357 \count11\count0 %
3358 \ifnum\count2>0 %
3359 \count3\count2 %
3360 \count3-\count3 %
3361 \multiply\count3 by 9 %
3362 \advance\count11 by \count3 %
3363 \loop
3364 % (\count2, \count3) <- (\count2 div 2, \count2 mod 2)
3365 \count3\count2 %
3366 \divide\count3 by 2 %
3367 \multiply\count3 by 2 %
3368 \count3-\count3 %
3369 \advance\count3 by \count2 %
3370 \divide\count2 by 2 %
3371 \ifnum\count3=1 %
3372 \let\@tempg\@tempe
3373 \edef\@tempe{\@tempg\@tempf}%
3374 \fi
3375 \let\@tempg\@tempf
3376 \edef\@tempf{\@tempg\@tempg}%
3377 \ifnum\count2>0 %
3378 \repeat
3379 \fi
3380 \divide\count11 by 3 %
3381 \ifcase\count11 % 0 .. 5
3382 % 0 => d milliard(s) (de milliards)*
3383 \def\@temph{2}%
3384 \count10=\csname fc@frenchoptions@n-illiard@plural\endcsname\space
3385 \or % 1 => d mille milliard(s) (de milliards)*
3386 \def\@temph{1}%
3387 \count10=\fc@frenchoptions@mil@plural\space
3388 \or % 2 => d million(s) (de milliards)*
3389 \def\@temph{2}%
3390 \count10=\csname fc@frenchoptions@n-illion@plural\endcsname\space
3391 \or % 3 => d milliard(s) (de milliards)*
3392 \def\@temph{2}%
3393 \count10=\csname fc@frenchoptions@n-illiard@plural\endcsname\space
3394 \or % 4 => d mille milliards (de milliards)*
3395 \def\@temph{1}%
3396 \count10=\fc@frenchoptions@mil@plural\space
3397 \else % 5 => d million(s) (de milliards)*
3398 \def\@temph{2}%
3399 \count10=\csname fc@frenchoptions@n-illion@plural\endcsname\space
3400 \fi
3401 \let\@tempg\@tempe
3402 \edef\@tempf{%
3403 \ifcase\count11 % 0 .. 5
3404 \or
3405 mil\fc@@do@plural@mark \fc@frenchoptions@mil@plural@mark
3406 \or
3407 million\fc@@do@plural@mark s%
3408 \or
3409 milliard\fc@@do@plural@mark s%
3410 \or
3411 mil\fc@@do@plural@mark\fc@frenchoptions@mil@plural@mark
3412 \noexpand\@nil\fc@frenchoptions@supermillion@dos
3413 \noexpand\fc@wcase milliards% 4
3414 \or
3415 million\fc@@do@plural@mark s%
3416 \noexpand\@nil\fc@frenchoptions@supermillion@dos
3417 de\fc@frenchoptions@supermillion@dos\noexpand\fc@wcase milliards% 5
3418 \fi
3419 }%
3420 \edef\@tempe{%
3421 \ifx\@tempf\@empty\else
3422 \expandafter\fc@wcase\@tempf\@nil
3423 \fi
3424 \@tempg
3425 }%
3426 \else
3427 \def\@temph{0}%
3428 \let\@tempe\@empty
3429 \fi
3430 % \end{macrocode}
3431 % Now place into \@cs{@tempa} the assignment of results \cs{@temph} and \cs{@tempe} to \texttt{\#2} and
3432 % \texttt{\#3} for further propagation after closing brace.
3433 % \begin{macrocode}
3434 \expandafter\toks\expandafter1\expandafter{\@tempe}%
3435 \toks0{#2}%
3436 \edef\@tempa{\the\toks0 \@temph \def\noexpand#3{\the\toks1}}%
3437 \expandafter
3438 }\@tempa
3439 }%
3440 \global\let\fc@@pot@recursivefrench\fc@@pot@recursivefrench
3441 % \end{macrocode}
3442 % \DescribeMacro{\fc@muladdfrench}Macro \cs{fc@muladdfrench} is used to format the sum of a number \(a\) and
3443 % the product of a number \(d\) by a power of ten \(10^w\). Number \(d\) is made of three consecutive digits
3444 % \(d_{w+2}d_{w+1}d_w\) of respective weights \(w+2\), \(w+1\), and \(w\), while number \(a\) is made of all
3445 % digits with weight \(w' > w+2\) that have already been formatted. First check that the macro is not yet
3446 % defined.
3447 % \begin{macrocode}
3448 \ifcsundef{fc@muladdfrench}{}{%
3449 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3450 `fc@muladdfrench'}}
3451 % \end{macrocode}
3452 % Arguments as follows:\newline\noindent
3453 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3454 % \#2&input, plural indicator for number \(d\)\\
3455 % \#3&input, formatted number \(d\)\\
3456 % \#5&input, formatted number \(10^w\), i.e. power of ten which is multiplied by \(d\)\\
3457 % \end{tabularx}
3458 % Implicit arguments from context:\newline\noindent
3459 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3460 % \cs{@tempa}&input, formatted number \(a\)\\
3461 % &output, macro to which place the mul-add result\\
3462 % \cs{count8}&input, power type indicator for \(10^{w'}\), where \(w'\) is a weight of \(a\), this is an
3463 % index in \([0\intv 2]\) that reflects whether \(10^{w'}\) is formatted by ``mil(le)'' --- for index \(=1\)
3464 % --- or by ``\meta{$n$}illion(s)\textbar\meta{$n$}illiard(s)'' --- for index \(=2\)\\
3465 % \cs{count9}&input, power type indicator for \(10^w\), this is an index in \([0\intv 2]\) that reflect
3466 % whether the weight \(w\) of \(d\) is formatted by ``meta{nothing}'' --- for index \(=0\), ``mil(le)'' ---
3467 % for index
3468 % \(=1\) --- or by ``\meta{$n$}illion(s)\textbar \meta{$n$}illiard(s)'' --- for index \(=2\)\\
3469 % \end{tabularx}
3470 % \begin{macrocode}
3471 \def\fc@muladdfrench#1#2#3{%
3472 {%
3473 % \end{macrocode}
3474 % First we save input arguments \texttt{\#1} -- \texttt{\#3} to local macros \cs{@tempc}, \cs{@tempd} and
3475 % \cs{@tempf}.
3476 % \begin{macrocode}
3477 \edef\@@tempc{#1}%
3478 \edef\@@tempd{#2}%
3479 \edef\@tempf{#3}%
3480 \let\@tempc\@@tempc
3481 \let\@tempd\@@tempd
3482 % \end{macrocode}
3483 % First we want to do the ``multiplication'' of \(d \Rightarrow \cs{@tempd}\) and of \(10^w \Rightarrow
3484 % \cs{@tempf}\). So, prior to this we do some preprocessing of \(d \Rightarrow \cs{@tempd}\): we force
3485 % \cs{@tempd} to \meta{empty} if both \(d=1\) and \(10^w\Rightarrow\) ``mil(le)'', this is because we,
3486 % French, we do not say ``un mil'', but just ``mil''.
3487 % \begin{macrocode}
3488 \ifnum\@tempc=1 %
3489 \ifnum\count9=1 %
3490 \let\@tempd\@empty
3491 \fi
3492 \fi
3493 % \end{macrocode}
3494 % Now we do the ``multiplication'' of \(d = \cs{@tempd}\) and of \(10^w = \cs{@tempf}\), and place the result
3495 % into \cs{@tempg}.
3496 % \begin{macrocode}
3497 \edef\@tempg{%
3498 \@tempd
3499 \ifx\@tempd\@empty\else
3500 \ifx\@tempf\@empty\else
3501 \ifcase\count9 %
3502 \or
3503 \fc@frenchoptions@submillion@dos
3504 \or
3505 \fc@frenchoptions@supermillion@dos
3506 \fi
3507 \fi
3508 \fi
3509 \@tempf
3510 }%
3511 % \end{macrocode}
3512 % Now to the ``addition'' of \(a\Rightarrow \cs{@tempa}\) and \(d\times 10^w\Rightarrow \cs{@tempg}\), and
3513 % place the results into \cs{@temph}.
3514 % \begin{macrocode}
3515 \edef\@temph{%
3516 \@tempa
3517 \ifx\@tempa\@empty\else
3518 \ifx\@tempg\@empty\else
3519 \ifcase\count8 %
3520 \or
3521 \fc@frenchoptions@submillion@dos
3522 \or
3523 \fc@frenchoptions@supermillion@dos
3524 \fi
3525 \fi
3526 \fi
3527 \@tempg
3528 }%
3529 % \end{macrocode}
3530 % Now propagate the result --- i.e. the expansion of \cs{@temph} --- into macro \cs{@tempa} after closing
3531 % brace.
3532 % \begin{macrocode}
3533 \def\@tempb##1{\def\@tempa{\def\@tempa{##1}}}%
3534 \expandafter\@tempb\expandafter{\@temph}%
3535 \expandafter
3536 }\@tempa
3537 }%
3538 \global\let\fc@muladdfrench\fc@muladdfrench
3539 % \end{macrocode}
3540 % \DescribeMacro{\fc@lthundredstringfrench}Macro \cs{fc@lthundredstringfrench} is used to format a number in
3541 % interval \([0 \intv 99]\). First we check that it is not already defined.
3542 % \begin{macrocode}
3543 \ifcsundef{fc@lthundredstringfrench}{}{%
3544 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3545 `fc@lthundredstringfrench'}}
3546 % \end{macrocode}
3547 % The number to format is not passed as an argument to this macro, instead each digits of it is in a
3548 % \cs{fc@digit@\meta{w}} macro after this number has been parsed. So the only thing that
3549 % \cs{fc@lthundredstringfrench} needs is to know \meta{w} which is passed as \cs{count0} for the less
3550 % significant digit.\newline
3551 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3552 % \#1&intput/output macro to which append the result
3553 % \end{tabularx}
3554 % Implicit input arguments as follows:\newline
3555 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3556 % \cs{count0}&weight \(w\) of least significant digit \(d_{w}\).
3557 % \end{tabularx}
3558 % The formatted number is appended to the content of \#1, and the result is placed into \#1.
3559 % \begin{macrocode}
3560 \def\fc@lthundredstringfrench#1{%
3561 {%
3562 % \end{macrocode}
3563 % First save arguments into local temporary macro.
3564 % \begin{macrocode}
3565 \let\@tempc#1%
3566 % \end{macrocode}
3567 % Read units \(d_w\) to \cs{count1}.
3568 % \begin{macrocode}
3569 \fc@read@unit{\count1}{\count0}%
3570 % \end{macrocode}
3571 % Read tens \(d_{w+1}\) to \cs{count2}.
3572 % \begin{macrocode}
3573 \count3\count0 %
3574 \advance\count3 1 %
3575 \fc@read@unit{\count2}{\count3}%
3576 % \end{macrocode}
3577 % Now do the real job, set macro \cs{@tempa} to \texttt{\#1} followed by \(d_{w+1}d_w\) formatted.
3578 % \begin{macrocode}
3579 \edef\@tempa{%
3580 \@tempc
3581 \ifnum\count2>1 %
3582 % 20 .. 99
3583 \ifnum\count2>6 %
3584 % 70 .. 99
3585 \ifnum\count2<8 %
3586 % 70 .. 79
3587 \@seventies{\count1}%
3588 \else
3589 % 80..99
3590 \ifnum\count2<9 %
3591 % 80 .. 89
3592 \@eighties{\count1}%
3593 \else
3594 % 90 .. 99
3595 \@nineties{\count1}%
3596 \fi
3597 \fi
3598 \else
3599 % 20..69
3600 \@tenstring{\count2}%
3601 \ifnum\count1>0 %
3602 % x1 .. x0
3603 \ifnum\count1=1 %
3604 % x1
3605 \fc@frenchoptions@submillion@dos\@andname\fc@frenchoptions@submillion@dos
3606 \else
3607 % x2 .. x9
3608 -%
3609 \fi
3610 \@unitstring{\count1}%
3611 \fi
3612 \fi
3613 \else
3614 % 0 .. 19
3615 \ifnum\count2=0 % when tens = 0
3616 % 0 .. 9
3617 \ifnum\count1=0 % when units = 0
3618 % \count3=1 when #1 = 0, i.e. only for the unit of the top level number
3619 \ifnum\count3=1 %
3620 \ifnum\fc@max@weight=0 %
3621 \@unitstring{0}%
3622 \fi
3623 \fi
3624 \else
3625 % 1 .. 9
3626 \@unitstring{\count1}%
3627 \fi
3628 \else
3629 % 10 .. 19
3630 \@teenstring{\count1}%
3631 \fi
3632 \fi
3633 }%
3634 % \end{macrocode}
3635 % Now propagate the expansion of \cs{@tempa} into \texttt{\#1} after closing brace.
3636 % \begin{macrocode}
3637 \def\@tempb##1{\def\@tempa{\def#1{##1}}}%
3638 \expandafter\@tempb\expandafter{\@tempa}%
3639 \expandafter
3640 }\@tempa
3641 }%
3642 \global\let\fc@lthundredstringfrench\fc@lthundredstringfrench
3643 % \end{macrocode}
3644 % \DescribeMacro{\fc@ltthousandstringfrench}Macro \cs{fc@ltthousandstringfrench} is used to format a number in
3645 % interval \([0 \intv 999]\). First we check that it is not already defined.
3646 % \begin{macrocode}
3647 \ifcsundef{fc@ltthousandstringfrench}{}{%
3648 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3649 `fc@ltthousandstringfrench'}}
3650 % \end{macrocode}
3651 % Output is empty for 0. Arguments as follows:\newline\noindent
3652 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3653 % \#2&output, macro, formatted number \(d = d_{w+2}d_{w+1}d_w\)
3654 % \end{tabularx}
3655 % Implicit input arguments as follows:\newline\noindent
3656 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3657 % \cs{count0}&input weight \(10^{w}\) of number \(d_{w+2}d_{w+1}d_w\) to be formatted.\\
3658 % \cs{count5}&least weight of formatted number with a non null digit.\\
3659 % \cs{count9}&input, power type indicator of \(10^{w}\) \(0\Rightarrow\varnothing\), \(1\Rightarrow\textrm {
3660 % ``mil(le)''}\), \(2\Rightarrow\textrm {\meta{$n$}illion(s)\textbar\meta{$n$}illiard(s)}\)\\
3661 % \end{tabularx}
3662 % \begin{macrocode}
3663 \def\fc@ltthousandstringfrench#1{%
3664 {%
3665 % \end{macrocode}
3666 % Set counter \cs{count2} to digit \(d_{w+2}\), i.e. hundreds.
3667 % \begin{macrocode}
3668 \count4\count0 %
3669 \advance\count4 by 2 %
3670 \fc@read@unit{\count2 }{\count4 }%
3671 % \end{macrocode}
3672 % Check that the two subsequent digits \(d_{w+1}d_w\) are non zero, place check-result into \cs{@tempa}.
3673 % \begin{macrocode}
3674 \advance\count4 by -1 %
3675 \count3\count4 %
3676 \advance\count3 by -1 %
3677 \fc@check@nonzeros{\count3 }{\count4 }\@tempa
3678 % \end{macrocode}
3679 % Compute plural mark of `cent' into \cs{@temps}.
3680 % \begin{macrocode}
3681 \edef\@temps{%
3682 \ifcase\fc@frenchoptions@cent@plural\space
3683 % 0 => always
3684 s%
3685 \or
3686 % 1 => never
3687 \or
3688 % 2 => multiple
3689 \ifnum\count2>1s\fi
3690 \or
3691 % 3 => multiple g-last
3692 \ifnum\count2>1 \ifnum\@tempa=0 \ifnum\count0=\count6s\fi\fi\fi
3693 \or
3694 % 4 => multiple l-last
3695 \ifnum\count2>1 \ifnum\@tempa=0 \ifnum\count9=0s\else\ifnum\count9=2s\fi\fi\fi\fi
3696 \fi
3697 }%
3698 % compute spacing after cent(s?) into \@tempb
3699 \expandafter\let\expandafter\@tempb
3700 \ifnum\@tempa>0 \fc@frenchoptions@submillion@dos\else\@empty\fi
3701 % now place into \@tempa the hundreds
3702 \edef\@tempa{%
3703 \ifnum\count2=0 %
3704 \else
3705 \ifnum\count2=1 %
3706 \expandafter\fc@wcase\@hundred\@nil
3707 \else
3708 \@unitstring{\count2}\fc@frenchoptions@submillion@dos
3709 \noexpand\fc@wcase\@hundred\@temps\noexpand\@nil
3710 \fi
3711 \@tempb
3712 \fi
3713 }%
3714 % now append to \@tempa the ten and unit
3715 \fc@lthundredstringfrench\@tempa
3716 % \end{macrocode}
3717 % Propagate expansion of \cs{@tempa} into macro \texttt{\#1} after closing brace.
3718 % \begin{macrocode}
3719 \def\@tempb##1{\def\@tempa{\def#1{##1}}}%
3720 \expandafter\@tempb\expandafter{\@tempa}%
3721 \expandafter
3722 }\@tempa
3723 }%
3724 \global\let\fc@ltthousandstringfrench\fc@ltthousandstringfrench
3725 % \end{macrocode}
3726 % \DescribeMacro{\@@numberstringfrench}Macro \cs{@@numberstringfrench} is the main engine for formatting
3727 % cadinal numbers in French. First we check that the control sequence is not yet defined.
3728 % \begin{macrocode}
3729 \ifcsundef{@@numberstringfrench}{}{%
3730 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro `@@numberstringfrench'}}
3731 % \end{macrocode}
3732 % Arguments are as follows:\newline\noindent
3733 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3734 % \#1&number to convert to string\\
3735 % \#2&macro into which to place the result
3736 % \end{tabularx}
3737 % \begin{macrocode}
3738 \def\@@numberstringfrench#1#2{%
3739 {%
3740 % \end{macrocode}
3741 % First parse input number to be formatted and do some error handling.
3742 % \begin{macrocode}
3743 \edef\@tempa{#1}%
3744 \expandafter\fc@number@parser\expandafter{\@tempa}%
3745 \ifnum\fc@min@weight<0 %
3746 \PackageError{fmtcount}{Out of range}%
3747 {This macro does not work with fractional numbers}%
3748 \fi
3749 % \end{macrocode}
3750 % In the sequel, \cs{@tempa} is used to accumulate the formatted number. Please note that \cs{space} after
3751 % \cs{fc@sign@case} is eaten by preceding number collection. This \cs{space} is needed so that when
3752 % \cs{fc@sign@case} expands to `\texttt{0}', then \cs{@tempa} is defined to `' (i.e. empty) rather than to
3753 % `\cs{relax}'.
3754 % \begin{macrocode}
3755 \edef\@tempa{\ifcase\fc@sign@case\space\or\fc@wcase plus\@nil\or\fc@wcase moins\@nil\fi}%
3756 \fc@nbrstr@preamble
3757 \fc@@nbrstrfrench@inner
3758 \fc@nbrstr@postamble
3759 % \end{macrocode}
3760 % Propagate the result --- i.e. expansion of \cs{@tempa} --- into macro \texttt{\#2} after closing brace.
3761 % \begin{macrocode}
3762 \def\@tempb##1{\def\@tempa{\def#2{##1}}}%
3763 \expandafter\@tempb\expandafter{\@tempa}%
3764 \expandafter
3765 }\@tempa
3766 }%
3767 \global\let\@@numberstringfrench\@@numberstringfrench
3768 % \end{macrocode}
3769 % \DescribeMacro{\fc@@nbrstrfrench@inner}Common part of \cs{@@numberstringfrench} and \cs
3770 % {@@ordinalstringfrench}. Arguments are as follows:\newline\noindent
3771 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3772 % \cs{@tempa}&input/output, macro to which the result is to be aggregated, initially empty or contains the
3773 % sign indication.\\
3774 % \end{tabularx}
3775 % \begin{macrocode}
3776 \def\fc@@nbrstrfrench@inner{%
3777 % \end{macrocode}
3778 % Now loop, first we compute starting weight as
3779 % \(3\times\left\lfloor\frac{\cs{fc@max@weight}}{3}\right\rfloor\) into \cs{count0}.
3780 % \begin{macrocode}
3781 \count0=\fc@max@weight
3782 \divide\count0 by 3 %
3783 \multiply\count0 by 3 %
3784 % \end{macrocode}
3785 % Now we compute final weight into \cs{count5}, and round down to multiple of \(3\) into
3786 % \cs{count6}. Warning: \cs{count6} is an implicit input argument to macro \cs{fc@ltthousandstringfrench}.
3787 % \begin{macrocode}
3788 \fc@intpart@find@last{\count5 }%
3789 \count6\count5 %
3790 \divide\count6 3 %
3791 \multiply\count6 3 %
3792 \count8=0 %
3793 \loop
3794 % \end{macrocode}
3795 % First we check whether digits in weight interval \([w \intv (w+2)]\) are all zero and place check result
3796 % into macro \cs{@tempt}.
3797 % \begin{macrocode}
3798 \count1\count0 %
3799 \advance\count1 by 2 %
3800 \fc@check@nonzeros{\count0 }{\count1 }\@tempt
3801 % \end{macrocode}
3802 % Now we generate the power of ten \(10^w\), formatted power of ten goes to \cs{@tempb}, while power type
3803 % indicator goes to \cs{count9}.
3804 % \begin{macrocode}
3805 \fc@poweroften\@tempt{\count9 }\@tempb
3806 % \end{macrocode}
3807 % Now we generate the formatted number \(d\) into macro \cs{@tempd} by which we need to multiply
3808 % \(10^w\). Implicit input argument is \cs{count9} for power type of \(10^9\), and \cs{count6}
3809 % \begin{macrocode}
3810 \fc@ltthousandstringfrench\@tempd
3811 % \end{macrocode}
3812 % Finally do the multiplication-addition. Implicit arguments are \cs{@tempa} for input/output growing
3813 % formatted number, \cs{count8} for input previous power type, i.e. power type of \(10^{w+3}\), \cs{count9}
3814 % for input current power type, i.e. power type of \(10^w\).
3815 % \begin{macrocode}
3816 \fc@muladdfrench\@tempt\@tempd\@tempb
3817 % \end{macrocode}
3818 % Then iterate.
3819 % \begin{macrocode}
3820 \count8\count9 %
3821 \advance\count0 by -3 %
3822 \ifnum\count6>\count0 \else
3823 \repeat
3824 }%
3825 \global\let\fc@@nbrstrfrench@inner\fc@@nbrstrfrench@inner
3826 % \end{macrocode}
3827 % \DescribeMacro{\@@ordinalstringfrench}Macro \cs{@@ordinalstringfrench} is the main engine for formatting
3828 % ordinal numbers in French. First check it is not yet defined.
3829 % \begin{macrocode}
3830 \ifcsundef{@@ordinalstringfrench}{}{%
3831 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
3832 `@@ordinalstringfrench'}}
3833 % \end{macrocode}
3834 % Arguments are as follows:\newline\noindent
3835 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
3836 % \#1&number to convert to string\\
3837 % \#2&macro into which to place the result
3838 % \end{tabularx}
3839 % \begin{macrocode}
3840 \def\@@ordinalstringfrench#1#2{%
3841 {%
3842 % \end{macrocode}
3843 % First parse input number to be formatted and do some error handling.
3844 % \begin{macrocode}
3845 \edef\@tempa{#1}%
3846 \expandafter\fc@number@parser\expandafter{\@tempa}%
3847 \ifnum\fc@min@weight<0 %
3848 \PackageError{fmtcount}{Out of range}%
3849 {This macro does not work with fractional numbers}%
3850 \fi
3851 \ifnum\fc@sign@case>0 %
3852 \PackageError{fmtcount}{Out of range}%
3853 {This macro does with negative or explicitly marked as positive numbers}%
3854 \fi
3855 % \end{macrocode}
3856 % Now handle the special case of first. We set \cs{count0} to \texttt{1} if we are in this case, and to
3857 % \texttt{0} otherwise
3858 % \begin{macrocode}
3859 \ifnum\fc@max@weight=0 %
3860 \ifnum\csname fc@digit@0\endcsname=1 %
3861 \count0=1 %
3862 \else
3863 \count0=0 %
3864 \fi
3865 \else
3866 \count0=0 %
3867 \fi
3868 \ifnum\count0=1 %
3869 \expandafter\@firstoftwo
3870 \else
3871 \expandafter\@secondoftwo
3872 \fi
3873 % \end{macrocode}
3874 % \changes{3.01}{2014-11-10}{Protect \cs{`}, for solving
3875 % \uref{http://github.com/nlct/fmtcount/issues/15}{Issue \#15}}
3876 % \begin{macrocode}
3877 {%
3878 \protected@edef\@tempa{\expandafter\fc@wcase\fc@first\@nil}%
3879 }%
3880 % \end{macrocode}
3881 % Now we tamper a little bit with the plural handling options to ensure that there is no final plural mark.
3882 % \begin{macrocode}
3883 {%
3884 \def\@tempa##1{%
3885 \expandafter\edef\csname fc@frenchoptions@##1@plural\endcsname{%
3886 \ifcase\csname fc@frenchoptions@##1@plural\endcsname\space
3887 0% 0: always => always
3888 \or
3889 1% 1: never => never
3890 \or
3891 6% 2: multiple => multiple ng-last
3892 \or
3893 1% 3: multiple g-last => never
3894 \or
3895 5% 4: multiple l-last => multiple lng-last
3896 \or
3897 5% 5: multiple lng-last => multiple lng-last
3898 \or
3899 6% 6: multiple ng-last => multiple ng-last
3900 \fi
3901 }%
3902 }%
3903 \@tempa{vingt}%
3904 \@tempa{cent}%
3905 \@tempa{mil}%
3906 \@tempa{n-illion}%
3907 \@tempa{n-illiard}%
3908 % \end{macrocode}
3909 % Now make \cs{fc@wcase} and \cs{@nil} non expandable
3910 % \begin{macrocode}
3911 \let\fc@wcase@save\fc@wcase
3912 \def\fc@wcase{\noexpand\fc@wcase}%
3913 \def\@nil{\noexpand\@nil}%
3914 % \end{macrocode}
3915 % In the sequel, \cs{@tempa} is used to accumulate the formatted number.
3916 % \begin{macrocode}
3917 \let\@tempa\@empty
3918 \fc@@nbrstrfrench@inner
3919 % \end{macrocode}
3920 % Now restore \cs{fc@wcase}
3921 % \begin{macrocode}
3922 \let\fc@wcase\fc@wcase@save
3923 % \end{macrocode}
3924 % Now we add the ``i\`eme'' ending
3925 % \changes{3.01}{2014-11-10}{Protect \cs{`}, for solving
3926 % \uref{http://github.com/nlct/fmtcount/issues/15}{Issue \#15}}
3927 % \begin{macrocode}
3928 \expandafter\fc@get@last@word\expandafter{\@tempa}\@tempb\@tempc
3929 \expandafter\fc@get@last@letter\expandafter{\@tempc}\@tempd\@tempe
3930 \def\@tempf{e}%
3931 \ifx\@tempe\@tempf
3932 \protected@edef\@tempa{\@tempb\expandafter\fc@wcase\@tempd i\protect\`eme\@nil}%
3933 \else
3934 \def\@tempf{q}%
3935 \ifx\@tempe\@tempf
3936 \protected@edef\@tempa{\@tempb\expandafter\fc@wcase\@tempd qui\protect\`eme\@nil}%
3937 \else
3938 \def\@tempf{f}%
3939 \ifx\@tempe\@tempf
3940 \protected@edef\@tempa{\@tempb\expandafter\fc@wcase\@tempd vi\protect\`eme\@nil}%
3941 \else
3942 \protected@edef\@tempa{\@tempb\expandafter\fc@wcase\@tempc i\protect\`eme\@nil}%
3943 \fi
3944 \fi
3945 \fi
3946 }%
3947 % \end{macrocode}
3948 % Apply \cs{fc@gcase} to the result.
3949 % \begin{macrocode}
3950 \fc@apply@gcase
3951 % \end{macrocode}
3952 % Propagate the result --- i.e. expansion of \cs{@tempa} --- into macro \texttt{\#2} after closing brace.
3953 % \begin{macrocode}
3954 \def\@tempb##1{\def\@tempa{\def#2{##1}}}%
3955 \expandafter\@tempb\expandafter{\@tempa}%
3956 \expandafter
3957 }\@tempa
3958 }%
3959 \global\let\@@ordinalstringfrench\@@ordinalstringfrench
3960 % \end{macrocode}
3961 % Macro \cs{fc@frenchoptions@setdefaults} allows to set all options to default for the French.
3962 % \begin{macrocode}
3963 \newcommand*\fc@frenchoptions@setdefaults{%
3964 \csname KV@fcfrench@all plural\endcsname{reformed}%
3965 \fc@gl@def\fc@frenchoptions@submillion@dos{-}%
3966 \fc@gl@let\fc@frenchoptions@supermillion@dos\space
3967 \fc@gl@let\fc@u@in@duo\@empty% Could be `u'
3968 % \fc@gl@let\fc@poweroften\fc@@pot@longscalefrench
3969 \fc@gl@let\fc@poweroften\fc@@pot@recursivefrench
3970 \fc@gl@def\fc@longscale@nilliard@upto{0}% infinity
3971 \fc@gl@def\fc@frenchoptions@mil@plural@mark{le}%
3972 }%
3973 \global\let\fc@frenchoptions@setdefaults\fc@frenchoptions@setdefaults
3974 {%
3975 \let\fc@gl@def\gdef
3976 \def\fc@gl@let{\global\let}%
3977 \fc@frenchoptions@setdefaults
3978 }%
3979 % \end{macrocode}
3980 % Make some indirection to call the current French dialect corresponding macro.
3981 % \changes{3.01}{2014-12-18}{Move French specific stuff from \styfmt{fmtcount.sty} to \styfmt{fc-french.def}.}
3982 % \begin{macrocode}
3983 \gdef\@ordinalstringMfrench{\csuse{@ordinalstringMfrench\fmtcount@french}}%
3984 \gdef\@ordinalstringFfrench{\csuse{@ordinalstringFfrench\fmtcount@french}}%
3985 \gdef\@OrdinalstringMfrench{\csuse{@OrdinalstringMfrench\fmtcount@french}}%
3986 \gdef\@OrdinalstringFfrench{\csuse{@OrdinalstringFfrench\fmtcount@french}}%
3987 \gdef\@numberstringMfrench{\csuse{@numberstringMfrench\fmtcount@french}}%
3988 \gdef\@numberstringFfrench{\csuse{@numberstringFfrench\fmtcount@french}}%
3989 \gdef\@NumberstringMfrench{\csuse{@NumberstringMfrench\fmtcount@french}}%
3990 \gdef\@NumberstringFfrench{\csuse{@NumberstringFfrench\fmtcount@french}}%
3991 % \end{macrocode}
3992 % \setcounter{CodelineNo}{0}
3993 %\iffalse
3994 % \begin{macrocode}
3995 %</fc-french.def>
3996 % \end{macrocode}
3997 %\fi
3998 %\iffalse
3999 % \begin{macrocode}
4000 %<*fc-frenchb.def>
4001 % \end{macrocode}
4002 %\fi
4003 % \subsubsection{fc-frenchb.def}
4004 % \begin{macrocode}
4005 \ProvidesFCLanguage{frenchb}[2013/08/17]%
4006 \FCloadlang{french}%
4007 % \end{macrocode}
4008 % Set \verb|frenchb| to be equivalent to \verb|french|.
4009 % \begin{macrocode}
4010 \global\let\@ordinalMfrenchb=\@ordinalMfrench
4011 \global\let\@ordinalFfrenchb=\@ordinalFfrench
4012 \global\let\@ordinalNfrenchb=\@ordinalNfrench
4013 \global\let\@numberstringMfrenchb=\@numberstringMfrench
4014 \global\let\@numberstringFfrenchb=\@numberstringFfrench
4015 \global\let\@numberstringNfrenchb=\@numberstringNfrench
4016 \global\let\@NumberstringMfrenchb=\@NumberstringMfrench
4017 \global\let\@NumberstringFfrenchb=\@NumberstringFfrench
4018 \global\let\@NumberstringNfrenchb=\@NumberstringNfrench
4019 \global\let\@ordinalstringMfrenchb=\@ordinalstringMfrench
4020 \global\let\@ordinalstringFfrenchb=\@ordinalstringFfrench
4021 \global\let\@ordinalstringNfrenchb=\@ordinalstringNfrench
4022 \global\let\@OrdinalstringMfrenchb=\@OrdinalstringMfrench
4023 \global\let\@OrdinalstringFfrenchb=\@OrdinalstringFfrench
4024 \global\let\@OrdinalstringNfrenchb=\@OrdinalstringNfrench
4025 % \end{macrocode}
4026 % \setcounter{CodelineNo}{0}
4027 %\iffalse
4028 % \begin{macrocode}
4029 %</fc-frenchb.def>
4030 % \end{macrocode}
4031 %\fi
4032 %\iffalse
4033 % \begin{macrocode}
4034 %<*fc-german.def>
4035 % \end{macrocode}
4036 %\fi
4037 % \subsubsection{fc-german.def}
4038 % German definitions (thank you to K. H. Fricke for supplying
4039 % this information)
4040 % \begin{macrocode}
4041 \ProvidesFCLanguage{german}[2018/06/17]%
4042 % \end{macrocode}
4043 % Define macro that converts a number or count register (first
4044 % argument) to an ordinal, and stores the result in the
4045 % second argument, which must be a control sequence.
4046 % Masculine:
4047 % \begin{macrocode}
4048 \newcommand{\@ordinalMgerman}[2]{%
4049 \edef#2{\number#1\relax.}%
4050 }%
4051 \global\let\@ordinalMgerman\@ordinalMgerman
4052 % \end{macrocode}
4053 % Feminine:
4054 % \begin{macrocode}
4055 \newcommand{\@ordinalFgerman}[2]{%
4056 \edef#2{\number#1\relax.}%
4057 }%
4058 \global\let\@ordinalFgerman\@ordinalFgerman
4059 % \end{macrocode}
4060 % Neuter:
4061 % \begin{macrocode}
4062 \newcommand{\@ordinalNgerman}[2]{%
4063 \edef#2{\number#1\relax.}%
4064 }%
4065 \global\let\@ordinalNgerman\@ordinalNgerman
4066 % \end{macrocode}
4067 % Convert a number to text. The easiest way to do this is to
4068 % break it up into units, tens and teens.
4069 % Units (argument must be a number from 0 to 9, 1 on its own (eins)
4070 % is dealt with separately):
4071 % \begin{macrocode}
4072 \newcommand*\@@unitstringgerman[1]{%
4073 \ifcase#1%
4074 null%
4075 \or ein%
4076 \or zwei%
4077 \or drei%
4078 \or vier%
4079 \or fünf%
4080 \or sechs%
4081 \or sieben%
4082 \or acht%
4083 \or neun%
4084 \fi
4085 }%
4086 \global\let\@@unitstringgerman\@@unitstringgerman
4087 % \end{macrocode}
4088 % Tens (argument must go from 1 to 10):
4089 % \begin{macrocode}
4090 \newcommand*\@@tenstringgerman[1]{%
4091 \ifcase#1%
4092 \or zehn%
4093 \or zwanzig%
4094 \or dreißig%
4095 \or vierzig%
4096 \or fünfzig%
4097 \or sechzig%
4098 \or siebzig%
4099 \or achtzig%
4100 \or neunzig%
4101 \or einhundert%
4102 \fi
4103 }%
4104 \global\let\@@tenstringgerman\@@tenstringgerman
4105 % \end{macrocode}
4106 % \cs{einhundert} is set to \verb|einhundert| by default, user can
4107 % redefine this command to just \verb|hundert| if required, similarly
4108 % for \cs{eintausend}.
4109 % \begin{macrocode}
4110 \providecommand*{\einhundert}{einhundert}%
4111 \providecommand*{\eintausend}{eintausend}%
4112 \global\let\einhundert\einhundert
4113 \global\let\eintausend\eintausend
4114 % \end{macrocode}
4115 % Teens:
4116 % \begin{macrocode}
4117 \newcommand*\@@teenstringgerman[1]{%
4118 \ifcase#1%
4119 zehn%
4120 \or elf%
4121 \or zwölf%
4122 \or dreizehn%
4123 \or vierzehn%
4124 \or fünfzehn%
4125 \or sechzehn%
4126 \or siebzehn%
4127 \or achtzehn%
4128 \or neunzehn%
4129 \fi
4130 }%
4131 \global\let\@@teenstringgerman\@@teenstringgerman
4132 % \end{macrocode}
4133 % The results are stored in the second argument, but doesn't display
4134 % anything.%
4135 % \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by
4136 % \cs{newcommand*} as robustness is handled now at top level in
4137 % \texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned
4138 % macros are \cs{@numberstringMgerman}, \cs{@NumberstringMgerman},
4139 % \cs{@ordinalstringMgerman}, \cs{@ordinalstringFgerman},
4140 % \cs{@ordinalstringNgerman}, \cs{@OrdinalstringMgerman},
4141 % \cs{@OrdinalstringFgerman}, and \cs{@OrdinalstringNgerman}.}
4142 % \begin{macrocode}
4143 \newcommand*{\@numberstringMgerman}[2]{%
4144 \let\@unitstring=\@@unitstringgerman
4145 \let\@teenstring=\@@teenstringgerman
4146 \let\@tenstring=\@@tenstringgerman
4147 \@@numberstringgerman{#1}{#2}%
4148 }%
4149 \global\let\@numberstringMgerman\@numberstringMgerman
4150 % \end{macrocode}
4151 % Feminine and neuter forms:
4152 % \begin{macrocode}
4153 \global\let\@numberstringFgerman=\@numberstringMgerman
4154 \global\let\@numberstringNgerman=\@numberstringMgerman
4155 % \end{macrocode}
4156 % As above, but initial letters in upper case:
4157 % \begin{macrocode}
4158 \newcommand*{\@NumberstringMgerman}[2]{%
4159 \@numberstringMgerman{#1}{\@@num@str}%
4160 \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
4161 }%
4162 \global\let\@NumberstringMgerman\@NumberstringMgerman
4163 % \end{macrocode}
4164 % Feminine and neuter form:
4165 % \begin{macrocode}
4166 \global\let\@NumberstringFgerman=\@NumberstringMgerman
4167 \global\let\@NumberstringNgerman=\@NumberstringMgerman
4168 % \end{macrocode}
4169 % As above, but for ordinals.
4170 % \begin{macrocode}
4171 \newcommand*{\@ordinalstringMgerman}[2]{%
4172 \let\@unitthstring=\@@unitthstringMgerman
4173 \let\@teenthstring=\@@teenthstringMgerman
4174 \let\@tenthstring=\@@tenthstringMgerman
4175 \let\@unitstring=\@@unitstringgerman
4176 \let\@teenstring=\@@teenstringgerman
4177 \let\@tenstring=\@@tenstringgerman
4178 \def\@thousandth{tausendster}%
4179 \def\@hundredth{hundertster}%
4180 \@@ordinalstringgerman{#1}{#2}%
4181 }%
4182 \global\let\@ordinalstringMgerman\@ordinalstringMgerman
4183 % \end{macrocode}
4184 % Feminine form:
4185 % \begin{macrocode}
4186 \newcommand*{\@ordinalstringFgerman}[2]{%
4187 \let\@unitthstring=\@@unitthstringFgerman
4188 \let\@teenthstring=\@@teenthstringFgerman
4189 \let\@tenthstring=\@@tenthstringFgerman
4190 \let\@unitstring=\@@unitstringgerman
4191 \let\@teenstring=\@@teenstringgerman
4192 \let\@tenstring=\@@tenstringgerman
4193 \def\@thousandth{tausendste}%
4194 \def\@hundredth{hundertste}%
4195 \@@ordinalstringgerman{#1}{#2}%
4196 }%
4197 \global\let\@ordinalstringFgerman\@ordinalstringFgerman
4198 % \end{macrocode}
4199 % Neuter form:
4200 % \begin{macrocode}
4201 \newcommand*{\@ordinalstringNgerman}[2]{%
4202 \let\@unitthstring=\@@unitthstringNgerman
4203 \let\@teenthstring=\@@teenthstringNgerman
4204 \let\@tenthstring=\@@tenthstringNgerman
4205 \let\@unitstring=\@@unitstringgerman
4206 \let\@teenstring=\@@teenstringgerman
4207 \let\@tenstring=\@@tenstringgerman
4208 \def\@thousandth{tausendstes}%
4209 \def\@hundredth{hunderstes}%
4210 \@@ordinalstringgerman{#1}{#2}%
4211 }%
4212 \global\let\@ordinalstringNgerman\@ordinalstringNgerman
4213 % \end{macrocode}
4214 % As above, but with initial letters in upper case.
4215 % \begin{macrocode}
4216 \newcommand*{\@OrdinalstringMgerman}[2]{%
4217 \@ordinalstringMgerman{#1}{\@@num@str}%
4218 \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
4219 }%
4220 \global\let\@OrdinalstringMgerman\@OrdinalstringMgerman
4221 % \end{macrocode}
4222 % Feminine form:
4223 % \begin{macrocode}
4224 \newcommand*{\@OrdinalstringFgerman}[2]{%
4225 \@ordinalstringFgerman{#1}{\@@num@str}%
4226 \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
4227 }%
4228 \global\let\@OrdinalstringFgerman\@OrdinalstringFgerman
4229 % \end{macrocode}
4230 % Neuter form:
4231 % \begin{macrocode}
4232 \newcommand*{\@OrdinalstringNgerman}[2]{%
4233 \@ordinalstringNgerman{#1}{\@@num@str}%
4234 \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
4235 }%
4236 \global\let\@OrdinalstringNgerman\@OrdinalstringNgerman
4237 % \end{macrocode}
4238 % Code for converting numbers into textual ordinals. As before,
4239 % it is easier to split it into units, tens and teens.
4240 % Units:
4241 %\changes{2.0}{2012-09-25}{fixed spelling mistake (correction
4242 %provided by Dominik Waß enhoven)}
4243 % \begin{macrocode}
4244 \newcommand*\@@unitthstringMgerman[1]{%
4245 \ifcase#1%
4246 nullter%
4247 \or erster%
4248 \or zweiter%
4249 \or dritter%
4250 \or vierter%
4251 \or fünfter%
4252 \or sechster%
4253 \or siebter%
4254 \or achter%
4255 \or neunter%
4256 \fi
4257 }%
4258 \global\let\@@unitthstringMgerman\@@unitthstringMgerman
4259 % \end{macrocode}
4260 % Tens:
4261 % \begin{macrocode}
4262 \newcommand*\@@tenthstringMgerman[1]{%
4263 \ifcase#1%
4264 \or zehnter%
4265 \or zwanzigster%
4266 \or dreißigster%
4267 \or vierzigster%
4268 \or fünfzigster%
4269 \or sechzigster%
4270 \or siebzigster%
4271 \or achtzigster%
4272 \or neunzigster%
4273 \fi
4274 }%
4275 \global\let\@@tenthstringMgerman\@@tenthstringMgerman
4276 % \end{macrocode}
4277 % Teens:
4278 % \begin{macrocode}
4279 \newcommand*\@@teenthstringMgerman[1]{%
4280 \ifcase#1%
4281 zehnter%
4282 \or elfter%
4283 \or zwölfter%
4284 \or dreizehnter%
4285 \or vierzehnter%
4286 \or fünfzehnter%
4287 \or sechzehnter%
4288 \or siebzehnter%
4289 \or achtzehnter%
4290 \or neunzehnter%
4291 \fi
4292 }%
4293 \global\let\@@teenthstringMgerman\@@teenthstringMgerman
4294 % \end{macrocode}
4295 % Units (feminine):
4296 % \begin{macrocode}
4297 \newcommand*\@@unitthstringFgerman[1]{%
4298 \ifcase#1%
4299 nullte%
4300 \or erste%
4301 \or zweite%
4302 \or dritte%
4303 \or vierte%
4304 \or fünfte%
4305 \or sechste%
4306 \or siebte%
4307 \or achte%
4308 \or neunte%
4309 \fi
4310 }%
4311 \global\let\@@unitthstringFgerman\@@unitthstringFgerman
4312 % \end{macrocode}
4313 % Tens (feminine):
4314 % \begin{macrocode}
4315 \newcommand*\@@tenthstringFgerman[1]{%
4316 \ifcase#1%
4317 \or zehnte%
4318 \or zwanzigste%
4319 \or dreißigste%
4320 \or vierzigste%
4321 \or fünfzigste%
4322 \or sechzigste%
4323 \or siebzigste%
4324 \or achtzigste%
4325 \or neunzigste%
4326 \fi
4327 }%
4328 \global\let\@@tenthstringFgerman\@@tenthstringFgerman
4329 % \end{macrocode}
4330 % Teens (feminine)
4331 % \begin{macrocode}
4332 \newcommand*\@@teenthstringFgerman[1]{%
4333 \ifcase#1%
4334 zehnte%
4335 \or elfte%
4336 \or zwölfte%
4337 \or dreizehnte%
4338 \or vierzehnte%
4339 \or fünfzehnte%
4340 \or sechzehnte%
4341 \or siebzehnte%
4342 \or achtzehnte%
4343 \or neunzehnte%
4344 \fi
4345 }%
4346 \global\let\@@teenthstringFgerman\@@teenthstringFgerman
4347 % \end{macrocode}
4348 % Units (neuter):
4349 %\changes{2.0}{2012-09-25}{fixed spelling mistake (correction
4350 %provided by Dominik Wa\ss enhoven)}
4351 % \begin{macrocode}
4352 \newcommand*\@@unitthstringNgerman[1]{%
4353 \ifcase#1%
4354 nulltes%
4355 \or erstes%
4356 \or zweites%
4357 \or drittes%
4358 \or viertes%
4359 \or fünftes%
4360 \or sechstes%
4361 \or siebtes%
4362 \or achtes%
4363 \or neuntes%
4364 \fi
4365 }%
4366 \global\let\@@unitthstringNgerman\@@unitthstringNgerman
4367 % \end{macrocode}
4368 % Tens (neuter):
4369 % \begin{macrocode}
4370 \newcommand*\@@tenthstringNgerman[1]{%
4371 \ifcase#1%
4372 \or zehntes%
4373 \or zwanzigstes%
4374 \or dreißigstes%
4375 \or vierzigstes%
4376 \or fünfzigstes%
4377 \or sechzigstes%
4378 \or siebzigstes%
4379 \or achtzigstes%
4380 \or neunzigstes%
4381 \fi
4382 }%
4383 \global\let\@@tenthstringNgerman\@@tenthstringNgerman
4384 % \end{macrocode}
4385 % Teens (neuter)
4386 % \begin{macrocode}
4387 \newcommand*\@@teenthstringNgerman[1]{%
4388 \ifcase#1%
4389 zehntes%
4390 \or elftes%
4391 \or zwölftes%
4392 \or dreizehntes%
4393 \or vierzehntes%
4394 \or fünfzehntes%
4395 \or sechzehntes%
4396 \or siebzehntes%
4397 \or achtzehntes%
4398 \or neunzehntes%
4399 \fi
4400 }%
4401 \global\let\@@teenthstringNgerman\@@teenthstringNgerman
4402 % \end{macrocode}
4403 % This appends the results to \verb|\#2| for number \verb|\#2| (in range 0 to
4404 % 100.)
4405 % null and eins are dealt with separately in
4406 % \verb|\@@numberstringgerman|.
4407 % \begin{macrocode}
4408 \newcommand*\@@numberunderhundredgerman[2]{%
4409 \ifnum#1<10\relax
4410 \ifnum#1>0\relax
4411 \eappto#2{\@unitstring{#1}}%
4412 \fi
4413 \else
4414 \@tmpstrctr=#1\relax
4415 \@FCmodulo{\@tmpstrctr}{10}%
4416 \ifnum#1<20\relax
4417 \eappto#2{\@teenstring{\@tmpstrctr}}%
4418 \else
4419 \ifnum\@tmpstrctr=0\relax
4420 \else
4421 \eappto#2{\@unitstring{\@tmpstrctr}und}%
4422 \fi
4423 \@tmpstrctr=#1\relax
4424 \divide\@tmpstrctr by 10\relax
4425 \eappto#2{\@tenstring{\@tmpstrctr}}%
4426 \fi
4427 \fi
4428 }%
4429 \global\let\@@numberunderhundredgerman\@@numberunderhundredgerman
4430 % \end{macrocode}
4431 % This stores the results in the second argument
4432 % (which must be a control
4433 % sequence), but it doesn't display anything.
4434 % \begin{macrocode}
4435 \newcommand*\@@numberstringgerman[2]{%
4436 \ifnum#1>99999\relax
4437 \PackageError{fmtcount}{Out of range}%
4438 {This macro only works for values less than 100000}%
4439 \else
4440 \ifnum#1<0\relax
4441 \PackageError{fmtcount}{Negative numbers not permitted}%
4442 {This macro does not work for negative numbers, however
4443 you can try typing "minus" first, and then pass the modulus of
4444 this number}%
4445 \fi
4446 \fi
4447 \def#2{}%
4448 \@strctr=#1\relax \divide\@strctr by 1000\relax
4449 \ifnum\@strctr>1\relax
4450 % \end{macrocode}
4451 % \#1 is $\geq 2000$, \cs{@strctr} now contains the number of thousands
4452 % \begin{macrocode}
4453 \@@numberunderhundredgerman{\@strctr}{#2}%
4454 \appto#2{tausend}%
4455 \else
4456 % \end{macrocode}
4457 % \#1 lies in range [1000,1999]
4458 % \begin{macrocode}
4459 \ifnum\@strctr=1\relax
4460 \eappto#2{\eintausend}%
4461 \fi
4462 \fi
4463 \@strctr=#1\relax
4464 \@FCmodulo{\@strctr}{1000}%
4465 \divide\@strctr by 100\relax
4466 \ifnum\@strctr>1\relax
4467 % \end{macrocode}
4468 % now dealing with number in range [200,999]
4469 % \begin{macrocode}
4470 \eappto#2{\@unitstring{\@strctr}hundert}%
4471 \else
4472 \ifnum\@strctr=1\relax
4473 % \end{macrocode}
4474 % dealing with number in range [100,199]
4475 % \begin{macrocode}
4476 \ifnum#1>1000\relax
4477 % \end{macrocode}
4478 % if original number $> 1000$, use einhundert
4479 % \begin{macrocode}
4480 \appto#2{einhundert}%
4481 \else
4482 % \end{macrocode}
4483 % otherwise use \cs{einhundert}
4484 % \begin{macrocode}
4485 \eappto#2{\einhundert}%
4486 \fi
4487 \fi
4488 \fi
4489 \@strctr=#1\relax
4490 \@FCmodulo{\@strctr}{100}%
4491 \ifnum#1=0\relax
4492 \def#2{null}%
4493 \else
4494 \ifnum\@strctr=1\relax
4495 \appto#2{eins}%
4496 \else
4497 \@@numberunderhundredgerman{\@strctr}{#2}%
4498 \fi
4499 \fi
4500 }%
4501 \global\let\@@numberstringgerman\@@numberstringgerman
4502 % \end{macrocode}
4503 % As above, but for ordinals
4504 % \begin{macrocode}
4505 \newcommand*\@@numberunderhundredthgerman[2]{%
4506 \ifnum#1<10\relax
4507 \eappto#2{\@unitthstring{#1}}%
4508 \else
4509 \@tmpstrctr=#1\relax
4510 \@FCmodulo{\@tmpstrctr}{10}%
4511 \ifnum#1<20\relax
4512 \eappto#2{\@teenthstring{\@tmpstrctr}}%
4513 \else
4514 \ifnum\@tmpstrctr=0\relax
4515 \else
4516 \eappto#2{\@unitstring{\@tmpstrctr}und}%
4517 \fi
4518 \@tmpstrctr=#1\relax
4519 \divide\@tmpstrctr by 10\relax
4520 \eappto#2{\@tenthstring{\@tmpstrctr}}%
4521 \fi
4522 \fi
4523 }%
4524 \global\let\@@numberunderhundredthgerman\@@numberunderhundredthgerman
4525 % \end{macrocode}
4526 %\changes{3.06}{2018/06/17}{Use \cs{@orgargctr} counter in order to fix bug
4527 %\href{https://github.com/nlct/fmtcount/issues/33}{\#33}.}
4528 % \begin{macrocode}
4529 \newcommand*\@@ordinalstringgerman[2]{%
4530 \@orgargctr=#1\relax
4531 \ifnum\@orgargctr>99999\relax
4532 \PackageError{fmtcount}{Out of range}%
4533 {This macro only works for values less than 100000}%
4534 \else
4535 \ifnum\@orgargctr<0\relax
4536 \PackageError{fmtcount}{Negative numbers not permitted}%
4537 {This macro does not work for negative numbers, however
4538 you can try typing "minus" first, and then pass the modulus of
4539 this number}%
4540 \fi
4541 \fi
4542 \def#2{}%
4543 \@strctr=\@orgargctr\divide\@strctr by 1000\relax
4544 \ifnum\@strctr>1\relax
4545 % \end{macrocode}
4546 % \#1 is $\geq 2000$, \cs{@strctr} now contains the number of thousands
4547 % \begin{macrocode}
4548 \@@numberunderhundredgerman{\@strctr}{#2}%
4549 % \end{macrocode}
4550 % is that it, or is there more?
4551 % \begin{macrocode}
4552 \@tmpstrctr=\@orgargctr\@FCmodulo{\@tmpstrctr}{1000}%
4553 \ifnum\@tmpstrctr=0\relax
4554 \eappto#2{\@thousandth}%
4555 \else
4556 \appto#2{tausend}%
4557 \fi
4558 \else
4559 % \end{macrocode}
4560 % \#1 lies in range [1000,1999]
4561 % \begin{macrocode}
4562 \ifnum\@strctr=1\relax
4563 \ifnum\@orgargctr=1000\relax
4564 \eappto#2{\@thousandth}%
4565 \else
4566 \eappto#2{\eintausend}%
4567 \fi
4568 \fi
4569 \fi
4570 \@strctr=\@orgargctr
4571 \@FCmodulo{\@strctr}{1000}%
4572 \divide\@strctr by 100\relax
4573 \ifnum\@strctr>1\relax
4574 % \end{macrocode}
4575 % now dealing with number in range [200,999]
4576 % is that it, or is there more?
4577 % \begin{macrocode}
4578 \@tmpstrctr=\@orgargctr \@FCmodulo{\@tmpstrctr}{100}%
4579 \ifnum\@tmpstrctr=0\relax
4580 \ifnum\@strctr=1\relax
4581 \eappto#2{\@hundredth}%
4582 \else
4583 \eappto#2{\@unitstring{\@strctr}\@hundredth}%
4584 \fi
4585 \else
4586 \eappto#2{\@unitstring{\@strctr}hundert}%
4587 \fi
4588 \else
4589 \ifnum\@strctr=1\relax
4590 % \end{macrocode}
4591 % dealing with number in range [100,199]
4592 % is that it, or is there more?
4593 % \begin{macrocode}
4594 \@tmpstrctr=\@orgargctr \@FCmodulo{\@tmpstrctr}{100}%
4595 \ifnum\@tmpstrctr=0\relax
4596 \eappto#2{\@hundredth}%
4597 \else
4598 \ifnum\@orgargctr>1000\relax
4599 \appto#2{einhundert}%
4600 \else
4601 \eappto#2{\einhundert}%
4602 \fi
4603 \fi
4604 \fi
4605 \fi
4606 \@strctr=\@orgargctr
4607 \@FCmodulo{\@strctr}{100}%
4608 \ifthenelse{\@strctr=0 \and \@orgargctr>0 }{}{%
4609 \@@numberunderhundredthgerman{\@strctr}{#2}%
4610 }%
4611 }%
4612 \global\let\@@ordinalstringgerman\@@ordinalstringgerman
4613 % \end{macrocode}
4614 % Load fc-germanb.def if not already loaded
4615 % \begin{macrocode}
4616 \FCloadlang{germanb}%
4617 % \end{macrocode}
4618 % \setcounter{CodelineNo}{0}
4619 %\iffalse
4620 % \begin{macrocode}
4621 %</fc-german.def>
4622 % \end{macrocode}
4623 %\fi
4624 %\iffalse
4625 % \begin{macrocode}
4626 %<*fc-germanb.def>
4627 % \end{macrocode}
4628 %\fi
4629 % \subsubsection{fc-germanb.def}
4630 % \begin{macrocode}
4631 \ProvidesFCLanguage{germanb}[2013/08/17]%
4632 % \end{macrocode}
4633 % Load fc-german.def if not already loaded
4634 % \begin{macrocode}
4635 \FCloadlang{german}%
4636 % \end{macrocode}
4637 % Set \verb|germanb| to be equivalent to \verb|german|.
4638 % \begin{macrocode}
4639 \global\let\@ordinalMgermanb=\@ordinalMgerman
4640 \global\let\@ordinalFgermanb=\@ordinalFgerman
4641 \global\let\@ordinalNgermanb=\@ordinalNgerman
4642 \global\let\@numberstringMgermanb=\@numberstringMgerman
4643 \global\let\@numberstringFgermanb=\@numberstringFgerman
4644 \global\let\@numberstringNgermanb=\@numberstringNgerman
4645 \global\let\@NumberstringMgermanb=\@NumberstringMgerman
4646 \global\let\@NumberstringFgermanb=\@NumberstringFgerman
4647 \global\let\@NumberstringNgermanb=\@NumberstringNgerman
4648 \global\let\@ordinalstringMgermanb=\@ordinalstringMgerman
4649 \global\let\@ordinalstringFgermanb=\@ordinalstringFgerman
4650 \global\let\@ordinalstringNgermanb=\@ordinalstringNgerman
4651 \global\let\@OrdinalstringMgermanb=\@OrdinalstringMgerman
4652 \global\let\@OrdinalstringFgermanb=\@OrdinalstringFgerman
4653 \global\let\@OrdinalstringNgermanb=\@OrdinalstringNgerman
4654 % \end{macrocode}
4655 % \setcounter{CodelineNo}{0}
4656 %\iffalse
4657 % \begin{macrocode}
4658 %</fc-germanb.def>
4659 % \end{macrocode}
4660 %\fi
4661 %\iffalse
4662 % \begin{macrocode}
4663 %<*fc-italian.def>
4664 % \end{macrocode}
4665 %\fi
4666 % \subsubsection{fc-italian.def}
4667 % Italian support is now handled by interfacing to Enrico Gregorio's
4668 % itnumpar package.
4669 % \begin{macrocode}
4670 \ProvidesFCLanguage{italian}[2013/08/17]
4671
4672 \RequirePackage{itnumpar}
4673
4674 \newcommand{\@numberstringMitalian}[2]{%
4675 \begingroup
4676 \def\np@oa{o}%
4677 \count@=#1
4678 \edef\@tempa{\def\noexpand#2{\@numeroinparole{\count@}}}%
4679 \expandafter
4680 \endgroup\@tempa
4681 }
4682 \global\let\@numberstringMitalian\@numberstringMitalian
4683
4684 \newcommand{\@numberstringFitalian}[2]{%
4685 \begingroup
4686 \def\np@oa{a}%
4687 \count@=#1
4688 \edef\@tempa{\def\noexpand#2{\@numeroinparole{\count@}}}%
4689 \expandafter
4690 \endgroup\@tempa
4691 }
4692
4693 \global\let\@numberstringFitalian\@numberstringFitalian
4694
4695 \newcommand{\@NumberstringMitalian}[2]{%
4696 \begingroup
4697 \def\np@oa{o}%
4698 \count@=#1
4699 \edef\@tempa{\def\noexpand#2{\@Numeroinparole{\count@}}}%
4700 \expandafter
4701 \endgroup\@tempa
4702 }
4703 \global\let\@NumberstringMitalian\@NumberstringMitalian
4704
4705 \newcommand{\@NumberstringFitalian}[2]{%
4706 \begingroup
4707 \def\np@oa{a}%
4708 \count@=#1
4709 \edef\@tempa{\def\noexpand#2{\@Numeroinparole{\count@}}}%
4710 \expandafter
4711 \endgroup\@tempa
4712 }
4713 \global\let\@NumberstringFitalian\@NumberstringFitalian
4714
4715 \newcommand{\@ordinalstringMitalian}[2]{%
4716 \begingroup
4717 \count@=#1
4718 \edef\@tempa{\def\noexpand#2{\@ordinalem{\count@}}}%
4719 \expandafter
4720 \endgroup\@tempa
4721 }
4722 \global\let\@ordinalstringMitalian\@ordinalstringMitalian
4723
4724 \newcommand{\@ordinalstringFitalian}[2]{%
4725 \begingroup
4726 \count@=#1
4727 \edef\@tempa{\def\noexpand#2{\@ordinalef{\count@}}}%
4728 \expandafter
4729 \endgroup\@tempa
4730 }
4731 \global\let\@ordinalstringFitalian\@ordinalstringFitalian
4732
4733 \newcommand{\@OrdinalstringMitalian}[2]{%
4734 \begingroup
4735 \count@=#1
4736 \edef\@tempa{\def\noexpand#2{\@Ordinalem{\count@}}}%
4737 \expandafter
4738 \endgroup\@tempa
4739 }
4740 \global\let\@OrdinalstringMitalian\@OrdinalstringMitalian
4741
4742 \newcommand{\@ORDINALSTRINGMitalian}[2]{%
4743 \begingroup
4744 \count@=#1
4745 \edef\@tempa{\def\noexpand#2{\MakeUppercase{\@ordinalem{\count@}}}}%
4746 \expandafter
4747 \endgroup\@tempa
4748 }
4749 \global\let\@ORDINALSTRINGMitalian\@ORDINALSTRINGMitalian
4750
4751 \newcommand{\@OrdinalstringFitalian}[2]{%
4752 \begingroup
4753 \count@=#1
4754 \edef\@tempa{\def\noexpand#2{\@Ordinalef{\count@}}}%
4755 \expandafter
4756 \endgroup\@tempa
4757 }
4758 \global\let\@OrdinalstringFitalian\@OrdinalstringFitalian
4759
4760 \newcommand{\@ORDINALSTRINGFitalian}[2]{%
4761 \begingroup
4762 \count@=#1
4763 \edef\@tempa{\def\noexpand#2{\MakeUppercase{\@ordinalef{\count@}}}}%
4764 \expandafter
4765 \endgroup\@tempa
4766 }
4767 \global\let\@ORDINALSTRINGFitalian\@ORDINALSTRINGFitalian
4768
4769 \newcommand{\@ordinalMitalian}[2]{%
4770 \edef#2{#1\relax\noexpand\fmtord{o}}}
4771
4772 \global\let\@ordinalMitalian\@ordinalMitalian
4773
4774 \newcommand{\@ordinalFitalian}[2]{%
4775 \edef#2{#1\relax\noexpand\fmtord{a}}}
4776 \global\let\@ordinalFitalian\@ordinalFitalian
4777 % \end{macrocode}
4778 % \setcounter{CodelineNo}{0}
4779 %\iffalse
4780 % \begin{macrocode}
4781 %</fc-italian.def>
4782 % \end{macrocode}
4783 %\fi
4784 %\iffalse
4785 % \begin{macrocode}
4786 %<*fc-ngerman.def>
4787 % \end{macrocode}
4788 %\fi
4789 % \subsubsection{fc-ngerman.def}
4790 % \begin{macrocode}
4791 \ProvidesFCLanguage{ngerman}[2012/06/18]%
4792 \FCloadlang{german}%
4793 \FCloadlang{ngermanb}%
4794 % \end{macrocode}
4795 % Set \verb|ngerman| to be equivalent to \verb|german|. Is it okay to do
4796 % this? (I don't know the difference between the two.)
4797 % \begin{macrocode}
4798 \global\let\@ordinalMngerman=\@ordinalMgerman
4799 \global\let\@ordinalFngerman=\@ordinalFgerman
4800 \global\let\@ordinalNngerman=\@ordinalNgerman
4801 \global\let\@numberstringMngerman=\@numberstringMgerman
4802 \global\let\@numberstringFngerman=\@numberstringFgerman
4803 \global\let\@numberstringNngerman=\@numberstringNgerman
4804 \global\let\@NumberstringMngerman=\@NumberstringMgerman
4805 \global\let\@NumberstringFngerman=\@NumberstringFgerman
4806 \global\let\@NumberstringNngerman=\@NumberstringNgerman
4807 \global\let\@ordinalstringMngerman=\@ordinalstringMgerman
4808 \global\let\@ordinalstringFngerman=\@ordinalstringFgerman
4809 \global\let\@ordinalstringNngerman=\@ordinalstringNgerman
4810 \global\let\@OrdinalstringMngerman=\@OrdinalstringMgerman
4811 \global\let\@OrdinalstringFngerman=\@OrdinalstringFgerman
4812 \global\let\@OrdinalstringNngerman=\@OrdinalstringNgerman
4813 % \end{macrocode}
4814 % \setcounter{CodelineNo}{0}
4815 %\iffalse
4816 % \begin{macrocode}
4817 %</fc-ngerman.def>
4818 % \end{macrocode}
4819 %\fi
4820 %\iffalse
4821 % \begin{macrocode}
4822 %<*fc-ngermanb.def>
4823 % \end{macrocode}
4824 %\fi
4825 % \subsubsection{fc-ngermanb.def}
4826 % \begin{macrocode}
4827 \ProvidesFCLanguage{ngermanb}[2013/08/17]%
4828 \FCloadlang{german}%
4829 % \end{macrocode}
4830 % Set \verb|ngermanb| to be equivalent to \verb|german|. Is it okay to do
4831 % this? (I don't know the difference between the two.)
4832 % \begin{macrocode}
4833 \global\let\@ordinalMngermanb=\@ordinalMgerman
4834 \global\let\@ordinalFngermanb=\@ordinalFgerman
4835 \global\let\@ordinalNngermanb=\@ordinalNgerman
4836 \global\let\@numberstringMngermanb=\@numberstringMgerman
4837 \global\let\@numberstringFngermanb=\@numberstringFgerman
4838 \global\let\@numberstringNngermanb=\@numberstringNgerman
4839 \global\let\@NumberstringMngermanb=\@NumberstringMgerman
4840 \global\let\@NumberstringFngermanb=\@NumberstringFgerman
4841 \global\let\@NumberstringNngermanb=\@NumberstringNgerman
4842 \global\let\@ordinalstringMngermanb=\@ordinalstringMgerman
4843 \global\let\@ordinalstringFngermanb=\@ordinalstringFgerman
4844 \global\let\@ordinalstringNngermanb=\@ordinalstringNgerman
4845 \global\let\@OrdinalstringMngermanb=\@OrdinalstringMgerman
4846 \global\let\@OrdinalstringFngermanb=\@OrdinalstringFgerman
4847 \global\let\@OrdinalstringNngermanb=\@OrdinalstringNgerman
4848 % \end{macrocode}
4849 % Load fc-ngerman.def if not already loaded
4850 % \begin{macrocode}
4851 \FCloadlang{ngerman}%
4852 % \end{macrocode}
4853 % \setcounter{CodelineNo}{0}
4854 %\iffalse
4855 % \begin{macrocode}
4856 %</fc-ngermanb.def>
4857 % \end{macrocode}
4858 %\fi
4859 %\iffalse
4860 % \begin{macrocode}
4861 %<*fc-portuges.def>
4862 % \end{macrocode}
4863 %\fi
4864 % \subsubsection{fc-portuges.def}
4865 % Portuguese definitions
4866 % \begin{macrocode}
4867 \ProvidesFCLanguage{portuges}[2017/12/26]%
4868 % \end{macrocode}
4869 % Define macro that converts a number or count register (first
4870 % argument) to an ordinal, and stores the result in the second
4871 % argument, which should be a control sequence. Masculine:
4872 % \begin{macrocode}
4873 \newcommand*\@ordinalMportuges[2]{%
4874 \ifnum#1=0\relax
4875 \edef#2{\number#1}%
4876 \else
4877 \edef#2{\number#1\relax\noexpand\fmtord{o}}%
4878 \fi
4879 }%
4880 \global\let\@ordinalMportuges\@ordinalMportuges
4881 % \end{macrocode}
4882 % Feminine:
4883 % \begin{macrocode}
4884 \newcommand*\@ordinalFportuges[2]{%
4885 \ifnum#1=0\relax
4886 \edef#2{\number#1}%
4887 \else
4888 \edef#2{\number#1\relax\noexpand\fmtord{a}}%
4889 \fi
4890 }%
4891 \global\let\@ordinalFportuges\@ordinalFportuges
4892 % \end{macrocode}
4893 % Make neuter same as masculine:
4894 % \begin{macrocode}
4895 \global\let\@ordinalNportuges\@ordinalMportuges
4896 % \end{macrocode}
4897 % Convert a number to a textual representation. To make it easier,
4898 % split it up into units, tens, teens and hundreds. Units (argument
4899 % must
4900 % be a number from 0 to 9):
4901 %\changes{2.04}{2014-06-09}{Fixed bug that had incorrect number of
4902 %parameters specified}
4903 % \begin{macrocode}
4904 \newcommand*\@@unitstringportuges[1]{%
4905 \ifcase#1\relax
4906 zero%
4907 \or um%
4908 \or dois%
4909 \or tr\^es%
4910 \or quatro%
4911 \or cinco%
4912 \or seis%
4913 \or sete%
4914 \or oito%
4915 \or nove%
4916 \fi
4917 }%
4918 \global\let\@@unitstringportuges\@@unitstringportuges
4919 % \end{macrocode}
4920 % As above, but for feminine:
4921 % \begin{macrocode}
4922 \newcommand*\@@unitstringFportuges[1]{%
4923 \ifcase#1\relax
4924 zero%
4925 \or uma%
4926 \or duas%
4927 \or tr\^es%
4928 \or quatro%
4929 \or cinco%
4930 \or seis%
4931 \or sete%
4932 \or oito%
4933 \or nove%
4934 \fi
4935 }%
4936 \global\let\@@unitstringFportuges\@@unitstringFportuges
4937 % \end{macrocode}
4938 % Tens (argument must be a number from 0 to 10):
4939 % \begin{macrocode}
4940 \newcommand*\@@tenstringportuges[1]{%
4941 \ifcase#1\relax
4942 \or dez%
4943 \or vinte%
4944 \or trinta%
4945 \or quarenta%
4946 \or cinquenta%
4947 \or sessenta%
4948 \or setenta%
4949 \or oitenta%
4950 \or noventa%
4951 \or cem%
4952 \fi
4953 }%
4954 \global\let\@@tenstringportuges\@@tenstringportuges
4955 % \end{macrocode}
4956 % Teens (argument must be a number from 0 to 9):
4957 % \changes{3.05}{2017/12/26}{Take fix of teen contributed by \href{https://github.com/sant0s}{sant0s}, prior
4958 % definitions pushed to \sty{fc-brazilian.def}.}
4959 % \begin{macrocode}
4960 \newcommand*\@@teenstringportuges[1]{%
4961 \ifcase#1\relax
4962 dez%
4963 \or onze%
4964 \or doze%
4965 \or treze%
4966 \or catorze%
4967 \or quinze%
4968 \or dezasseis%
4969 \or dezassete%
4970 \or dezoito%
4971 \or dezanove%
4972 \fi
4973 }%
4974 \global\let\@@teenstringportuges\@@teenstringportuges
4975 % \end{macrocode}
4976 % Hundreds:
4977 % \begin{macrocode}
4978 \newcommand*\@@hundredstringportuges[1]{%
4979 \ifcase#1\relax
4980 \or cento%
4981 \or duzentos%
4982 \or trezentos%
4983 \or quatrocentos%
4984 \or quinhentos%
4985 \or seiscentos%
4986 \or setecentos%
4987 \or oitocentos%
4988 \or novecentos%
4989 \fi
4990 }%
4991 \global\let\@@hundredstringportuges\@@hundredstringportuges
4992 % \end{macrocode}
4993 % Hundreds (feminine):
4994 % \begin{macrocode}
4995 \newcommand*\@@hundredstringFportuges[1]{%
4996 \ifcase#1\relax
4997 \or cento%
4998 \or duzentas%
4999 \or trezentas%
5000 \or quatrocentas%
5001 \or quinhentas%
5002 \or seiscentas%
5003 \or setecentas%
5004 \or oitocentas%
5005 \or novecentas%
5006 \fi
5007 }%
5008 \global\let\@@hundredstringFportuges\@@hundredstringFportuges
5009 % \end{macrocode}
5010 % Units (initial letter in upper case):
5011 % \begin{macrocode}
5012 \newcommand*\@@Unitstringportuges[1]{%
5013 \ifcase#1\relax
5014 Zero%
5015 \or Um%
5016 \or Dois%
5017 \or Tr\^es%
5018 \or Quatro%
5019 \or Cinco%
5020 \or Seis%
5021 \or Sete%
5022 \or Oito%
5023 \or Nove%
5024 \fi
5025 }%
5026 \global\let\@@Unitstringportuges\@@Unitstringportuges
5027 % \end{macrocode}
5028 % As above, but feminine:
5029 % \begin{macrocode}
5030 \newcommand*\@@UnitstringFportuges[1]{%
5031 \ifcase#1\relax
5032 Zera%
5033 \or Uma%
5034 \or Duas%
5035 \or Tr\^es%
5036 \or Quatro%
5037 \or Cinco%
5038 \or Seis%
5039 \or Sete%
5040 \or Oito%
5041 \or Nove%
5042 \fi
5043 }%
5044 \global\let\@@UnitstringFportuges\@@UnitstringFportuges
5045 % \end{macrocode}
5046 % Tens (with initial letter in upper case):
5047 % \begin{macrocode}
5048 \newcommand*\@@Tenstringportuges[1]{%
5049 \ifcase#1\relax
5050 \or Dez%
5051 \or Vinte%
5052 \or Trinta%
5053 \or Quarenta%
5054 \or Cinquenta%
5055 \or Sessenta%
5056 \or Setenta%
5057 \or Oitenta%
5058 \or Noventa%
5059 \or Cem%
5060 \fi
5061 }%
5062 \global\let\@@Tenstringportuges\@@Tenstringportuges
5063 % \end{macrocode}
5064 % Teens (with initial letter in upper case):
5065 % \changes{3.05}{2017/12/26}{Take fix of teen contributed by \href{https://github.com/sant0s}{sant0s}, prior
5066 % definitions pushed to \sty{fc-brazilian.def}.}
5067 % \begin{macrocode}
5068 \newcommand*\@@Teenstringportuges[1]{%
5069 \ifcase#1\relax
5070 Dez%
5071 \or Onze%
5072 \or Doze%
5073 \or Treze%
5074 \or Catorze%
5075 \or Quinze%
5076 \or Dezasseis%
5077 \or Dezassete%
5078 \or Dezoito%
5079 \or Dezanove%
5080 \fi
5081 }%
5082 \global\let\@@Teenstringportuges\@@Teenstringportuges
5083 % \end{macrocode}
5084 % Hundreds (with initial letter in upper case):
5085 % \begin{macrocode}
5086 \newcommand*\@@Hundredstringportuges[1]{%
5087 \ifcase#1\relax
5088 \or Cento%
5089 \or Duzentos%
5090 \or Trezentos%
5091 \or Quatrocentos%
5092 \or Quinhentos%
5093 \or Seiscentos%
5094 \or Setecentos%
5095 \or Oitocentos%
5096 \or Novecentos%
5097 \fi
5098 }%
5099 \global\let\@@Hundredstringportuges\@@Hundredstringportuges
5100 % \end{macrocode}
5101 % As above, but feminine:
5102 % \begin{macrocode}
5103 \newcommand*\@@HundredstringFportuges[1]{%
5104 \ifcase#1\relax
5105 \or Cento%
5106 \or Duzentas%
5107 \or Trezentas%
5108 \or Quatrocentas%
5109 \or Quinhentas%
5110 \or Seiscentas%
5111 \or Setecentas%
5112 \or Oitocentas%
5113 \or Novecentas%
5114 \fi
5115 }%
5116 \global\let\@@HundredstringFportuges\@@HundredstringFportuges
5117 % \end{macrocode}
5118 % This has changed in version 1.08, so that it now stores
5119 % the result in the second argument, but doesn't display
5120 % anything. Since it only affects internal macros, it shouldn't
5121 % affect documents created with older versions. (These internal
5122 % macros are not meant for use in documents.)
5123 % \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by
5124 % \cs{newcommand*} as robustness is handled now at top level in
5125 % \texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned macros
5126 % are \cs{@numberstringMportuges}, \cs{@numberstringFportuges},
5127 % \cs{@NumberstringMportuges}, \cs{@NumberstringFportuges},
5128 % \cs{@ordinalstringMportuges}, \cs{@ordinalstringFportuges},
5129 % \cs{@OrdinalstringMportuges}, and \cs{@OrdinalstringFportuges}.}
5130 % \changes{3.03}{2017/07/21}{Fix bug
5131 % \#\href{https://github.com/nlct/fmtcount/issues/25}{25}.}
5132 % \begin{macrocode}
5133 \newcommand*{\@numberstringMportuges}[2]{%
5134 \let\@unitstring=\@@unitstringportuges
5135 \let\@teenstring=\@@teenstringportuges
5136 \let\@tenstring=\@@tenstringportuges
5137 \let\@hundredstring=\@@hundredstringportuges
5138 \def\@hundred{cem}\def\@thousand{mil}%
5139 \def\@andname{e}%
5140 \@@numberstringportuges{#1}{#2}%
5141 }%
5142 \global\let\@numberstringMportuges\@numberstringMportuges
5143 % \end{macrocode}
5144 % As above, but feminine form:
5145 % \begin{macrocode}
5146 \newcommand*{\@numberstringFportuges}[2]{%
5147 \let\@unitstring=\@@unitstringFportuges
5148 \let\@teenstring=\@@teenstringportuges
5149 \let\@tenstring=\@@tenstringportuges
5150 \let\@hundredstring=\@@hundredstringFportuges
5151 \def\@hundred{cem}\def\@thousand{mil}%
5152 \def\@andname{e}%
5153 \@@numberstringportuges{#1}{#2}%
5154 }%
5155 \global\let\@numberstringFportuges\@numberstringFportuges
5156 % \end{macrocode}
5157 % Make neuter same as masculine:
5158 % \begin{macrocode}
5159 \global\let\@numberstringNportuges\@numberstringMportuges
5160 % \end{macrocode}
5161 % As above, but initial letters in upper case:
5162 % \begin{macrocode}
5163 \newcommand*{\@NumberstringMportuges}[2]{%
5164 \let\@unitstring=\@@Unitstringportuges
5165 \let\@teenstring=\@@Teenstringportuges
5166 \let\@tenstring=\@@Tenstringportuges
5167 \let\@hundredstring=\@@Hundredstringportuges
5168 \def\@hundred{Cem}\def\@thousand{Mil}%
5169 \def\@andname{e}%
5170 \@@numberstringportuges{#1}{#2}%
5171 }%
5172 \global\let\@NumberstringMportuges\@NumberstringMportuges
5173 % \end{macrocode}
5174 % As above, but feminine form:
5175 % \begin{macrocode}
5176 \newcommand*{\@NumberstringFportuges}[2]{%
5177 \let\@unitstring=\@@UnitstringFportuges
5178 \let\@teenstring=\@@Teenstringportuges
5179 \let\@tenstring=\@@Tenstringportuges
5180 \let\@hundredstring=\@@HundredstringFportuges
5181 \def\@hundred{Cem}\def\@thousand{Mil}%
5182 \def\@andname{e}%
5183 \@@numberstringportuges{#1}{#2}%
5184 }%
5185 \global\let\@NumberstringFportuges\@NumberstringFportuges
5186 % \end{macrocode}
5187 % Make neuter same as masculine:
5188 % \begin{macrocode}
5189 \global\let\@NumberstringNportuges\@NumberstringMportuges
5190 % \end{macrocode}
5191 % As above, but for ordinals.
5192 % \begin{macrocode}
5193 \newcommand*{\@ordinalstringMportuges}[2]{%
5194 \let\@unitthstring=\@@unitthstringportuges
5195 \let\@unitstring=\@@unitstringportuges
5196 \let\@teenthstring=\@@teenthstringportuges
5197 \let\@tenthstring=\@@tenthstringportuges
5198 \let\@hundredthstring=\@@hundredthstringportuges
5199 \def\@thousandth{mil\'esimo}%
5200 \@@ordinalstringportuges{#1}{#2}%
5201 }%
5202 \global\let\@ordinalstringMportuges\@ordinalstringMportuges
5203 % \end{macrocode}
5204 % Feminine form:
5205 % \begin{macrocode}
5206 \newcommand*{\@ordinalstringFportuges}[2]{%
5207 \let\@unitthstring=\@@unitthstringFportuges
5208 \let\@unitstring=\@@unitstringFportuges
5209 \let\@teenthstring=\@@teenthstringportuges
5210 \let\@tenthstring=\@@tenthstringFportuges
5211 \let\@hundredthstring=\@@hundredthstringFportuges
5212 \def\@thousandth{mil\'esima}%
5213 \@@ordinalstringportuges{#1}{#2}%
5214 }%
5215 \global\let\@ordinalstringFportuges\@ordinalstringFportuges
5216 % \end{macrocode}
5217 % Make neuter same as masculine:
5218 % \begin{macrocode}
5219 \global\let\@ordinalstringNportuges\@ordinalstringMportuges
5220 % \end{macrocode}
5221 % As above, but initial letters in upper case (masculine):
5222 % \begin{macrocode}
5223 \newcommand*{\@OrdinalstringMportuges}[2]{%
5224 \let\@unitthstring=\@@Unitthstringportuges
5225 \let\@unitstring=\@@Unitstringportuges
5226 \let\@teenthstring=\@@teenthstringportuges
5227 \let\@tenthstring=\@@Tenthstringportuges
5228 \let\@hundredthstring=\@@Hundredthstringportuges
5229 \def\@thousandth{Mil\'esimo}%
5230 \@@ordinalstringportuges{#1}{#2}%
5231 }%
5232 \global\let\@OrdinalstringMportuges\@OrdinalstringMportuges
5233 % \end{macrocode}
5234 % Feminine form:
5235 % \begin{macrocode}
5236 \newcommand*{\@OrdinalstringFportuges}[2]{%
5237 \let\@unitthstring=\@@UnitthstringFportuges
5238 \let\@unitstring=\@@UnitstringFportuges
5239 \let\@teenthstring=\@@teenthstringportuges
5240 \let\@tenthstring=\@@TenthstringFportuges
5241 \let\@hundredthstring=\@@HundredthstringFportuges
5242 \def\@thousandth{Mil\'esima}%
5243 \@@ordinalstringportuges{#1}{#2}%
5244 }%
5245 \global\let\@OrdinalstringFportuges\@OrdinalstringFportuges
5246 % \end{macrocode}
5247 % Make neuter same as masculine:
5248 % \begin{macrocode}
5249 \global\let\@OrdinalstringNportuges\@OrdinalstringMportuges
5250 % \end{macrocode}
5251 % In order to do the ordinals, split into units, teens, tens
5252 % and hundreds. Units:
5253 % \begin{macrocode}
5254 \newcommand*\@@unitthstringportuges[1]{%
5255 \ifcase#1\relax
5256 zero%
5257 \or primeiro%
5258 \or segundo%
5259 \or terceiro%
5260 \or quarto%
5261 \or quinto%
5262 \or sexto%
5263 \or s\'etimo%
5264 \or oitavo%
5265 \or nono%
5266 \fi
5267 }%
5268 \global\let\@@unitthstringportuges\@@unitthstringportuges
5269 % \end{macrocode}
5270 % Tens:
5271 % \begin{macrocode}
5272 \newcommand*\@@tenthstringportuges[1]{%
5273 \ifcase#1\relax
5274 \or d\'ecimo%
5275 \or vig\'esimo%
5276 \or trig\'esimo%
5277 \or quadrag\'esimo%
5278 \or quinquag\'esimo%
5279 \or sexag\'esimo%
5280 \or setuag\'esimo%
5281 \or octog\'esimo%
5282 \or nonag\'esimo%
5283 \fi
5284 }%
5285 \global\let\@@tenthstringportuges\@@tenthstringportuges
5286 % \end{macrocode}
5287 % Teens:
5288 % \begin{macrocode}
5289 \newcommand*\@@teenthstringportuges[1]{%
5290 \@tenthstring{1}%
5291 \ifnum#1>0\relax
5292 -\@unitthstring{#1}%
5293 \fi
5294 }%
5295 \global\let\@@teenthstringportuges\@@teenthstringportuges
5296 % \end{macrocode}
5297 % Hundreds:
5298 % \begin{macrocode}
5299 \newcommand*\@@hundredthstringportuges[1]{%
5300 \ifcase#1\relax
5301 \or cent\'esimo%
5302 \or ducent\'esimo%
5303 \or trecent\'esimo%
5304 \or quadringent\'esimo%
5305 \or quingent\'esimo%
5306 \or seiscent\'esimo%
5307 \or setingent\'esimo%
5308 \or octingent\'esimo%
5309 \or nongent\'esimo%
5310 \fi
5311 }%
5312 \global\let\@@hundredthstringportuges\@@hundredthstringportuges
5313 % \end{macrocode}
5314 % Units (feminine):
5315 % \begin{macrocode}
5316 \newcommand*\@@unitthstringFportuges[1]{%
5317 \ifcase#1\relax
5318 zero%
5319 \or primeira%
5320 \or segunda%
5321 \or terceira%
5322 \or quarta%
5323 \or quinta%
5324 \or sexta%
5325 \or s\'etima%
5326 \or oitava%
5327 \or nona%
5328 \fi
5329 }%
5330 \global\let\@@unitthstringFportuges\@@unitthstringFportuges
5331 % \end{macrocode}
5332 % Tens (feminine):
5333 % \begin{macrocode}
5334 \newcommand*\@@tenthstringFportuges[1]{%
5335 \ifcase#1\relax
5336 \or d\'ecima%
5337 \or vig\'esima%
5338 \or trig\'esima%
5339 \or quadrag\'esima%
5340 \or quinquag\'esima%
5341 \or sexag\'esima%
5342 \or setuag\'esima%
5343 \or octog\'esima%
5344 \or nonag\'esima%
5345 \fi
5346 }%
5347 \global\let\@@tenthstringFportuges\@@tenthstringFportuges
5348 % \end{macrocode}
5349 % Hundreds (feminine):
5350 % \begin{macrocode}
5351 \newcommand*\@@hundredthstringFportuges[1]{%
5352 \ifcase#1\relax
5353 \or cent\'esima%
5354 \or ducent\'esima%
5355 \or trecent\'esima%
5356 \or quadringent\'esima%
5357 \or quingent\'esima%
5358 \or seiscent\'esima%
5359 \or setingent\'esima%
5360 \or octingent\'esima%
5361 \or nongent\'esima%
5362 \fi
5363 }%
5364 \global\let\@@hundredthstringFportuges\@@hundredthstringFportuges
5365 % \end{macrocode}
5366 % As above, but with initial letter in upper case. Units:
5367 % \begin{macrocode}
5368 \newcommand*\@@Unitthstringportuges[1]{%
5369 \ifcase#1\relax
5370 Zero%
5371 \or Primeiro%
5372 \or Segundo%
5373 \or Terceiro%
5374 \or Quarto%
5375 \or Quinto%
5376 \or Sexto%
5377 \or S\'etimo%
5378 \or Oitavo%
5379 \or Nono%
5380 \fi
5381 }%
5382 \global\let\@@Unitthstringportuges\@@Unitthstringportuges
5383 % \end{macrocode}
5384 % Tens:
5385 % \begin{macrocode}
5386 \newcommand*\@@Tenthstringportuges[1]{%
5387 \ifcase#1\relax
5388 \or D\'ecimo%
5389 \or Vig\'esimo%
5390 \or Trig\'esimo%
5391 \or Quadrag\'esimo%
5392 \or Quinquag\'esimo%
5393 \or Sexag\'esimo%
5394 \or Setuag\'esimo%
5395 \or Octog\'esimo%
5396 \or Nonag\'esimo%
5397 \fi
5398 }%
5399 \global\let\@@Tenthstringportuges\@@Tenthstringportuges
5400 % \end{macrocode}
5401 % Hundreds:
5402 % \begin{macrocode}
5403 \newcommand*\@@Hundredthstringportuges[1]{%
5404 \ifcase#1\relax
5405 \or Cent\'esimo%
5406 \or Ducent\'esimo%
5407 \or Trecent\'esimo%
5408 \or Quadringent\'esimo%
5409 \or Quingent\'esimo%
5410 \or Seiscent\'esimo%
5411 \or Setingent\'esimo%
5412 \or Octingent\'esimo%
5413 \or Nongent\'esimo%
5414 \fi
5415 }%
5416 \global\let\@@Hundredthstringportuges\@@Hundredthstringportuges
5417 % \end{macrocode}
5418 % As above, but feminine. Units:
5419 % \begin{macrocode}
5420 \newcommand*\@@UnitthstringFportuges[1]{%
5421 \ifcase#1\relax
5422 Zera%
5423 \or Primeira%
5424 \or Segunda%
5425 \or Terceira%
5426 \or Quarta%
5427 \or Quinta%
5428 \or Sexta%
5429 \or S\'etima%
5430 \or Oitava%
5431 \or Nona%
5432 \fi
5433 }%
5434 \global\let\@@UnitthstringFportuges\@@UnitthstringFportuges
5435 % \end{macrocode}
5436 % Tens (feminine);
5437 % \begin{macrocode}
5438 \newcommand*\@@TenthstringFportuges[1]{%
5439 \ifcase#1\relax
5440 \or D\'ecima%
5441 \or Vig\'esima%
5442 \or Trig\'esima%
5443 \or Quadrag\'esima%
5444 \or Quinquag\'esima%
5445 \or Sexag\'esima%
5446 \or Setuag\'esima%
5447 \or Octog\'esima%
5448 \or Nonag\'esima%
5449 \fi
5450 }%
5451 \global\let\@@TenthstringFportuges\@@TenthstringFportuges
5452 % \end{macrocode}
5453 % Hundreds (feminine):
5454 % \begin{macrocode}
5455 \newcommand*\@@HundredthstringFportuges[1]{%
5456 \ifcase#1\relax
5457 \or Cent\'esima%
5458 \or Ducent\'esima%
5459 \or Trecent\'esima%
5460 \or Quadringent\'esima%
5461 \or Quingent\'esima%
5462 \or Seiscent\'esima%
5463 \or Setingent\'esima%
5464 \or Octingent\'esima%
5465 \or Nongent\'esima%
5466 \fi
5467 }%
5468 \global\let\@@HundredthstringFportuges\@@HundredthstringFportuges
5469 % \end{macrocode}
5470 % This has changed in version 1.09, so that it now stores
5471 % the result in the second argument (a control sequence), but it
5472 % doesn't display anything. Since it only affects internal macros,
5473 % it shouldn't affect documents created with older versions.
5474 % (These internal macros are not meant for use in documents.)
5475 % \begin{macrocode}
5476 \newcommand*\@@numberstringportuges[2]{%
5477 \ifnum#1>99999\relax
5478 \PackageError{fmtcount}{Out of range}%
5479 {This macro only works for values less than 100000}%
5480 \else
5481 \ifnum#1<0\relax
5482 \PackageError{fmtcount}{Negative numbers not permitted}%
5483 {This macro does not work for negative numbers, however
5484 you can try typing "minus" first, and then pass the modulus of
5485 this number}%
5486 \fi
5487 \fi
5488 \def#2{}%
5489 \@strctr=#1\relax \divide\@strctr by 1000\relax
5490 \ifnum\@strctr>9\relax
5491 % \end{macrocode}
5492 % \#1 is greater or equal to 10000
5493 % \begin{macrocode}
5494 \divide\@strctr by 10\relax
5495 \ifnum\@strctr>1\relax
5496 \let\@@fc@numstr#2\relax
5497 \protected@edef#2{\@@fc@numstr\@tenstring{\@strctr}}%
5498 \@strctr=#1 \divide\@strctr by 1000\relax
5499 \@FCmodulo{\@strctr}{10}%
5500 \ifnum\@strctr>0
5501 \let\@@fc@numstr#2\relax
5502 \protected@edef#2{\@@fc@numstr\ \@andname\ \@unitstring{\@strctr}}%
5503 \fi
5504 \else
5505 \@strctr=#1\relax
5506 \divide\@strctr by 1000\relax
5507 \@FCmodulo{\@strctr}{10}%
5508 \let\@@fc@numstr#2\relax
5509 \protected@edef#2{\@@fc@numstr\@teenstring{\@strctr}}%
5510 \fi
5511 \let\@@fc@numstr#2\relax
5512 \protected@edef#2{\@@fc@numstr\ \@thousand}%
5513 \else
5514 \ifnum\@strctr>0\relax
5515 \ifnum\@strctr>1\relax
5516 \let\@@fc@numstr#2\relax
5517 \protected@edef#2{\@@fc@numstr\@unitstring{\@strctr}\ }%
5518 \fi
5519 \let\@@fc@numstr#2\relax
5520 \protected@edef#2{\@@fc@numstr\@thousand}%
5521 \fi
5522 \fi
5523 \@strctr=#1\relax \@FCmodulo{\@strctr}{1000}%
5524 \divide\@strctr by 100\relax
5525 \ifnum\@strctr>0\relax
5526 \ifnum#1>1000 \relax
5527 \let\@@fc@numstr#2\relax
5528 \protected@edef#2{\@@fc@numstr\ \@andname\ }%
5529 \fi
5530 \@tmpstrctr=#1\relax
5531 \@FCmodulo{\@tmpstrctr}{1000}%
5532 \let\@@fc@numstr#2\relax
5533 \ifnum\@tmpstrctr=100\relax
5534 \protected@edef#2{\@@fc@numstr\@tenstring{10}}%
5535 \else
5536 \protected@edef#2{\@@fc@numstr\@hundredstring{\@strctr}}%
5537 \fi%
5538 \fi
5539 \@strctr=#1\relax \@FCmodulo{\@strctr}{100}%
5540 \ifnum#1>100\relax
5541 \ifnum\@strctr>0\relax
5542 \let\@@fc@numstr#2\relax
5543 \protected@edef#2{\@@fc@numstr\ \@andname\ }%
5544 \fi
5545 \fi
5546 \ifnum\@strctr>19\relax
5547 \divide\@strctr by 10\relax
5548 \let\@@fc@numstr#2\relax
5549 \protected@edef#2{\@@fc@numstr\@tenstring{\@strctr}}%
5550 \@strctr=#1\relax \@FCmodulo{\@strctr}{10}%
5551 \ifnum\@strctr>0
5552 \let\@@fc@numstr#2\relax
5553 \protected@edef#2{\@@fc@numstr\ \@andname}%
5554 \let\@@fc@numstr#2\relax
5555 \protected@edef#2{\@@fc@numstr\ \@unitstring{\@strctr}}%
5556 \fi
5557 \else
5558 \ifnum\@strctr<10\relax
5559 \ifnum\@strctr=0\relax
5560 \ifnum#1<100\relax
5561 \let\@@fc@numstr#2\relax
5562 \protected@edef#2{\@@fc@numstr\@unitstring{\@strctr}}%
5563 \fi
5564 \else %(>0,<10)
5565 \let\@@fc@numstr#2\relax
5566 \protected@edef#2{\@@fc@numstr\@unitstring{\@strctr}}%
5567 \fi
5568 \else%>10
5569 \@FCmodulo{\@strctr}{10}%
5570 \let\@@fc@numstr#2\relax
5571 \protected@edef#2{\@@fc@numstr\@teenstring{\@strctr}}%
5572 \fi
5573 \fi
5574 }%
5575 \global\let\@@numberstringportuges\@@numberstringportuges
5576 % \end{macrocode}
5577 % As above, but for ordinals.
5578 % \begin{macrocode}
5579 \newcommand*\@@ordinalstringportuges[2]{%
5580 \@strctr=#1\relax
5581 \ifnum#1>99999
5582 \PackageError{fmtcount}{Out of range}%
5583 {This macro only works for values less than 100000}%
5584 \else
5585 \ifnum#1<0
5586 \PackageError{fmtcount}{Negative numbers not permitted}%
5587 {This macro does not work for negative numbers, however
5588 you can try typing "minus" first, and then pass the modulus of
5589 this number}%
5590 \else
5591 \def#2{}%
5592 \ifnum\@strctr>999\relax
5593 \divide\@strctr by 1000\relax
5594 \ifnum\@strctr>1\relax
5595 \ifnum\@strctr>9\relax
5596 \@tmpstrctr=\@strctr
5597 \ifnum\@strctr<20
5598 \@FCmodulo{\@tmpstrctr}{10}%
5599 \let\@@fc@ordstr#2\relax
5600 \protected@edef#2{\@@fc@ordstr\@teenthstring{\@tmpstrctr}}%
5601 \else
5602 \divide\@tmpstrctr by 10\relax
5603 \let\@@fc@ordstr#2\relax
5604 \protected@edef#2{\@@fc@ordstr\@tenthstring{\@tmpstrctr}}%
5605 \@tmpstrctr=\@strctr
5606 \@FCmodulo{\@tmpstrctr}{10}%
5607 \ifnum\@tmpstrctr>0\relax
5608 \let\@@fc@ordstr#2\relax
5609 \protected@edef#2{\@@fc@ordstr\@unitthstring{\@tmpstrctr}}%
5610 \fi
5611 \fi
5612 \else
5613 \let\@@fc@ordstr#2\relax
5614 \protected@edef#2{\@@fc@ordstr\@unitstring{\@strctr}}%
5615 \fi
5616 \fi
5617 \let\@@fc@ordstr#2\relax
5618 \protected@edef#2{\@@fc@ordstr\@thousandth}%
5619 \fi
5620 \@strctr=#1\relax
5621 \@FCmodulo{\@strctr}{1000}%
5622 \ifnum\@strctr>99\relax
5623 \@tmpstrctr=\@strctr
5624 \divide\@tmpstrctr by 100\relax
5625 \ifnum#1>1000\relax
5626 \let\@@fc@ordstr#2\relax
5627 \protected@edef#2{\@@fc@ordstr-}%
5628 \fi
5629 \let\@@fc@ordstr#2\relax
5630 \protected@edef#2{\@@fc@ordstr\@hundredthstring{\@tmpstrctr}}%
5631 \fi
5632 \@FCmodulo{\@strctr}{100}%
5633 \ifnum#1>99\relax
5634 \ifnum\@strctr>0\relax
5635 \let\@@fc@ordstr#2\relax
5636 \protected@edef#2{\@@fc@ordstr-}%
5637 \fi
5638 \fi
5639 \ifnum\@strctr>9\relax
5640 \@tmpstrctr=\@strctr
5641 \divide\@tmpstrctr by 10\relax
5642 \let\@@fc@ordstr#2\relax
5643 \protected@edef#2{\@@fc@ordstr\@tenthstring{\@tmpstrctr}}%
5644 \@tmpstrctr=\@strctr
5645 \@FCmodulo{\@tmpstrctr}{10}%
5646 \ifnum\@tmpstrctr>0\relax
5647 \let\@@fc@ordstr#2\relax
5648 \protected@edef#2{\@@fc@ordstr-\@unitthstring{\@tmpstrctr}}%
5649 \fi
5650 \else
5651 \ifnum\@strctr=0\relax
5652 \ifnum#1=0\relax
5653 \let\@@fc@ordstr#2\relax
5654 \protected@edef#2{\@@fc@ordstr\@unitstring{0}}%
5655 \fi
5656 \else
5657 \let\@@fc@ordstr#2\relax
5658 \protected@edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}%
5659 \fi
5660 \fi
5661 \fi
5662 \fi
5663 }%
5664 \global\let\@@ordinalstringportuges\@@ordinalstringportuges
5665 % \end{macrocode}
5666 % \setcounter{CodelineNo}{0}
5667 %\iffalse
5668 % \begin{macrocode}
5669 %</fc-portuges.def>
5670 % \end{macrocode}
5671 %\fi
5672 %\iffalse
5673 % \begin{macrocode}
5674 %<*fc-portuguese.def>
5675 % \end{macrocode}
5676 %\fi
5677 % \subsubsection{fc-portuguese.def}
5678 % \begin{macrocode}
5679 \ProvidesFCLanguage{portuguese}[2014/06/09]%
5680 % \end{macrocode}
5681 % Load \sty{fc-portuges.def} if not already loaded.
5682 % \begin{macrocode}
5683 \FCloadlang{portuges}%
5684 % \end{macrocode}
5685 % Set \verb|portuguese| to be equivalent to \verb|portuges|.
5686 % \begin{macrocode}
5687 \global\let\@ordinalMportuguese=\@ordinalMportuges
5688 \global\let\@ordinalFportuguese=\@ordinalFportuges
5689 \global\let\@ordinalNportuguese=\@ordinalNportuges
5690 \global\let\@numberstringMportuguese=\@numberstringMportuges
5691 \global\let\@numberstringFportuguese=\@numberstringFportuges
5692 \global\let\@numberstringNportuguese=\@numberstringNportuges
5693 \global\let\@NumberstringMportuguese=\@NumberstringMportuges
5694 \global\let\@NumberstringFportuguese=\@NumberstringFportuges
5695 \global\let\@NumberstringNportuguese=\@NumberstringNportuges
5696 \global\let\@ordinalstringMportuguese=\@ordinalstringMportuges
5697 \global\let\@ordinalstringFportuguese=\@ordinalstringFportuges
5698 \global\let\@ordinalstringNportuguese=\@ordinalstringNportuges
5699 \global\let\@OrdinalstringMportuguese=\@OrdinalstringMportuges
5700 \global\let\@OrdinalstringFportuguese=\@OrdinalstringFportuges
5701 \global\let\@OrdinalstringNportuguese=\@OrdinalstringNportuges
5702 % \end{macrocode}
5703 % \setcounter{CodelineNo}{0}
5704 %\iffalse
5705 % \begin{macrocode}
5706 %</fc-portuguese.def>
5707 % \end{macrocode}
5708 %\fi
5709 %\iffalse
5710 % \begin{macrocode}
5711 %<*fc-spanish.def>
5712 % \end{macrocode}
5713 %\fi
5714 % \subsubsection{fc-spanish.def}
5715 % Spanish definitions
5716 % \begin{macrocode}
5717 \ProvidesFCLanguage{spanish}[2016/01/12]%
5718 % \end{macrocode}
5719 % Define macro that converts a number or count register (first
5720 % argument) to an ordinal, and stores the result in the
5721 % second argument, which must be a control sequence.
5722 % Masculine:
5723 % \begin{macrocode}
5724 \newcommand*\@ordinalMspanish[2]{%
5725 \edef#2{\number#1\relax\noexpand\fmtord{o}}%
5726 }%
5727 \global\let\@ordinalMspanish\@ordinalMspanish
5728 % \end{macrocode}
5729 % Feminine:
5730 % \begin{macrocode}
5731 \newcommand{\@ordinalFspanish}[2]{%
5732 \edef#2{\number#1\relax\noexpand\fmtord{a}}%
5733 }%
5734 \global\let\@ordinalFspanish\@ordinalFspanish
5735 % \end{macrocode}
5736 % Make neuter same as masculine:
5737 % \begin{macrocode}
5738 \global\let\@ordinalNspanish\@ordinalMspanish
5739 % \end{macrocode}
5740 % Convert a number to text. The easiest way to do this is to
5741 % break it up into units, tens, teens, twenties and hundreds.
5742 % Units (argument must be a number from 0 to 9):
5743 % \begin{macrocode}
5744 \newcommand*\@@unitstringspanish[1]{%
5745 \ifcase#1\relax
5746 cero%
5747 \or uno%
5748 \or dos%
5749 \or tres%
5750 \or cuatro%
5751 \or cinco%
5752 \or seis%
5753 \or siete%
5754 \or ocho%
5755 \or nueve%
5756 \fi
5757 }%
5758 \global\let\@@unitstringspanish\@@unitstringspanish
5759 % \end{macrocode}
5760 % Feminine:
5761 % \begin{macrocode}
5762 \newcommand*\@@unitstringFspanish[1]{%
5763 \ifcase#1\relax
5764 cera%
5765 \or una%
5766 \or dos%
5767 \or tres%
5768 \or cuatro%
5769 \or cinco%
5770 \or seis%
5771 \or siete%
5772 \or ocho%
5773 \or nueve%
5774 \fi
5775 }%
5776 \global\let\@@unitstringFspanish\@@unitstringFspanish
5777 % \end{macrocode}
5778 % Tens (argument must go from 1 to 10):
5779 %\changes{2.0}{2012-06-18}{fixed spelling mistake (correction
5780 %provided by Fernando Maldonado)}
5781 % \begin{macrocode}
5782 \newcommand*\@@tenstringspanish[1]{%
5783 \ifcase#1\relax
5784 \or diez%
5785 \or veinte%
5786 \or treinta%
5787 \or cuarenta%
5788 \or cincuenta%
5789 \or sesenta%
5790 \or setenta%
5791 \or ochenta%
5792 \or noventa%
5793 \or cien%
5794 \fi
5795 }%
5796 \global\let\@@tenstringspanish\@@tenstringspanish
5797 % \end{macrocode}
5798 % Teens:
5799 % \begin{macrocode}
5800 \newcommand*\@@teenstringspanish[1]{%
5801 \ifcase#1\relax
5802 diez%
5803 \or once%
5804 \or doce%
5805 \or trece%
5806 \or catorce%
5807 \or quince%
5808 \or dieciséis%
5809 \or diecisiete%
5810 \or dieciocho%
5811 \or diecinueve%
5812 \fi
5813 }%
5814 \global\let\@@teenstringspanish\@@teenstringspanish
5815 % \end{macrocode}
5816 % Twenties:
5817 % \begin{macrocode}
5818 \newcommand*\@@twentystringspanish[1]{%
5819 \ifcase#1\relax
5820 veinte%
5821 \or veintiuno%
5822 \or veintidós%
5823 \or veintitrés%
5824 \or veinticuatro%
5825 \or veinticinco%
5826 \or veintiséis%
5827 \or veintisiete%
5828 \or veintiocho%
5829 \or veintinueve%
5830 \fi
5831 }%
5832 \global\let\@@twentystringspanish\@@twentystringspanish
5833 % \end{macrocode}
5834 % Feminine form:
5835 % \begin{macrocode}
5836 \newcommand*\@@twentystringFspanish[1]{%
5837 \ifcase#1\relax
5838 veinte%
5839 \or veintiuna%
5840 \or veintidós%
5841 \or veintitrés%
5842 \or veinticuatro%
5843 \or veinticinco%
5844 \or veintiséis%
5845 \or veintisiete%
5846 \or veintiocho%
5847 \or veintinueve%
5848 \fi
5849 }%
5850 \global\let\@@twentystringFspanish\@@twentystringFspanish
5851 % \end{macrocode}
5852 % Hundreds:
5853 % \begin{macrocode}
5854 \newcommand*\@@hundredstringspanish[1]{%
5855 \ifcase#1\relax
5856 \or ciento%
5857 \or doscientos%
5858 \or trescientos%
5859 \or cuatrocientos%
5860 \or quinientos%
5861 \or seiscientos%
5862 \or setecientos%
5863 \or ochocientos%
5864 \or novecientos%
5865 \fi
5866 }%
5867 \global\let\@@hundredstringspanish\@@hundredstringspanish
5868 % \end{macrocode}
5869 % Feminine form:
5870 % \begin{macrocode}
5871 \newcommand*\@@hundredstringFspanish[1]{%
5872 \ifcase#1\relax
5873 \or cienta%
5874 \or doscientas%
5875 \or trescientas%
5876 \or cuatrocientas%
5877 \or quinientas%
5878 \or seiscientas%
5879 \or setecientas%
5880 \or ochocientas%
5881 \or novecientas%
5882 \fi
5883 }%
5884 \global\let\@@hundredstringFspanish\@@hundredstringFspanish
5885 % \end{macrocode}
5886 % As above, but with initial letter uppercase:
5887 % \begin{macrocode}
5888 \newcommand*\@@Unitstringspanish[1]{%
5889 \ifcase#1\relax
5890 Cero%
5891 \or Uno%
5892 \or Dos%
5893 \or Tres%
5894 \or Cuatro%
5895 \or Cinco%
5896 \or Seis%
5897 \or Siete%
5898 \or Ocho%
5899 \or Nueve%
5900 \fi
5901 }%
5902 \global\let\@@Unitstringspanish\@@Unitstringspanish
5903 % \end{macrocode}
5904 % Feminine form:
5905 % \begin{macrocode}
5906 \newcommand*\@@UnitstringFspanish[1]{%
5907 \ifcase#1\relax
5908 Cera%
5909 \or Una%
5910 \or Dos%
5911 \or Tres%
5912 \or Cuatro%
5913 \or Cinco%
5914 \or Seis%
5915 \or Siete%
5916 \or Ocho%
5917 \or Nueve%
5918 \fi
5919 }%
5920 \global\let\@@UnitstringFspanish\@@UnitstringFspanish
5921 % \end{macrocode}
5922 % Tens:
5923 % \begin{macrocode}
5924 %\changes{2.0}{2012-06-18}{fixed spelling mistake (correction
5925 %provided by Fernando Maldonado)}
5926 \newcommand*\@@Tenstringspanish[1]{%
5927 \ifcase#1\relax
5928 \or Diez%
5929 \or Veinte%
5930 \or Treinta%
5931 \or Cuarenta%
5932 \or Cincuenta%
5933 \or Sesenta%
5934 \or Setenta%
5935 \or Ochenta%
5936 \or Noventa%
5937 \or Cien%
5938 \fi
5939 }%
5940 \global\let\@@Tenstringspanish\@@Tenstringspanish
5941 % \end{macrocode}
5942 % Teens:
5943 % \begin{macrocode}
5944 \newcommand*\@@Teenstringspanish[1]{%
5945 \ifcase#1\relax
5946 Diez%
5947 \or Once%
5948 \or Doce%
5949 \or Trece%
5950 \or Catorce%
5951 \or Quince%
5952 \or Dieciséis%
5953 \or Diecisiete%
5954 \or Dieciocho%
5955 \or Diecinueve%
5956 \fi
5957 }%
5958 \global\let\@@Teenstringspanish\@@Teenstringspanish
5959 % \end{macrocode}
5960 % Twenties:
5961 % \begin{macrocode}
5962 \newcommand*\@@Twentystringspanish[1]{%
5963 \ifcase#1\relax
5964 Veinte%
5965 \or Veintiuno%
5966 \or Veintidós%
5967 \or Veintitrés%
5968 \or Veinticuatro%
5969 \or Veinticinco%
5970 \or Veintiséis%
5971 \or Veintisiete%
5972 \or Veintiocho%
5973 \or Veintinueve%
5974 \fi
5975 }%
5976 \global\let\@@Twentystringspanish\@@Twentystringspanish
5977 % \end{macrocode}
5978 % Feminine form:
5979 % \begin{macrocode}
5980 \newcommand*\@@TwentystringFspanish[1]{%
5981 \ifcase#1\relax
5982 Veinte%
5983 \or Veintiuna%
5984 \or Veintidós%
5985 \or Veintitrés%
5986 \or Veinticuatro%
5987 \or Veinticinco%
5988 \or Veintiséis%
5989 \or Veintisiete%
5990 \or Veintiocho%
5991 \or Veintinueve%
5992 \fi
5993 }%
5994 \global\let\@@TwentystringFspanish\@@TwentystringFspanish
5995 % \end{macrocode}
5996 % Hundreds:
5997 % \begin{macrocode}
5998 \newcommand*\@@Hundredstringspanish[1]{%
5999 \ifcase#1\relax
6000 \or Ciento%
6001 \or Doscientos%
6002 \or Trescientos%
6003 \or Cuatrocientos%
6004 \or Quinientos%
6005 \or Seiscientos%
6006 \or Setecientos%
6007 \or Ochocientos%
6008 \or Novecientos%
6009 \fi
6010 }%
6011 \global\let\@@Hundredstringspanish\@@Hundredstringspanish
6012 % \end{macrocode}
6013 % Feminine form:
6014 % \begin{macrocode}
6015 \newcommand*\@@HundredstringFspanish[1]{%
6016 \ifcase#1\relax
6017 \or Cienta%
6018 \or Doscientas%
6019 \or Trescientas%
6020 \or Cuatrocientas%
6021 \or Quinientas%
6022 \or Seiscientas%
6023 \or Setecientas%
6024 \or Ochocientas%
6025 \or Novecientas%
6026 \fi
6027 }%
6028 \global\let\@@HundredstringFspanish\@@HundredstringFspanish
6029 % \end{macrocode}
6030 % This has changed in version 1.09, so that it now stores the
6031 % result in the second argument, but doesn't display anything.
6032 % Since it only affects internal macros, it shouldn't affect
6033 % documents created with older versions. (These internal macros
6034 % are not meant for use in documents.)
6035 % \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by
6036 % \cs{newcommand*} as robustness is handled now at top level in
6037 % \texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned
6038 % macros as \cs{@numberstringMspanish}, \cs{@numberstringFspanish},
6039 % \cs{@NumberstringFspanish}, \cs{@ordinalstringMspanish},
6040 % \cs{@ordinalstringFspanish}, \cs{@OrdinalstringMspanish}, and
6041 % \cs{@OrdinalstringFspanish}.}
6042 % \begin{macrocode}
6043 \newcommand*{\@numberstringMspanish}[2]{%
6044 \let\@unitstring=\@@unitstringspanish
6045 \let\@teenstring=\@@teenstringspanish
6046 \let\@tenstring=\@@tenstringspanish
6047 \let\@twentystring=\@@twentystringspanish
6048 \let\@hundredstring=\@@hundredstringspanish
6049 \def\@hundred{cien}\def\@thousand{mil}%
6050 \def\@andname{y}%
6051 \@@numberstringspanish{#1}{#2}%
6052 }%
6053 \global\let\@numberstringMspanish\@numberstringMspanish
6054 % \end{macrocode}
6055 % Feminine form:
6056 %\changes{2.0}{2012-06-18}{changed andname to `b' (correction
6057 %provided by Fernando Maldonado)}
6058 % \begin{macrocode}
6059 \newcommand*{\@numberstringFspanish}[2]{%
6060 \let\@unitstring=\@@unitstringFspanish
6061 \let\@teenstring=\@@teenstringspanish
6062 \let\@tenstring=\@@tenstringspanish
6063 \let\@twentystring=\@@twentystringFspanish
6064 \let\@hundredstring=\@@hundredstringFspanish
6065 \def\@hundred{cien}\def\@thousand{mil}%
6066 \def\@andname{b}%
6067 \@@numberstringspanish{#1}{#2}%
6068 }%
6069 \global\let\@numberstringFspanish\@numberstringFspanish
6070 % \end{macrocode}
6071 % Make neuter same as masculine:
6072 % \begin{macrocode}
6073 \global\let\@numberstringNspanish\@numberstringMspanish
6074 % \end{macrocode}
6075 % As above, but initial letters in upper case:
6076 % \begin{macrocode}
6077 \newcommand*{\@NumberstringMspanish}[2]{%
6078 \let\@unitstring=\@@Unitstringspanish
6079 \let\@teenstring=\@@Teenstringspanish
6080 \let\@tenstring=\@@Tenstringspanish
6081 \let\@twentystring=\@@Twentystringspanish
6082 \let\@hundredstring=\@@Hundredstringspanish
6083 \def\@andname{y}%
6084 \def\@hundred{Cien}\def\@thousand{Mil}%
6085 \@@numberstringspanish{#1}{#2}%
6086 }%
6087 \global\let\@NumberstringMspanish\@NumberstringMspanish
6088 % \end{macrocode}
6089 % Feminine form:
6090 %\changes{2.0}{2012-06-18}{changed andname to `b' (correction
6091 %provided by Fernando Maldonado)}
6092 % \begin{macrocode}
6093 \newcommand*{\@NumberstringFspanish}[2]{%
6094 \let\@unitstring=\@@UnitstringFspanish
6095 \let\@teenstring=\@@Teenstringspanish
6096 \let\@tenstring=\@@Tenstringspanish
6097 \let\@twentystring=\@@TwentystringFspanish
6098 \let\@hundredstring=\@@HundredstringFspanish
6099 \def\@andname{b}%
6100 \def\@hundred{Cien}\def\@thousand{Mil}%
6101 \@@numberstringspanish{#1}{#2}%
6102 }%
6103 \global\let\@NumberstringFspanish\@NumberstringFspanish
6104 % \end{macrocode}
6105 % Make neuter same as masculine:
6106 % \begin{macrocode}
6107 \global\let\@NumberstringNspanish\@NumberstringMspanish
6108 % \end{macrocode}
6109 % As above, but for ordinals.
6110 % \begin{macrocode}
6111 \newcommand*{\@ordinalstringMspanish}[2]{%
6112 \let\@unitthstring=\@@unitthstringspanish
6113 \let\@unitstring=\@@unitstringspanish
6114 \let\@teenthstring=\@@teenthstringspanish
6115 \let\@tenthstring=\@@tenthstringspanish
6116 \let\@hundredthstring=\@@hundredthstringspanish
6117 \def\@thousandth{milésimo}%
6118 \@@ordinalstringspanish{#1}{#2}%
6119 }%
6120 \global\let\@ordinalstringMspanish\@ordinalstringMspanish
6121 % \end{macrocode}
6122 % Feminine form:
6123 % \begin{macrocode}
6124 \newcommand*{\@ordinalstringFspanish}[2]{%
6125 \let\@unitthstring=\@@unitthstringFspanish
6126 \let\@unitstring=\@@unitstringFspanish
6127 \let\@teenthstring=\@@teenthstringFspanish
6128 \let\@tenthstring=\@@tenthstringFspanish
6129 \let\@hundredthstring=\@@hundredthstringFspanish
6130 \def\@thousandth{milésima}%
6131 \@@ordinalstringspanish{#1}{#2}%
6132 }%
6133 \global\let\@ordinalstringFspanish\@ordinalstringFspanish
6134 % \end{macrocode}
6135 % Make neuter same as masculine:
6136 % \begin{macrocode}
6137 \global\let\@ordinalstringNspanish\@ordinalstringMspanish
6138 % \end{macrocode}
6139 % As above, but with initial letters in upper case.
6140 % \begin{macrocode}
6141 \newcommand*{\@OrdinalstringMspanish}[2]{%
6142 \let\@unitthstring=\@@Unitthstringspanish
6143 \let\@unitstring=\@@Unitstringspanish
6144 \let\@teenthstring=\@@Teenthstringspanish
6145 \let\@tenthstring=\@@Tenthstringspanish
6146 \let\@hundredthstring=\@@Hundredthstringspanish
6147 \def\@thousandth{Milésimo}%
6148 \@@ordinalstringspanish{#1}{#2}%
6149 }
6150 \global\let\@OrdinalstringMspanish\@OrdinalstringMspanish
6151 % \end{macrocode}
6152 % Feminine form:
6153 % \begin{macrocode}
6154 \newcommand*{\@OrdinalstringFspanish}[2]{%
6155 \let\@unitthstring=\@@UnitthstringFspanish
6156 \let\@unitstring=\@@UnitstringFspanish
6157 \let\@teenthstring=\@@TeenthstringFspanish
6158 \let\@tenthstring=\@@TenthstringFspanish
6159 \let\@hundredthstring=\@@HundredthstringFspanish
6160 \def\@thousandth{Milésima}%
6161 \@@ordinalstringspanish{#1}{#2}%
6162 }%
6163 \global\let\@OrdinalstringFspanish\@OrdinalstringFspanish
6164 % \end{macrocode}
6165 % Make neuter same as masculine:
6166 % \begin{macrocode}
6167 \global\let\@OrdinalstringNspanish\@OrdinalstringMspanish
6168 % \end{macrocode}
6169 % Code for convert numbers into textual ordinals. As before,
6170 % it is easier to split it into units, tens, teens and hundreds.
6171 % Units:
6172 % \begin{macrocode}
6173 \newcommand*\@@unitthstringspanish[1]{%
6174 \ifcase#1\relax
6175 cero%
6176 \or primero%
6177 \or segundo%
6178 \or tercero%
6179 \or cuarto%
6180 \or quinto%
6181 \or sexto%
6182 \or séptimo%
6183 \or octavo%
6184 \or noveno%
6185 \fi
6186 }%
6187 \global\let\@@unitthstringspanish\@@unitthstringspanish
6188 % \end{macrocode}
6189 % Tens:
6190 % \begin{macrocode}
6191 \newcommand*\@@tenthstringspanish[1]{%
6192 \ifcase#1\relax
6193 \or décimo%
6194 \or vigésimo%
6195 \or trigésimo%
6196 \or cuadragésimo%
6197 \or quincuagésimo%
6198 \or sexagésimo%
6199 \or septuagésimo%
6200 \or octogésimo%
6201 \or nonagésimo%
6202 \fi
6203 }%
6204 \global\let\@@tenthstringspanish\@@tenthstringspanish
6205 % \end{macrocode}
6206 % Teens:
6207 % \begin{macrocode}
6208 \newcommand*\@@teenthstringspanish[1]{%
6209 \ifcase#1\relax
6210 décimo%
6211 \or undécimo%
6212 \or duodécimo%
6213 \or decimotercero%
6214 \or decimocuarto%
6215 \or decimoquinto%
6216 \or decimosexto%
6217 \or decimoséptimo%
6218 \or decimoctavo%
6219 \or decimonoveno%
6220 \fi
6221 }%
6222 \global\let\@@teenthstringspanish\@@teenthstringspanish
6223 % \end{macrocode}
6224 % Hundreds:
6225 % \begin{macrocode}
6226 \newcommand*\@@hundredthstringspanish[1]{%
6227 \ifcase#1\relax
6228 \or centésimo%
6229 \or ducentésimo%
6230 \or tricentésimo%
6231 \or cuadringentésimo%
6232 \or quingentésimo%
6233 \or sexcentésimo%
6234 \or septingésimo%
6235 \or octingentésimo%
6236 \or noningentésimo%
6237 \fi
6238 }%
6239 \global\let\@@hundredthstringspanish\@@hundredthstringspanish
6240 % \end{macrocode}
6241 % Units (feminine):
6242 % \begin{macrocode}
6243 \newcommand*\@@unitthstringFspanish[1]{%
6244 \ifcase#1\relax
6245 cera%
6246 \or primera%
6247 \or segunda%
6248 \or tercera%
6249 \or cuarta%
6250 \or quinta%
6251 \or sexta%
6252 \or séptima%
6253 \or octava%
6254 \or novena%
6255 \fi
6256 }%
6257 \global\let\@@unitthstringFspanish\@@unitthstringFspanish
6258 % \end{macrocode}
6259 % Tens (feminine):
6260 % \begin{macrocode}
6261 \newcommand*\@@tenthstringFspanish[1]{%
6262 \ifcase#1\relax
6263 \or décima%
6264 \or vigésima%
6265 \or trigésima%
6266 \or cuadragésima%
6267 \or quincuagésima%
6268 \or sexagésima%
6269 \or septuagésima%
6270 \or octogésima%
6271 \or nonagésima%
6272 \fi
6273 }%
6274 \global\let\@@tenthstringFspanish\@@tenthstringFspanish
6275 % \end{macrocode}
6276 % Teens (feminine)
6277 % \begin{macrocode}
6278 \newcommand*\@@teenthstringFspanish[1]{%
6279 \ifcase#1\relax
6280 décima%
6281 \or undécima%
6282 \or duodécima%
6283 \or decimotercera%
6284 \or decimocuarta%
6285 \or decimoquinta%
6286 \or decimosexta%
6287 \or decimoséptima%
6288 \or decimoctava%
6289 \or decimonovena%
6290 \fi
6291 }%
6292 \global\let\@@teenthstringFspanish\@@teenthstringFspanish
6293 % \end{macrocode}
6294 % Hundreds (feminine)
6295 % \begin{macrocode}
6296 \newcommand*\@@hundredthstringFspanish[1]{%
6297 \ifcase#1\relax
6298 \or centésima%
6299 \or ducentésima%
6300 \or tricentésima%
6301 \or cuadringentésima%
6302 \or quingentésima%
6303 \or sexcentésima%
6304 \or septingésima%
6305 \or octingentésima%
6306 \or noningentésima%
6307 \fi
6308 }%
6309 \global\let\@@hundredthstringFspanish\@@hundredthstringFspanish
6310 % \end{macrocode}
6311 % As above, but with initial letters in upper case
6312 % \begin{macrocode}
6313 \newcommand*\@@Unitthstringspanish[1]{%
6314 \ifcase#1\relax
6315 Cero%
6316 \or Primero%
6317 \or Segundo%
6318 \or Tercero%
6319 \or Cuarto%
6320 \or Quinto%
6321 \or Sexto%
6322 \or Séptimo%
6323 \or Octavo%
6324 \or Noveno%
6325 \fi
6326 }%
6327 \global\let\@@Unitthstringspanish\@@Unitthstringspanish
6328 % \end{macrocode}
6329 % Tens:
6330 % \begin{macrocode}
6331 \newcommand*\@@Tenthstringspanish[1]{%
6332 \ifcase#1\relax
6333 \or Décimo%
6334 \or Vigésimo%
6335 \or Trigésimo%
6336 \or Cuadragésimo%
6337 \or Quincuagésimo%
6338 \or Sexagésimo%
6339 \or Septuagésimo%
6340 \or Octogésimo%
6341 \or Nonagésimo%
6342 \fi
6343 }%
6344 \global\let\@@Tenthstringspanish\@@Tenthstringspanish
6345 % \end{macrocode}
6346 % Teens:
6347 % \begin{macrocode}
6348 \newcommand*\@@Teenthstringspanish[1]{%
6349 \ifcase#1\relax
6350 Décimo%
6351 \or Undécimo%
6352 \or Duodécimo%
6353 \or Decimotercero%
6354 \or Decimocuarto%
6355 \or Decimoquinto%
6356 \or Decimosexto%
6357 \or Decimoséptimo%
6358 \or Decimoctavo%
6359 \or Decimonoveno%
6360 \fi
6361 }%
6362 \global\let\@@Teenthstringspanish\@@Teenthstringspanish
6363 % \end{macrocode}
6364 % Hundreds
6365 % \begin{macrocode}
6366 \newcommand*\@@Hundredthstringspanish[1]{%
6367 \ifcase#1\relax
6368 \or Centésimo%
6369 \or Ducentésimo%
6370 \or Tricentésimo%
6371 \or Cuadringentésimo%
6372 \or Quingentésimo%
6373 \or Sexcentésimo%
6374 \or Septingésimo%
6375 \or Octingentésimo%
6376 \or Noningentésimo%
6377 \fi
6378 }%
6379 \global\let\@@Hundredthstringspanish\@@Hundredthstringspanish
6380 % \end{macrocode}
6381 % As above, but feminine.
6382 % \begin{macrocode}
6383 \newcommand*\@@UnitthstringFspanish[1]{%
6384 \ifcase#1\relax
6385 Cera%
6386 \or Primera%
6387 \or Segunda%
6388 \or Tercera%
6389 \or Cuarta%
6390 \or Quinta%
6391 \or Sexta%
6392 \or Séptima%
6393 \or Octava%
6394 \or Novena%
6395 \fi
6396 }%
6397 \global\let\@@UnitthstringFspanish\@@UnitthstringFspanish
6398 % \end{macrocode}
6399 % Tens (feminine)
6400 % \begin{macrocode}
6401 \newcommand*\@@TenthstringFspanish[1]{%
6402 \ifcase#1\relax
6403 \or Décima%
6404 \or Vigésima%
6405 \or Trigésima%
6406 \or Cuadragésima%
6407 \or Quincuagésima%
6408 \or Sexagésima%
6409 \or Septuagésima%
6410 \or Octogésima%
6411 \or Nonagésima%
6412 \fi
6413 }%
6414 \global\let\@@TenthstringFspanish\@@TenthstringFspanish
6415 % \end{macrocode}
6416 % Teens (feminine):
6417 % \begin{macrocode}
6418 \newcommand*\@@TeenthstringFspanish[1]{%
6419 \ifcase#1\relax
6420 Décima%
6421 \or Undécima%
6422 \or Duodécima%
6423 \or Decimotercera%
6424 \or Decimocuarta%
6425 \or Decimoquinta%
6426 \or Decimosexta%
6427 \or Decimoséptima%
6428 \or Decimoctava%
6429 \or Decimonovena%
6430 \fi
6431 }%
6432 \global\let\@@TeenthstringFspanish\@@TeenthstringFspanish
6433 % \end{macrocode}
6434 % Hundreds (feminine):
6435 % \begin{macrocode}
6436 \newcommand*\@@HundredthstringFspanish[1]{%
6437 \ifcase#1\relax
6438 \or Centésima%
6439 \or Ducentésima%
6440 \or Tricentésima%
6441 \or Cuadringentésima%
6442 \or Quingentésima%
6443 \or Sexcentésima%
6444 \or Septingésima%
6445 \or Octingentésima%
6446 \or Noningentésima%
6447 \fi
6448 }%
6449 \global\let\@@HundredthstringFspanish\@@HundredthstringFspanish
6450 % \end{macrocode}
6451 % This has changed in version 1.09, so that it now stores the
6452 % results in the second argument (which must be a control
6453 % sequence), but it doesn't display anything. Since it only
6454 % affects internal macros, it shouldn't affect documnets created
6455 % with older versions. (These internal macros are not meant for
6456 % use in documents.)
6457 % \begin{macrocode}
6458 \newcommand*\@@numberstringspanish[2]{%
6459 \ifnum#1>99999
6460 \PackageError{fmtcount}{Out of range}%
6461 {This macro only works for values less than 100000}%
6462 \else
6463 \ifnum#1<0
6464 \PackageError{fmtcount}{Negative numbers not permitted}%
6465 {This macro does not work for negative numbers, however
6466 you can try typing "minus" first, and then pass the modulus of
6467 this number}%
6468 \fi
6469 \fi
6470 \def#2{}%
6471 \@strctr=#1\relax \divide\@strctr by 1000\relax
6472 \ifnum\@strctr>9
6473 % \end{macrocode}
6474 % \#1 is greater or equal to 10000
6475 % \begin{macrocode}
6476 \divide\@strctr by 10
6477 \ifnum\@strctr>1
6478 \let\@@fc@numstr#2\relax
6479 \edef#2{\@@fc@numstr\@tenstring{\@strctr}}%
6480 \@strctr=#1 \divide\@strctr by 1000\relax
6481 \@FCmodulo{\@strctr}{10}%
6482 \ifnum\@strctr>0\relax
6483 \let\@@fc@numstr#2\relax
6484 \edef#2{\@@fc@numstr\ \@andname\ \@unitstring{\@strctr}}%
6485 \fi
6486 \else
6487 \@strctr=#1\relax
6488 \divide\@strctr by 1000\relax
6489 \@FCmodulo{\@strctr}{10}%
6490 \let\@@fc@numstr#2\relax
6491 \edef#2{\@@fc@numstr\@teenstring{\@strctr}}%
6492 \fi
6493 \let\@@fc@numstr#2\relax
6494 \edef#2{\@@fc@numstr\ \@thousand}%
6495 \else
6496 \ifnum\@strctr>0\relax
6497 \ifnum\@strctr>1\relax
6498 \let\@@fc@numstr#2\relax
6499 \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ }%
6500 \fi
6501 \let\@@fc@numstr#2\relax
6502 \edef#2{\@@fc@numstr\@thousand}%
6503 \fi
6504 \fi
6505 \@strctr=#1\relax \@FCmodulo{\@strctr}{1000}%
6506 \divide\@strctr by 100\relax
6507 \ifnum\@strctr>0\relax
6508 \ifnum#1>1000\relax
6509 \let\@@fc@numstr#2\relax
6510 \edef#2{\@@fc@numstr\ }%
6511 \fi
6512 \@tmpstrctr=#1\relax
6513 \@FCmodulo{\@tmpstrctr}{1000}%
6514 \ifnum\@tmpstrctr=100\relax
6515 \let\@@fc@numstr#2\relax
6516 \edef#2{\@@fc@numstr\@tenstring{10}}%
6517 \else
6518 \let\@@fc@numstr#2\relax
6519 \edef#2{\@@fc@numstr\@hundredstring{\@strctr}}%
6520 \fi
6521 \fi
6522 \@strctr=#1\relax \@FCmodulo{\@strctr}{100}%
6523 \ifnum#1>100\relax
6524 \ifnum\@strctr>0\relax
6525 \let\@@fc@numstr#2\relax
6526 % \end{macrocode}
6527 %\changes{2.0}{2012-06-18}{removed andname (correction
6528 %provided by Fernando Maldonado)}
6529 % \begin{macrocode}
6530 \edef#2{\@@fc@numstr\ }%
6531 \fi
6532 \fi
6533 \ifnum\@strctr>29\relax
6534 \divide\@strctr by 10\relax
6535 \let\@@fc@numstr#2\relax
6536 \edef#2{\@@fc@numstr\@tenstring{\@strctr}}%
6537 \@strctr=#1\relax \@FCmodulo{\@strctr}{10}%
6538 \ifnum\@strctr>0\relax
6539 \let\@@fc@numstr#2\relax
6540 \edef#2{\@@fc@numstr\ \@andname\ \@unitstring{\@strctr}}%
6541 \fi
6542 \else
6543 \ifnum\@strctr<10\relax
6544 \ifnum\@strctr=0\relax
6545 \ifnum#1<100\relax
6546 \let\@@fc@numstr#2\relax
6547 \edef#2{\@@fc@numstr\@unitstring{\@strctr}}%
6548 \fi
6549 \else
6550 \let\@@fc@numstr#2\relax
6551 \edef#2{\@@fc@numstr\@unitstring{\@strctr}}%
6552 \fi
6553 \else
6554 \ifnum\@strctr>19\relax
6555 \@FCmodulo{\@strctr}{10}%
6556 \let\@@fc@numstr#2\relax
6557 \edef#2{\@@fc@numstr\@twentystring{\@strctr}}%
6558 \else
6559 \@FCmodulo{\@strctr}{10}%
6560 \let\@@fc@numstr#2\relax
6561 \edef#2{\@@fc@numstr\@teenstring{\@strctr}}%
6562 \fi
6563 \fi
6564 \fi
6565 }%
6566 \global\let\@@numberstringspanish\@@numberstringspanish
6567 % \end{macrocode}
6568 % As above, but for ordinals
6569 % \begin{macrocode}
6570 \newcommand*\@@ordinalstringspanish[2]{%
6571 \@strctr=#1\relax
6572 \ifnum#1>99999
6573 \PackageError{fmtcount}{Out of range}%
6574 {This macro only works for values less than 100000}%
6575 \else
6576 \ifnum#1<0
6577 \PackageError{fmtcount}{Negative numbers not permitted}%
6578 {This macro does not work for negative numbers, however
6579 you can try typing "minus" first, and then pass the modulus of
6580 this number}%
6581 \else
6582 \def#2{}%
6583 \ifnum\@strctr>999\relax
6584 \divide\@strctr by 1000\relax
6585 \ifnum\@strctr>1\relax
6586 \ifnum\@strctr>9\relax
6587 \@tmpstrctr=\@strctr
6588 \ifnum\@strctr<20
6589 \@FCmodulo{\@tmpstrctr}{10}%
6590 \let\@@fc@ordstr#2\relax
6591 \edef#2{\@@fc@ordstr\@teenthstring{\@tmpstrctr}}%
6592 \else
6593 \divide\@tmpstrctr by 10\relax
6594 \let\@@fc@ordstr#2\relax
6595 \edef#2{\@@fc@ordstr\@tenthstring{\@tmpstrctr}}%
6596 \@tmpstrctr=\@strctr
6597 \@FCmodulo{\@tmpstrctr}{10}%
6598 \ifnum\@tmpstrctr>0\relax
6599 \let\@@fc@ordstr#2\relax
6600 \edef#2{\@@fc@ordstr\@unitthstring{\@tmpstrctr}}%
6601 \fi
6602 \fi
6603 \else
6604 \let\@@fc@ordstr#2\relax
6605 \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}%
6606 \fi
6607 \fi
6608 \let\@@fc@ordstr#2\relax
6609 \edef#2{\@@fc@ordstr\@thousandth}%
6610 \fi
6611 \@strctr=#1\relax
6612 \@FCmodulo{\@strctr}{1000}%
6613 \ifnum\@strctr>99\relax
6614 \@tmpstrctr=\@strctr
6615 \divide\@tmpstrctr by 100\relax
6616 \ifnum#1>1000\relax
6617 \let\@@fc@ordstr#2\relax
6618 \edef#2{\@@fc@ordstr\ }%
6619 \fi
6620 \let\@@fc@ordstr#2\relax
6621 \edef#2{\@@fc@ordstr\@hundredthstring{\@tmpstrctr}}%
6622 \fi
6623 \@FCmodulo{\@strctr}{100}%
6624 \ifnum#1>99\relax
6625 \ifnum\@strctr>0\relax
6626 \let\@@fc@ordstr#2\relax
6627 \edef#2{\@@fc@ordstr\ }%
6628 \fi
6629 \fi
6630 \ifnum\@strctr>19\relax
6631 \@tmpstrctr=\@strctr
6632 \divide\@tmpstrctr by 10\relax
6633 \let\@@fc@ordstr#2\relax
6634 \edef#2{\@@fc@ordstr\@tenthstring{\@tmpstrctr}}%
6635 \@tmpstrctr=\@strctr
6636 \@FCmodulo{\@tmpstrctr}{10}%
6637 \ifnum\@tmpstrctr>0\relax
6638 \let\@@fc@ordstr#2\relax
6639 \edef#2{\@@fc@ordstr\ \@unitthstring{\@tmpstrctr}}%
6640 \fi
6641 \else
6642 \ifnum\@strctr>9\relax
6643 \@FCmodulo{\@strctr}{10}%
6644 \let\@@fc@ordstr#2\relax
6645 \edef#2{\@@fc@ordstr\@teenthstring{\@strctr}}%
6646 \else
6647 \ifnum\@strctr=0\relax
6648 \ifnum#1=0\relax
6649 \let\@@fc@ordstr#2\relax
6650 \edef#2{\@@fc@ordstr\@unitstring{0}}%
6651 \fi
6652 \else
6653 \let\@@fc@ordstr#2\relax
6654 \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}%
6655 \fi
6656 \fi
6657 \fi
6658 \fi
6659 \fi
6660 }%
6661 \global\let\@@ordinalstringspanish\@@ordinalstringspanish
6662 % \end{macrocode}
6663 % \setcounter{CodelineNo}{0}
6664 %\iffalse
6665 % \begin{macrocode}
6666 %</fc-spanish.def>
6667 % \end{macrocode}
6668 %\fi
6669 %\iffalse
6670 % \begin{macrocode}
6671 %<*fc-UKenglish.def>
6672 % \end{macrocode}
6673 %\fi
6674 % \subsubsection{fc-UKenglish.def}
6675 % English definitions
6676 % \begin{macrocode}
6677 \ProvidesFCLanguage{UKenglish}[2013/08/17]%
6678 % \end{macrocode}
6679 % Loaded fc-english.def if not already loaded
6680 % \begin{macrocode}
6681 \FCloadlang{english}%
6682 % \end{macrocode}
6683 % These are all just synonyms for the commands provided by
6684 % fc-english.def.
6685 % \begin{macrocode}
6686 \global\let\@ordinalMUKenglish\@ordinalMenglish
6687 \global\let\@ordinalFUKenglish\@ordinalMenglish
6688 \global\let\@ordinalNUKenglish\@ordinalMenglish
6689 \global\let\@numberstringMUKenglish\@numberstringMenglish
6690 \global\let\@numberstringFUKenglish\@numberstringMenglish
6691 \global\let\@numberstringNUKenglish\@numberstringMenglish
6692 \global\let\@NumberstringMUKenglish\@NumberstringMenglish
6693 \global\let\@NumberstringFUKenglish\@NumberstringMenglish
6694 \global\let\@NumberstringNUKenglish\@NumberstringMenglish
6695 \global\let\@ordinalstringMUKenglish\@ordinalstringMenglish
6696 \global\let\@ordinalstringFUKenglish\@ordinalstringMenglish
6697 \global\let\@ordinalstringNUKenglish\@ordinalstringMenglish
6698 \global\let\@OrdinalstringMUKenglish\@OrdinalstringMenglish
6699 \global\let\@OrdinalstringFUKenglish\@OrdinalstringMenglish
6700 \global\let\@OrdinalstringNUKenglish\@OrdinalstringMenglish
6701 % \end{macrocode}
6702 % \setcounter{CodelineNo}{0}
6703 %\iffalse
6704 % \begin{macrocode}
6705 %</fc-UKenglish.def>
6706 % \end{macrocode}
6707 %\fi
6708 %\iffalse
6709 % \begin{macrocode}
6710 %<*fc-USenglish.def>
6711 % \end{macrocode}
6712 %\fi
6713 % \subsubsection{fc-USenglish.def}
6714 % US English definitions
6715 % \begin{macrocode}
6716 \ProvidesFCLanguage{USenglish}[2013/08/17]%
6717 % \end{macrocode}
6718 % Loaded fc-english.def if not already loaded
6719 % \begin{macrocode}
6720 \FCloadlang{english}%
6721 % \end{macrocode}
6722 % These are all just synonyms for the commands provided by
6723 % fc-english.def. (This needs fixing as there are some differences
6724 % between UK and US number strings.)
6725 % \begin{macrocode}
6726 \global\let\@ordinalMUSenglish\@ordinalMenglish
6727 \global\let\@ordinalFUSenglish\@ordinalMenglish
6728 \global\let\@ordinalNUSenglish\@ordinalMenglish
6729 \global\let\@numberstringMUSenglish\@numberstringMenglish
6730 \global\let\@numberstringFUSenglish\@numberstringMenglish
6731 \global\let\@numberstringNUSenglish\@numberstringMenglish
6732 \global\let\@NumberstringMUSenglish\@NumberstringMenglish
6733 \global\let\@NumberstringFUSenglish\@NumberstringMenglish
6734 \global\let\@NumberstringNUSenglish\@NumberstringMenglish
6735 \global\let\@ordinalstringMUSenglish\@ordinalstringMenglish
6736 \global\let\@ordinalstringFUSenglish\@ordinalstringMenglish
6737 \global\let\@ordinalstringNUSenglish\@ordinalstringMenglish
6738 \global\let\@OrdinalstringMUSenglish\@OrdinalstringMenglish
6739 \global\let\@OrdinalstringFUSenglish\@OrdinalstringMenglish
6740 \global\let\@OrdinalstringNUSenglish\@OrdinalstringMenglish
6741 % \end{macrocode}
6742 % \setcounter{CodelineNo}{0}
6743 %\iffalse
6744 % \begin{macrocode}
6745 %</fc-USenglish.def>
6746 % \end{macrocode}
6747 %\fi
6748 %\iffalse
6749 % \begin{macrocode}
6750 %<*fcnumparser.sty>
6751 % \end{macrocode}
6752 %\fi
6753 %\subsection{fcnumparser.sty}
6754 % \begin{macrocode}
6755 \NeedsTeXFormat{LaTeX2e}
6756 \ProvidesPackage{fcnumparser}[2017/06/15]
6757 % \end{macrocode}
6758 % \cs{fc@counter@parser} is just a shorthand to parse a number held in a counter.
6759 % \begin{macrocode}
6760 \def\fc@counter@parser#1{%
6761 \expandafter\fc@number@parser\expandafter{\the#1.}%
6762 }
6763 % \end{macrocode}
6764 % \begin{macrocode}
6765 \newcount\fc@digit@counter
6766
6767 \def\fc@end@{\fc@end}
6768 % \end{macrocode}
6769 % \DescribeMacro{\fc@number@analysis} First of all we need to separate the number between integer and fractional
6770 % part. Number to be analysed is in `\texttt{\#1}'. Decimal separator may be . or , whichever first. At end of
6771 % this macro, integer part goes to \cs{fc@integer@part} and fractional part goes to \cs{fc@fractional@part}.
6772 % \begin{macrocode}
6773 \def\fc@number@analysis#1\fc@nil{%
6774 % \end{macrocode}
6775 % First check for the presence of a decimal point in the number.
6776 % \begin{macrocode}
6777 \def\@tempb##1.##2\fc@nil{\def\fc@integer@part{##1}\def\@tempa{##2}}%
6778 \@tempb#1.\fc@end\fc@nil
6779 \ifx\@tempa\fc@end@
6780 % \end{macrocode}
6781 % Here \cs{@tempa} is \cs{ifx}-equal to \cs{fc@end}, which means that the number does not contain any decimal
6782 % point. So we do the same trick to search for a comma.
6783 % \begin{macrocode}
6784 \def\@tempb##1,##2\fc@nil{\def\fc@integer@part{##1}\def\@tempa{##2}}%
6785 \@tempb#1,\fc@end\fc@nil
6786 \ifx\@tempa\fc@end@
6787 % \end{macrocode}
6788 % No comma either, so fractional part is set empty.
6789 % \begin{macrocode}
6790 \def\fc@fractional@part{}%
6791 \else
6792 % \end{macrocode}
6793 % Comma has been found, so we just need to drop `\texttt{,}\cs{fc@end}' from the end of \cs{@tempa} to get the
6794 % fractional part.
6795 % \begin{macrocode}
6796 \def\@tempb##1,\fc@end{\def\fc@fractional@part{##1}}%
6797 \expandafter\@tempb\@tempa
6798 \fi
6799 \else
6800 % \end{macrocode}
6801 % Decimal point has been found, so we just need to drop `\texttt{.}\cs{fc@end}' from the end \cs{@tempa} to
6802 % get the fractional part.
6803 % \begin{macrocode}
6804 \def\@tempb##1.\fc@end{\def\fc@fractional@part{##1}}%
6805 \expandafter\@tempb\@tempa
6806 \fi
6807 }
6808 % \end{macrocode}
6809 % \DescribeMacro{\fc@number@parser} Macro \cs{fc@number@parser} is the main engine to parse a number. Argument
6810 % `\#1' is input and contains the number to be parsed. At end of this macro, each digit is stored separately
6811 % in a \cs{fc@digit@}\meta{$n$}, and macros \cs{fc@min@weight} and \cs{fc@max@weight} are set to the bounds
6812 % for \meta{$n$}.
6813 % \begin{macrocode}
6814 \def\fc@number@parser#1{%
6815 % \end{macrocode}
6816 % First remove all the spaces in \texttt{\#1}, and place the result into \cs{@tempa}.
6817 % \begin{macrocode}
6818 \let\@tempa\@empty
6819 \def\@tempb##1##2\fc@nil{%
6820 \def\@tempc{##1}%
6821 \ifx\@tempc\space
6822 \else
6823 \expandafter\def\expandafter\@tempa\expandafter{\@tempa ##1}%
6824 \fi
6825 \def\@tempc{##2}%
6826 \ifx\@tempc\@empty
6827 \expandafter\@gobble
6828 \else
6829 \expandafter\@tempb
6830 \fi
6831 ##2\fc@nil
6832 }%
6833 \@tempb#1\fc@nil
6834 % \end{macrocode}
6835 % Get the sign into \cs{fc@sign} and the unsigned number part into \cs{fc@number}.
6836 % \begin{macrocode}
6837 \def\@tempb##1##2\fc@nil{\def\fc@sign{##1}\def\fc@number{##2}}%
6838 \expandafter\@tempb\@tempa\fc@nil
6839 \expandafter\if\fc@sign+%
6840 \def\fc@sign@case{1}%
6841 \else
6842 \expandafter\if\fc@sign-%
6843 \def\fc@sign@case{2}%
6844 \else
6845 \def\fc@sign{}%
6846 \def\fc@sign@case{0}%
6847 \let\fc@number\@tempa
6848 \fi
6849 \fi
6850 \ifx\fc@number\@empty
6851 \PackageError{fcnumparser}{Invalid number}{Number must contain at least one non blank
6852 character after sign}%
6853 \fi
6854 % \end{macrocode}
6855 % Now, split \cs{fc@number} into \cs{fc@integer@part} and \cs{fc@fractional@part}.
6856 % \begin{macrocode}
6857 \expandafter\fc@number@analysis\fc@number\fc@nil
6858 % \end{macrocode}
6859 % Now, split \cs{fc@integer@part} into a sequence of \cs{fc@digit@}\meta{$n$} with \meta{$n$} ranging from
6860 % \cs{fc@unit@weight} to \cs{fc@max@weight}. We will use macro \cs{fc@parse@integer@digits} for that, but that
6861 % will place the digits into \cs{fc@digit@}\meta{$n$} with \meta{$n$} ranging from
6862 % \(2\times\cs{fc@unit@weight}-\cs{fc@max@weight}\) upto \(\cs{fc@unit@weight}-1\).
6863 % \begin{macrocode}
6864 \expandafter\fc@digit@counter\fc@unit@weight
6865 \expandafter\fc@parse@integer@digits\fc@integer@part\fc@end\fc@nil
6866 % \end{macrocode}
6867 % First we compute the weight of the most significant digit: after \cs{fc@parse@integer@digits},
6868 % \cs{fc@digit@counter} is equal to \(\cs{fc@unit@weight} -\mathrm{mw} -1\) and we want to set
6869 % \cs{fc@max@weight} to \(\cs{fc@unit@weight} +\mathrm{mw}\) so we do:
6870 % \begin{equation*}
6871 % \cs{fc@max@weight}\leftarrow (-\cs{fc@digit@counter}) + 2\times\cs{fc@unit@weight} -1
6872 % \end{equation*}
6873 % \begin{macrocode}
6874 \fc@digit@counter -\fc@digit@counter
6875 \advance\fc@digit@counter by \fc@unit@weight
6876 \advance\fc@digit@counter by \fc@unit@weight
6877 \advance\fc@digit@counter by -1 %
6878 \edef\fc@max@weight{\the\fc@digit@counter}%
6879 % \end{macrocode}
6880 % Now we loop for \(i = \cs{fc@unit@weight}\) to \cs{fc@max@weight} in order to copy all the digits from
6881 % \cs{fc@digit@}\meta{\(i + \mathrm{offset}\)} to \cs{fc@digit@}\meta{\(i\)}. First we compute
6882 % \(\mathrm{offset}\) into \cs{@tempi}.
6883 % \begin{macrocode}
6884 {%
6885 \count0 \fc@unit@weight\relax
6886 \count1 \fc@max@weight\relax
6887 \advance\count0 by -\count1 %
6888 \advance\count0 by -1 %
6889 \def\@tempa##1{\def\@tempb{\def\@tempi{##1}}}%
6890 \expandafter\@tempa\expandafter{\the\count0}%
6891 \expandafter
6892 }\@tempb
6893 % \end{macrocode}
6894 % Now we loop to copy the digits. To do that we define a macro \cs{@templ} for terminal recursion.
6895 % \begin{macrocode}
6896 \expandafter\fc@digit@counter\fc@unit@weight
6897 \def\@templ{%
6898 \ifnum\fc@digit@counter>\fc@max@weight
6899 \let\next\relax
6900 \else
6901 % \end{macrocode}
6902 % Here is the loop body:
6903 % \begin{macrocode}
6904 {%
6905 \count0 \@tempi
6906 \advance\count0 by \fc@digit@counter
6907 \expandafter\def\expandafter\@tempd\expandafter{\csname fc@digit@\the\count0\endcsname}%
6908 \expandafter\def\expandafter\@tempe\expandafter{\csname fc@digit@\the\fc@digit@counter\endcsname}%
6909 \def\@tempa####1####2{\def\@tempb{\let####1####2}}%
6910 \expandafter\expandafter\expandafter\@tempa\expandafter\@tempe\@tempd
6911 \expandafter
6912 }\@tempb
6913 \advance\fc@digit@counter by 1 %
6914 \fi
6915 \next
6916 }%
6917 \let\next\@templ
6918 \@templ
6919 % \end{macrocode}
6920 % Split \cs{fc@fractional@part} into a sequence of \cs{fc@digit@}\meta{$n$} with \meta{$n$} ranging from
6921 % \(\cs{fc@unit@weight}-1\) to \cs{fc@min@weight} by step of \(-1\). This is much more simpler because we get
6922 % the digits with the final range of index, so no post-processing loop is needed.
6923 % \begin{macrocode}
6924 \expandafter\fc@digit@counter\fc@unit@weight
6925 \expandafter\fc@parse@integer@digits\fc@fractional@part\fc@end\fc@nil
6926 \edef\fc@min@weight{\the\fc@digit@counter}%
6927 }
6928 % \end{macrocode}
6929 % \DescribeMacro{\fc@parse@integer@digits} Macro \cs{fc@parse@integer@digits} is used to
6930 % \begin{macrocode}
6931 \ifcsundef{fc@parse@integer@digits}{}{%
6932 \PackageError{fcnumparser}{Duplicate definition}{Redefinition of
6933 macro `fc@parse@integer@digits'}}
6934 \def\fc@parse@integer@digits#1#2\fc@nil{%
6935 \def\@tempa{#1}%
6936 \ifx\@tempa\fc@end@
6937 \def\next##1\fc@nil{}%
6938 \else
6939 \let\next\fc@parse@integer@digits
6940 \advance\fc@digit@counter by -1
6941 \expandafter\def\csname fc@digit@\the\fc@digit@counter\endcsname{#1}%
6942 \fi
6943 \next#2\fc@nil
6944 }
6945
6946
6947 \newcommand*{\fc@unit@weight}{0}
6948
6949 % \end{macrocode}
6950 % Now we have macros to read a few digits from the \cs{fc@digit@}\meta{$n$} array and form a correspoding
6951 % number.\newline \DescribeMacro{\fc@read@unit} \cs{fc@read@unit} just reads one digit and form an integer in
6952 % the range \([0 \intv 9]\). First we check that the macro is not yet defined.
6953 % \begin{macrocode}
6954 \ifcsundef{fc@read@unit}{}{%
6955 \PackageError{fcnumparser}{Duplicate definition}{Redefinition of macro `fc@read@unit'}}
6956 % \end{macrocode}
6957 % Arguments as follows:\def\interface{\newline\noindent
6958 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
6959 % \#1&output counter: into which the read value is placed\\
6960 % \#2&input number: unit weight at which reach the value is to be read
6961 % \end{tabularx}}\interface
6962 % \#2 does not need to be comprised between \cs{fc@min@weight} and {fc@min@weight}, if outside this interval,
6963 % then a zero is read.
6964 % \begin{macrocode}
6965 \def\fc@read@unit#1#2{%
6966 \ifnum#2>\fc@max@weight
6967 #1=0\relax
6968 \else
6969 \ifnum#2<\fc@min@weight
6970 #1=0\relax
6971 \else
6972 {%
6973 \edef\@tempa{\number#2}%
6974 \count0=\@tempa
6975 \edef\@tempa{\csname fc@digit@\the\count0\endcsname}%
6976 \def\@tempb##1{\def\@tempa{#1=##1\relax}}%
6977 \expandafter\@tempb\expandafter{\@tempa}%
6978 \expandafter
6979 }\@tempa
6980 \fi
6981 \fi
6982 }
6983 % \end{macrocode}
6984 % \DescribeMacro{\fc@read@hundred} Macro \cs{fc@read@hundred} is used to read a pair of digits and form an
6985 % integer in the range \([0 \intv 99]\). First we check that the macro is not yet defined.
6986 % \begin{macrocode}
6987 \ifcsundef{fc@read@hundred}{}{%
6988 \PackageError{fcnumparser}{Duplicate definition}{Redefinition of macro `fc@read@hundred'}}
6989 % \end{macrocode}
6990 % Arguments as follows --- same interface as \cs{fc@read@unit}:\interface
6991 % \begin{macrocode}
6992 \def\fc@read@hundred#1#2{%
6993 {%
6994 \fc@read@unit{\count0}{#2}%
6995 \def\@tempa##1{\fc@read@unit{\count1}{##1}}%
6996 \count2=#2%
6997 \advance\count2 by 1 %
6998 \expandafter\@tempa{\the\count2}%
6999 \multiply\count1 by 10 %
7000 \advance\count1 by \count0 %
7001 \def\@tempa##1{\def\@tempb{#1=##1\relax}}
7002 \expandafter\@tempa\expandafter{\the\count1}%
7003 \expandafter
7004 }\@tempb
7005 }
7006 % \end{macrocode}
7007 % \DescribeMacro{\fc@read@thousand} Macro \cs{fc@read@thousand} is used to read a trio of digits and form an
7008 % integer in the range \([0 \intv 999]\). First we check that the macro is not yet defined.
7009 % \begin{macrocode}
7010 \ifcsundef{fc@read@thousand}{}{%
7011 \PackageError{fcnumparser}{Duplicate definition}{Redefinition of macro
7012 `fc@read@thousand'}}
7013 % \end{macrocode}
7014 % Arguments as follows --- same interface as \cs{fc@read@unit}:\interface
7015 % \begin{macrocode}
7016 \def\fc@read@thousand#1#2{%
7017 {%
7018 \fc@read@unit{\count0}{#2}%
7019 \def\@tempa##1{\fc@read@hundred{\count1}{##1}}%
7020 \count2=#2%
7021 \advance\count2 by 1 %
7022 \expandafter\@tempa{\the\count2}%
7023 \multiply\count1 by 10 %
7024 \advance\count1 by \count0 %
7025 \def\@tempa##1{\def\@tempb{#1=##1\relax}}
7026 \expandafter\@tempa\expandafter{\the\count1}%
7027 \expandafter
7028 }\@tempb
7029 }
7030 % \end{macrocode}
7031 % Note: one myriad is ten thousand.
7032 % \DescribeMacro{\fc@read@thousand} Macro \cs{fc@read@myriad} is used to read a quatuor of digits and form an
7033 % integer in the range \([0 \intv 9999]\). First we check that the macro is not yet defined.
7034 % \begin{macrocode}
7035 \ifcsundef{fc@read@myriad}{}{%
7036 \PackageError{fcnumparser}{Duplicate definition}{Redefinition of macro
7037 `fc@read@myriad'}}
7038 % \end{macrocode}
7039 % Arguments as follows --- same interface as \cs{fc@read@unit}:\interface
7040 % \begin{macrocode}
7041 \def\fc@read@myriad#1#2{%
7042 {%
7043 \fc@read@hundred{\count0}{#2}%
7044 \def\@tempa##1{\fc@read@hundred{\count1}{##1}}%
7045 \count2=#2
7046 \advance\count2 by 2
7047 \expandafter\@tempa{\the\count2}%
7048 \multiply\count1 by 100 %
7049 \advance\count1 by \count0 %
7050 \def\@tempa##1{\def\@tempb{#1=##1\relax}}%
7051 \expandafter\@tempa\expandafter{\the\count1}%
7052 \expandafter
7053 }\@tempb
7054 }
7055 % \end{macrocode}
7056 % \DescribeMacro{\fc@check@nonzeros} Macro \cs{fc@check@nonzeros} is used to check whether the number
7057 % represented by digits \cs{fc@digit@}\meta{$n$}, with \(n\) in some interval, is zero, one, or more than one.
7058 % First we check that the macro is not yet defined.
7059 % \begin{macrocode}
7060 \ifcsundef{fc@check@nonzeros}{}{%
7061 \PackageError{fcnumparser}{Duplicate definition}{Redefinition of macro
7062 `fc@check@nonzeros'}}
7063 % \end{macrocode}
7064 % Arguments as follows:\newline\noindent
7065 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7066 % \#1&input number: minimum unit unit weight at which start to search the non-zeros\\
7067 % \#2&input number: maximum unit weight at which end to seach the non-zeros\\
7068 % \#3&output macro: let \(n\) be the number represented by digits the weight of which span from \texttt{\#1}
7069 % to \texttt{\#2}, then \texttt{\#3} is set to the number min(n,9).\\
7070 % \end{tabularx}
7071 % Actually \cs{fc@check@nonzeros} is just a wrapper to collect arguments, and the real job is delegated to
7072 % \cs{fc@@check@nonzeros@inner} which is called inside a group.
7073 % \begin{macrocode}
7074 \def\fc@check@nonzeros#1#2#3{%
7075 {%
7076 % \end{macrocode}
7077 % So first we save inputs into local macros used by \cs{fc@@check@nonzeros@inner} as input arguments
7078 % \begin{macrocode}
7079 \edef\@@tempa{\number#1}%
7080 \edef\@tempb{\number#2}%
7081 \count0=\@@tempa
7082 \count1=\@tempb\relax
7083 % \end{macrocode}
7084 % Then we do the real job
7085 % \begin{macrocode}
7086 \fc@@check@nonzeros@inner
7087 % \end{macrocode}
7088 % And finally, we propagate the output after end of group --- i.e. closing brace.
7089 % \begin{macrocode}
7090 \def\@tempd##1{\def\@tempa{\def#3{##1}}}%
7091 \expandafter\@tempd\expandafter{\@tempc}%
7092 \expandafter
7093 }\@tempa
7094 }
7095 % \end{macrocode}
7096 % \DescribeMacro{\fc@@check@nonzeros@inner} Macro \cs{fc@@check@nonzeros@inner} Check whether some part of the
7097 % parsed value contains some non-zero digit At the call of this macro we expect that:\newline\noindent
7098 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash}rX@{}}
7099 % \cs{@tempa}&input/output macro:\newline\noindent
7100 % \settowidth{\tabcolwidth}{output}%
7101 % \begin{tabular*}{\hsize}{@{}>{\raggedleft\arraybackslash\itshape}r%
7102 % p{\dimexpr\hsize-2\tabcolsep-\tabcolwidth}@{}}
7103 % input&minimum unit unit weight at which start to search the non-zeros\\
7104 % output&macro may have been redefined
7105 % \end{tabular*}\\
7106 % \cs{@tempb}&input/output macro:\newline\noindent
7107 % \settowidth{\tabcolwidth}{output}%
7108 % \begin{tabular*}{\hsize}{@{}>{\raggedleft\arraybackslash\itshape}r%
7109 % p{\dimexpr\hsize-2\tabcolsep-\tabcolwidth}@{}}
7110 % input&maximum unit weight at which end to seach the non-zeros\\
7111 % output&macro may have been redefined
7112 % \end{tabular*}\\
7113 % \cs{@tempc}&ouput macro: 0 if all-zeros, 1 if at least one zero is found\\
7114 % \cs{count0}&output counter: \(\mathrm{weight}+1\) of the first found non zero starting from minimum
7115 % \(\mathrm{weight}\).
7116 % \end{tabularx}
7117 % \begin{macrocode}
7118 \def\fc@@check@nonzeros@inner{%
7119 \ifnum\count0<\fc@min@weight
7120 \count0=\fc@min@weight\relax
7121 \fi
7122 \ifnum\count1>\fc@max@weight\relax
7123 \count1=\fc@max@weight
7124 \fi
7125 \count2\count0 %
7126 \advance\count2 by 1 %
7127 \ifnum\count0>\count1 %
7128 \PackageError{fcnumparser}{Unexpected arguments}{Number in argument 2 of macro
7129 `fc@check@nonzeros' must be at least equal to number in argument 1}%
7130 \else
7131 \fc@@check@nonzeros@inner@loopbody
7132 \ifnum\@tempc>0 %
7133 \ifnum\@tempc<9 %
7134 \ifnum\count0>\count1 %
7135 \else
7136 \let\@tempd\@tempc
7137 \fc@@check@nonzeros@inner@loopbody
7138 \ifnum\@tempc=0 %
7139 \let\@tempc\@tempd
7140 \else
7141 \def\@tempc{9}%
7142 \fi
7143 \fi
7144 \fi
7145 \fi
7146 \fi
7147 }
7148 % \end{macrocode}
7149 % \begin{macrocode}
7150 \def\fc@@check@nonzeros@inner@loopbody{%
7151 % \@tempc <- digit of weight \count0
7152 \expandafter\let\expandafter\@tempc\csname fc@digit@\the\count0\endcsname
7153 \advance\count0 by 1 %
7154 \ifnum\@tempc=0 %
7155 \ifnum\count0>\count1 %
7156 \let\next\relax
7157 \else
7158 \let\next\fc@@check@nonzeros@inner@loopbody
7159 \fi
7160 \else
7161 \ifnum\count0>\count2 %
7162 \def\@tempc{9}%
7163 \fi
7164 \let\next\relax
7165 \fi
7166 \next
7167 }
7168 % \end{macrocode}
7169 % \DescribeMacro{\fc@intpart@find@last} Macro \cs{fc@intpart@find@last} find the rightmost non zero digit in the
7170 % integer part. First check that the macro is not yet defined.
7171 % \begin{macrocode}
7172 \ifcsundef{fc@intpart@find@last}{}{%
7173 \PackageError{fcnumparser}{Duplicate definition}{Redefinition of macro
7174 `fc@intpart@find@last'}}
7175 % \end{macrocode}
7176 % When macro is called, the number of interest is already parsed, that is to say each digit of weight \(w\) is
7177 % stored in macro \cs{fc@digit@}\meta{$w$}. Macro \cs{fc@intpart@find@last} takes one single argument which
7178 % is a counter to set to the result.
7179 % \begin{macrocode}
7180 \def\fc@intpart@find@last#1{%
7181 {%
7182 % \end{macrocode}
7183 % Counter \cs{count0} will hold the result. So we will loop on \cs{count0}, starting from
7184 % \(\min\{u,w_{\mathrm{min}}\}\), where \(u\triangleq\cs{fc@unit@weight}\), and
7185 % \(w_{\mathrm{min}}\triangleq\cs{fc@min@weight}\). So first set \cs{count0} to
7186 % \(\min\{u,w_{\mathrm{min}}\}\):
7187 % \begin{macrocode}
7188 \count0=\fc@unit@weight\space
7189 \ifnum\count0<\fc@min@weight\space
7190 \count0=\fc@min@weight\space
7191 \fi
7192 % \end{macrocode}
7193 % Now the loop. This is done by defining macro \cs{@templ} for final recursion.
7194 % \begin{macrocode}
7195 \def\@templ{%
7196 \ifnum\csname fc@digit@\the\count0\endcsname=0 %
7197 \advance\count0 by 1 %
7198 \ifnum\count0>\fc@max@weight\space
7199 \let\next\relax
7200 \fi
7201 \else
7202 \let\next\relax
7203 \fi
7204 \next
7205 }%
7206 \let\next\@templ
7207 \@templ
7208 % \end{macrocode}
7209 % Now propagate result after closing bracket into counter \texttt{\#1}.
7210 % \begin{macrocode}
7211 \toks0{#1}%
7212 \edef\@tempa{\the\toks0=\the\count0}%
7213 \expandafter
7214 }\@tempa\space
7215 }
7216 % \end{macrocode}
7217 % \DescribeMacro{\fc@get@last@word} Getting last word. Arguments as follows:\newline\noindent
7218 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7219 % \#1&input: full sequence\\
7220 % \#2&output macro 1: all sequence without last word\\
7221 % \#3&output macro 2: last word\\
7222 % \end{tabularx}
7223 % \begin{macrocode}
7224 \ifcsundef{fc@get@last@word}{}{\PackageError{fcnumparser}{Duplicate definition}{Redefinition
7225 of macro `fc@get@last@word'}}%
7226 \def\fc@get@last@word#1#2#3{%
7227 {%
7228 % \end{macrocode}
7229 % First we split \texttt{\#1} into two parts: everything that is upto \cs{fc@wcase} exclusive goes to
7230 % \cs{toks0}, and evrything from \cs{fc@wcase} exclusive upto the final \cs{@nil} exclusive goes to \cs{toks1}.
7231 % \begin{macrocode}
7232 \def\@tempa##1\fc@wcase##2\@nil\fc@end{%
7233 \toks0{##1}%
7234 % \end{macrocode}
7235 % Actually a dummy \cs{fc@wcase} is appended to \cs{toks1}, because that makes easier further checking that it
7236 % does not contains any other \cs{fc@wcase}.
7237 % \begin{macrocode}
7238 \toks1{##2\fc@wcase}%
7239 }%
7240 \@tempa#1\fc@end
7241 % \end{macrocode}
7242 % Now leading part upto last word should be in \cs{toks0}, and last word should be in \cs{toks1}. However we
7243 % need to check that this is really the last word, i.e. we need to check that there is no \cs{fc@wcase} inside
7244 % \cs{toks1} other than the tailing dummy one. To that purpose we will loop while we find that \cs{toks1}
7245 % contains some \cs{fc@wcase}. First we define \cs{@tempa} to split \cs{the}\cs{toks1} between parts before and
7246 % after some potential \cs{fc@wcase}.
7247 % \begin{macrocode}
7248 \def\@tempa##1\fc@wcase##2\fc@end{%
7249 \toks2{##1}%
7250 \def\@tempb{##2}%
7251 \toks3{##2}%
7252 }%
7253 % \end{macrocode}
7254 % \cs{@tempt} is just an aliases of \cs{toks0} to make its handling easier later on.
7255 % \begin{macrocode}
7256 \toksdef\@tempt0 %
7257 % \end{macrocode}
7258 % Now the loop itself, this is done by terminal recursion with macro \cs{@templ}.
7259 % \begin{macrocode}
7260 \def\@templ{%
7261 \expandafter\@tempa\the\toks1 \fc@end
7262 \ifx\@tempb\@empty
7263 % \end{macrocode}
7264 % \cs{@tempb} empty means that the only \cs{fc@wcase} found in \cs{the}\cs{toks1} is the dummy one. So we end
7265 % the loop here, \cs{toks2} contains the last word.
7266 % \begin{macrocode}
7267 \let\next\relax
7268 \else
7269 % \end{macrocode}
7270 % \cs{@tempb} is not empty, first we use
7271 % \begin{macrocode}
7272 \expandafter\expandafter\expandafter\@tempt
7273 \expandafter\expandafter\expandafter{%
7274 \expandafter\the\expandafter\@tempt
7275 \expandafter\fc@wcase\the\toks2}%
7276 \toks1\toks3 %
7277 \fi
7278 \next
7279 }%
7280 \let\next\@templ
7281 \@templ
7282 \edef\@tempa{\def\noexpand#2{\the\toks0}\def\noexpand#3{\the\toks2}}%
7283 \expandafter
7284 }\@tempa
7285 }
7286 % \end{macrocode}
7287 % \DescribeMacro{\fc@get@last@word} Getting last letter. Arguments as follows:\newline\noindent
7288 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7289 % \#1&input: full word\\
7290 % \#2&output macro 1: all word without last letter\\
7291 % \#3&output macro 2: last letter\\
7292 % \end{tabularx}
7293 % \begin{macrocode}
7294 \ifcsundef{fc@get@last@letter}{}{\PackageError{fcnumparser}{Duplicate definition}{Redefinition
7295 of macro `fc@get@last@letter'}}%
7296 \def\fc@get@last@letter#1#2#3{%
7297 {%
7298 % \end{macrocode}
7299 % First copy input to local \cs{toks1}. What we are going to to is to bubble one by one letters from
7300 % \cs{toks1} which initial contains the whole word, into \cs{toks0}. At the end of the macro \cs{toks0} will
7301 % therefore contain the whole work but the last letter, and the last letter will be in \cs{toks1}.
7302 % \begin{macrocode}
7303 \toks1{#1}%
7304 \toks0{}%
7305 \toksdef\@tempt0 %
7306 % \end{macrocode}
7307 % We define \cs{@tempa} in order to pop the first letter from the remaining of word.
7308 % \begin{macrocode}
7309 \def\@tempa##1##2\fc@nil{%
7310 \toks2{##1}%
7311 \toks3{##2}%
7312 \def\@tempb{##2}%
7313 }%
7314 % \end{macrocode}
7315 % Now we define \cs{@templ} to do the loop by terminal recursion.
7316 % \begin{macrocode}
7317 \def\@templ{%
7318 \expandafter\@tempa\the\toks1 \fc@nil
7319 \ifx\@tempb\@empty
7320 % \end{macrocode}
7321 % Stop loop, as \cs{toks1} has been detected to be one single letter.
7322 % \begin{macrocode}
7323 \let\next\relax
7324 \else
7325 % \end{macrocode}
7326 % Here we append to \cs{toks0} the content of \cs{toks2}, i.e. the next letter.
7327 % \begin{macrocode}
7328 \expandafter\expandafter\expandafter\@tempt
7329 \expandafter\expandafter\expandafter{%
7330 \expandafter\the\expandafter\@tempt
7331 \the\toks2}%
7332 % \end{macrocode}
7333 % And the remaining letters go to \cs{toks1} for the next iteration.
7334 % \begin{macrocode}
7335 \toks1\toks3 %
7336 \fi
7337 \next
7338 }%
7339 % \end{macrocode}
7340 % Here run the loop.
7341 % \begin{macrocode}
7342 \let\next\@templ
7343 \next
7344 % \end{macrocode}
7345 % Now propagate the results into macros \texttt{\#2} and \texttt{\#3} after closing brace.
7346 % \begin{macrocode}
7347 \edef\@tempa{\def\noexpand#2{\the\toks0}\def\noexpand#3{\the\toks1}}%
7348 \expandafter
7349 }\@tempa
7350 }%
7351 % \end{macrocode}
7352 % \setcounter{CodelineNo}{0}
7353 %\iffalse
7354 % \begin{macrocode}
7355 %</fcnumparser.sty>
7356 % \end{macrocode}
7357 %\fi
7358 %\iffalse
7359 % \begin{macrocode}
7360 %<*fcprefix.sty>
7361 % \end{macrocode}
7362 %\fi
7363 %\subsection{fcprefix.sty}
7364 % Pseudo-latin prefixes.
7365 % \begin{macrocode}
7366 \NeedsTeXFormat{LaTeX2e}
7367 \ProvidesPackage{fcprefix}[2012/09/28]
7368 \RequirePackage{ifthen}
7369 \RequirePackage{keyval}
7370 \RequirePackage{fcnumparser}
7371 % \end{macrocode}
7372 % Option `\texttt{use duode and unde}' is to select whether \(18\) and suchlikes (\(\meta{x}8\),
7373 % \(\meta{x}9\)) writes like duodevicies, or like octodecies. For French it should be `\texttt{below
7374 % 20}'. Possible values are `\texttt{below 20}' and `\texttt{never}'.
7375 % \begin{macrocode}
7376 \define@key{fcprefix}{use duode and unde}[below20]{%
7377 \ifthenelse{\equal{#1}{below20}}{%
7378 \def\fc@duodeandunde{2}%
7379 }{%
7380 \ifthenelse{\equal{#1}{never}}{%
7381 \def\fc@duodeandunde{0}%
7382 }{%
7383 \PackageError{fcprefix}{Unexpected option}{%
7384 Option `use duode and unde' expects `below 20' or `never' }%
7385 }%
7386 }%
7387 }
7388 % \end{macrocode}
7389 % Default is `\texttt{below 20}' like in French.
7390 % \begin{macrocode}
7391 \def\fc@duodeandunde{2}
7392 % \end{macrocode}
7393 % Option `\texttt{numeral u in duo}', this can be `\texttt{true}' or `\texttt{false}' and is used to select
7394 % whether 12 and suchlikes write like dodec\meta{xxx} or duodec\meta{xxx} for numerals.
7395 % \begin{macrocode}
7396 \define@key{fcprefix}{numeral u in duo}[false]{%
7397 \ifthenelse{\equal{#1}{false}}{%
7398 \let\fc@u@in@duo\@empty
7399 }{%
7400 \ifthenelse{\equal{#1}{true}}{%
7401 \def\fc@u@in@duo{u}%
7402 }{%
7403 \PackageError{fcprefix}{Unexpected option}{%
7404 Option `numeral u in duo' expects `true' or `false' }%
7405 }%
7406 }%
7407 }
7408 % \end{macrocode}
7409 % Option `\texttt{e accute}', this can be `\texttt{true}' or `\texttt{false}' and is used to select whether
7410 % letter `\texttt{e}' has an accute accent when it pronounce [e] in French.
7411 % \begin{macrocode}
7412 \define@key{fcprefix}{e accute}[false]{%
7413 \ifthenelse{\equal{#1}{false}}{%
7414 \let\fc@prefix@eaccute\@firstofone
7415 }{%
7416 \ifthenelse{\equal{#1}{true}}{%
7417 \let\fc@prefix@eaccute\'%
7418 }{%
7419 \PackageError{fcprefix}{Unexpected option}{%
7420 Option `e accute' expects `true' or `false' }%
7421 }%
7422 }%
7423 }
7424 % \end{macrocode}
7425 % Default is to set accute accent like in French.
7426 % \begin{macrocode}
7427 \let\fc@prefix@eaccute\'%
7428 % \end{macrocode}
7429 % Option `\texttt{power of millia}' tells how millia is raise to power n. It expects value:\newline\noindent
7430 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7431 % recursive&for which millia squared is noted as `milliamillia'\\
7432 % arabic&for which millia squared is noted as `millia\^{}2'\\
7433 % prefix&for which millia squared is noted as `bismillia'
7434 % \end{tabularx}
7435 % \begin{macrocode}
7436 \define@key{fcprefix}{power of millia}[prefix]{%
7437 \ifthenelse{\equal{#1}{prefix}}{%
7438 \let\fc@power@of@millia@init\@gobbletwo
7439 \let\fc@power@of@millia\fc@@prefix@millia
7440 }{%
7441 \ifthenelse{\equal{#1}{arabic}}{%
7442 \let\fc@power@of@millia@init\@gobbletwo
7443 \let\fc@power@of@millia\fc@@arabic@millia
7444 }{%
7445 \ifthenelse{\equal{#1}{recursive}}{%
7446 \let\fc@power@of@millia@init\fc@@recurse@millia@init
7447 \let\fc@power@of@millia\fc@@recurse@millia
7448 }{%
7449 \PackageError{fcprefix}{Unexpected option}{%
7450 Option `power of millia' expects `recursive', `arabic', or `prefix' }%
7451 }%
7452 }%
7453 }%
7454 }
7455 % \end{macrocode}
7456 % Arguments as follows:\def\interface{\newline\noindent
7457 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7458 % \#1& output macro\\
7459 % \#2& number with current weight \(w\)
7460 % \end{tabularx}}\interface
7461 % \begin{macrocode}
7462 \def\fc@@recurse@millia#1#2{%
7463 \let\@tempp#1%
7464 \edef#1{millia\@tempp}%
7465 }
7466 % \end{macrocode}
7467 % Arguments as follows --- same interface as \cs{fc@@recurse@millia}: \interface
7468 % \begin{macrocode}
7469 \def\fc@@recurse@millia@init#1#2{%
7470 {%
7471 % \end{macrocode}
7472 % Save input argument current weight \(w\) into local macro \cs{@tempb}.
7473 % \begin{macrocode}
7474 \edef\@tempb{\number#2}%
7475 % \end{macrocode}
7476 % Now main loop from 0 to \(w\). Final value of \cs{@tempa} will be the result.
7477 % \begin{macrocode}
7478 \count0=0 %
7479 \let\@tempa\@empty
7480 \loop
7481 \ifnum\count0<\@tempb
7482 \advance\count0 by 1 %
7483 \expandafter\def
7484 \expandafter\@tempa\expandafter{\@tempa millia}%
7485 \repeat
7486 % \end{macrocode}
7487 % Now propagate the expansion of \cs{@tempa} into \texttt{\#1} after closing bace.
7488 % \begin{macrocode}
7489 \edef\@tempb{\def\noexpand#1{\@tempa}}%
7490 \expandafter
7491 }\@tempb
7492 }
7493 % \end{macrocode}
7494 % Arguments as follows --- same interface as \cs{fc@@recurse@millia}: \interface
7495 % \begin{macrocode}
7496 \def\fc@@arabic@millia#1#2{%
7497 \ifnnum#2=0 %
7498 \let#1\@empty
7499 \else
7500 \edef#1{millia\^{}\the#2}%
7501 \fi
7502 }
7503 % \end{macrocode}
7504 % Arguments as follows --- same interface as \cs{fc@@recurse@millia}: \interface
7505 % \begin{macrocode}
7506 \def\fc@@prefix@millia#1#2{%
7507 \fc@@latin@numeral@pefix{#2}{#1}%
7508 }
7509 % \end{macrocode}
7510 % Default value of option `\texttt{power of millia}' is `\texttt{prefix}':
7511 % \begin{macrocode}
7512 \let\fc@power@of@millia@init\@gobbletwo
7513 \let\fc@power@of@millia\fc@@prefix@millia
7514 % \end{macrocode}
7515 % \DescribeMacro{\fc@@latin@cardinal@pefix} Compute a cardinal prefix for n-illion, like \(1 \Rightarrow
7516 % \textrm{`m'}\), \(2 \Rightarrow \textrm{`bi'}\), \(3 \Rightarrow \textrm{`tri'}\). The algorithm to derive
7517 % this prefix is that of Russ Rowlett I founds its documentation on Alain Lassine's site:
7518 % \url{http://www.alain.be/Boece/grands\_nombres.html}. First check that macro is not yet defined.
7519 % \begin{macrocode}
7520 \ifcsundef{fc@@latin@cardinal@pefix}{}{%
7521 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro `fc@@latin@cardinal@pefix'}}
7522 % \end{macrocode}
7523 % Arguments as follows:\newline\noindent
7524 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7525 % \#1&input number to be formated\\
7526 % \#2&outut macro name into which to place the formatted result
7527 % \end{tabularx}
7528 % \begin{macrocode}
7529 \def\fc@@latin@cardinal@pefix#1#2{%
7530 {%
7531 % \end{macrocode}
7532 % First we put input argument into local macro @cs{@tempa} with full expansion.
7533 % \begin{macrocode}
7534 \edef\@tempa{\number#1}%
7535 % \end{macrocode}
7536 % Now parse number from expanded input.
7537 % \begin{macrocode}
7538 \expandafter\fc@number@parser\expandafter{\@tempa}%
7539 \count2=0 %
7540 % \end{macrocode}
7541 % \cs{@tempt} will hold the optional final \texttt{t}, \cs{@tempu} is used to initialize \cs{@tempt} to `t'
7542 % when the firt non-zero 3digit group is met, which is the job made by \cs{@tempi}.
7543 % \begin{macrocode}
7544 \let\@tempt\@empty
7545 \def\@tempu{t}%
7546 % \end{macrocode}
7547 % \cs{@tempm} will hold the \texttt{millia\^}\(^{n\div 3}\)
7548 % \begin{macrocode}
7549 \let\@tempm\@empty
7550 % \end{macrocode}
7551 % Loop by means of terminal recursion of herinafter defined macro \cs{@templ}. We loop by group of 3 digits.
7552 % \begin{macrocode}
7553 \def\@templ{%
7554 \ifnum\count2>\fc@max@weight
7555 \let\next\relax
7556 \else
7557 % \end{macrocode}
7558 % Loop body. Here we read a group of 3 consecutive digits \(d_2d_1d_0\) and place them respectively into
7559 % \cs{count3}, \cs{count4}, and \cs{count5}.
7560 % \begin{macrocode}
7561 \fc@read@unit{\count3}{\count2}%
7562 \advance\count2 by 1 %
7563 \fc@read@unit{\count4}{\count2}%
7564 \advance\count2 by 1 %
7565 \fc@read@unit{\count5}{\count2}%
7566 \advance\count2 by 1 %
7567 % \end{macrocode}
7568 % If the 3 considered digits \(d_2d_1d_0\) are not all zero, then set \cs{@tempt} to `\texttt{t}' for the
7569 % first time this event is met.
7570 % \begin{macrocode}
7571 \edef\@tempn{%
7572 \ifnum\count3=0\else 1\fi
7573 \ifnum\count4=0\else 1\fi
7574 \ifnum\count5=0\else 1\fi
7575 }%
7576 \ifx\@tempn\@empty\else
7577 \let\@tempt\@tempu
7578 \let\@tempu\@empty
7579 \fi
7580 % \end{macrocode}
7581 % Now process the current group \(d_2d_1d_0\) of 3 digits.
7582 % \begin{macrocode}
7583 \let\@tempp\@tempa
7584 \edef\@tempa{%
7585 % \end{macrocode}
7586 % Here we process \(d_{2}\) held by \cs{count5}, that is to say hundreds.
7587 % \begin{macrocode}
7588 \ifcase\count5 %
7589 \or cen%
7590 \or ducen%
7591 \or trecen%
7592 \or quadringen%
7593 \or quingen%
7594 \or sescen%
7595 \or septigen%
7596 \or octingen%
7597 \or nongen%
7598 \fi
7599 % \end{macrocode}
7600 % Here we process \(d_1d_0\) held by \cs{count4} \& \cs{count3}, that is to say tens and units.
7601 % \begin{macrocode}
7602 \ifnum\count4=0 %
7603 % x0(0..9)
7604 \ifnum\count2=3 %
7605 % Absolute weight zero
7606 \ifcase\count3 \@tempt
7607 \or m%
7608 \or b%
7609 \or tr%
7610 \or quadr%
7611 \or quin\@tempt
7612 \or sex\@tempt
7613 \or sep\@tempt
7614 \or oc\@tempt
7615 \or non%
7616 \fi
7617 \else
7618 % \end{macrocode}
7619 % Here the weight of \cs{count3} is \(3\times n\), with \(n>0\), i.e. this is followed by a
7620 % \texttt{millia\^}\(n\).
7621 % \begin{macrocode}
7622 \ifcase\count3 %
7623 \or \ifnum\count2>\fc@max@weight\else un\fi
7624 \or d\fc@u@in@duo o%
7625 \or tre%
7626 \or quattuor%
7627 \or quin%
7628 \or sex%
7629 \or septen%
7630 \or octo%
7631 \or novem%
7632 \fi
7633 \fi
7634 \else
7635 % x(10..99)
7636 \ifcase\count3 %
7637 \or un%
7638 \or d\fc@u@in@duo o%
7639 \or tre%
7640 \or quattuor%
7641 \or quin%
7642 \or sex%
7643 \or septen%
7644 \or octo%
7645 \or novem%
7646 \fi
7647 \ifcase\count4 %
7648 \or dec%
7649 \or vigin\@tempt
7650 \or trigin\@tempt
7651 \or quadragin\@tempt
7652 \or quinquagin\@tempt
7653 \or sexagin\@tempt
7654 \or septuagin\@tempt
7655 \or octogin\@tempt
7656 \or nonagin\@tempt
7657 \fi
7658 \fi
7659 % \end{macrocode}
7660 % Insert the \texttt{millia\^}\(^{(n\div 3)}\) only if \(d_2d_1d_0\not=0\), i.e. if one of \cs{count3}
7661 % \cs{count4} or \cs{count5} is non zero.
7662 % \begin{macrocode}
7663 \@tempm
7664 % \end{macrocode}
7665 % And append previous version of \cs{@tempa}.
7666 % \begin{macrocode}
7667 \@tempp
7668 }%
7669 % \end{macrocode}
7670 % ``Concatenate'' \texttt{millia} to \cs{@tempm}, so that \cs{@tempm} will expand to
7671 % \texttt{millia\^}\(^{(n\div 3)+1}\) at the next iteration. Actually whether this is a concatenation or some
7672 % \texttt{millia} prefixing depends of option `\texttt{power of millia}'.
7673 % \begin{macrocode}
7674 \fc@power@of@millia\@tempm{\count2}%
7675 \fi
7676 \next
7677 }%
7678 \let\@tempa\@empty
7679 \let\next\@templ
7680 \@templ
7681 % \end{macrocode}
7682 % Propagate expansion of \cs{@tempa} into \texttt{\#2} after closing bracket.
7683 % \begin{macrocode}
7684 \def\@tempb##1{\def\@tempa{\def#2{##1}}}%
7685 \expandafter\@tempb\expandafter{\@tempa}%
7686 \expandafter
7687 }\@tempa
7688 }
7689 % \end{macrocode}
7690 % \DescribeMacro{\fc@@latin@numeral@pefix} Compute a numeral prefix
7691 % like `s\'emel', `bis', `ter', `quater',
7692 % etc\ldots I found the algorithm to derive this prefix on Alain Lassine's site:
7693 % \url{http://www.alain.be/Boece/nombres\_gargantuesques.html}. First check that the macro is not yet defined.
7694 % \begin{macrocode}
7695 \ifcsundef{fc@@latin@numeral@pefix}{}{%
7696 \PackageError{fmtcount}{Duplicate definition}{Redefinition of macro
7697 `fc@@latin@numeral@pefix'}}
7698 % \end{macrocode}
7699 % Arguments as follows:\newline\noindent
7700 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7701 % \#1& input number to be formatted,\\
7702 % \#2& outut macro name into which to place the result
7703 % \end{tabularx}
7704 % \begin{macrocode}
7705 \def\fc@@latin@numeral@pefix#1#2{%
7706 {%
7707 \edef\@tempa{\number#1}%
7708 \def\fc@unit@weight{0}%
7709 \expandafter\fc@number@parser\expandafter{\@tempa}%
7710 \count2=0 %
7711 % \end{macrocode}
7712 % Macro \cs{@tempm} will hold the \texttt{millies\^}\(^{n\div 3}\).
7713 % \begin{macrocode}
7714 \let\@tempm\@empty
7715 % \end{macrocode}
7716 % Loop over digits. This is done by defining macro \cs{@templ} for terminal recursion.
7717 % \begin{macrocode}
7718 \def\@templ{%
7719 \ifnum\count2>\fc@max@weight
7720 \let\next\relax
7721 \else
7722 % \end{macrocode}
7723 % Loop body. Three consecutive digits \(d_{2}d_{1}d_{0}\) are read into counters \cs{count3}, \cs{count4}, and
7724 % \cs{count5}.
7725 % \begin{macrocode}
7726 \fc@read@unit{\count3}{\count2}%
7727 \advance\count2 by 1 %
7728 \fc@read@unit{\count4}{\count2}%
7729 \advance\count2 by 1 %
7730 \fc@read@unit{\count5}{\count2}%
7731 \advance\count2 by 1 %
7732 % \end{macrocode}
7733 % Check the use of \texttt{duodevicies} instead of \texttt{octodecies}.
7734 % \begin{macrocode}
7735 \let\@tempn\@secondoftwo
7736 \ifnum\count3>7 %
7737 \ifnum\count4<\fc@duodeandunde
7738 \ifnum\count4>0 %
7739 \let\@tempn\@firstoftwo
7740 \fi
7741 \fi
7742 \fi
7743 \@tempn
7744 {% use duodevicies for eighteen
7745 \advance\count4 by 1 %
7746 \let\@temps\@secondoftwo
7747 }{% do not use duodevicies for eighteen
7748 \let\@temps\@firstoftwo
7749 }%
7750 \let\@tempp\@tempa
7751 \edef\@tempa{%
7752 % hundreds
7753 \ifcase\count5 %
7754 \expandafter\@gobble
7755 \or c%
7756 \or duc%
7757 \or trec%
7758 \or quadring%
7759 \or quing%
7760 \or sesc%
7761 \or septing%
7762 \or octing%
7763 \or nong%
7764 \fi
7765 {enties}%
7766 \ifnum\count4=0 %
7767 % \end{macrocode}
7768 % Here \(d_{2}d_{1}d_{0}\) is such that \(d_{1} = 0\).
7769 % \begin{macrocode}
7770 \ifcase\count3 %
7771 \or
7772 \ifnum\count2=3 %
7773 s\fc@prefix@eaccute emel%
7774 \else
7775 \ifnum\count2>\fc@max@weight\else un\fi
7776 \fi
7777 \or bis%
7778 \or ter%
7779 \or quater%
7780 \or quinquies%
7781 \or sexies%
7782 \or septies%
7783 \or octies%
7784 \or novies%
7785 \fi
7786 \else
7787 % \end{macrocode}
7788 % Here \(d_{2}d_{1}d_{0}\) is such that \(d_{1} \geq 1\).
7789 % \begin{macrocode}
7790 \ifcase\count3 %
7791 \or un%
7792 \or d\fc@u@in@duo o%
7793 \or ter%
7794 \or quater%
7795 \or quin%
7796 \or sex%
7797 \or septen%
7798 \or \@temps{octo}{duod\fc@prefix@eaccute e}% x8 = two before next (x+1)0
7799 \or \@temps{novem}{und\fc@prefix@eaccute e}% x9 = one before next (x+1)0
7800 \fi
7801 \ifcase\count4 %
7802 % can't get here
7803 \or d\fc@prefix@eaccute ec%
7804 \or vic%
7805 \or tric%
7806 \or quadrag%
7807 \or quinquag%
7808 \or sexag%
7809 \or septuag%
7810 \or octog%
7811 \or nonag%
7812 \fi
7813 ies%
7814 \fi
7815 % Insert the millies^(n/3) only if one of \count3 \count4 \count5 is non zero
7816 \@tempm
7817 % add up previous version of \@tempa
7818 \@tempp
7819 }%
7820 % \end{macrocode}
7821 % Concatenate \texttt{millies} to \cs{@tempm} so that it is equal to \texttt{millies\^}\(^{n\div 3}\) at the
7822 % next iteration. Here we just have plain concatenation, contrary to cardinal for which a prefix can be used
7823 % instead.
7824 % \begin{macrocode}
7825 \let\@tempp\@tempp
7826 \edef\@tempm{millies\@tempp}%
7827 \fi
7828 \next
7829 }%
7830 \let\@tempa\@empty
7831 \let\next\@templ
7832 \@templ
7833 % \end{macrocode}
7834 % Now propagate expansion of \@tempa into \texttt{\#2} after closing bracket.
7835 % \begin{macrocode}
7836 \def\@tempb##1{\def\@tempa{\def#2{##1}}}%
7837 \expandafter\@tempb\expandafter{\@tempa}%
7838 \expandafter
7839 }\@tempa
7840 }
7841 % \end{macrocode}
7842 % Stuff for calling macros. Construct \cs{fc@call}\meta{some macro} can be used to pass two arguments to
7843 % \meta{some macro} with a configurable calling convention:
7844 % \begin{itemize}
7845 % \item the calling convention is such that there is one mandatory argument \meta{marg} and an optional
7846 % argument \meta{oarg}
7847 % \item either \cs{fc@call} is \cs{let} to be equal to \cs{fc@call@opt@arg@second}, and then calling
7848 % convention is that the \meta{marg} is first and \meta{oarg} is second,
7849 % \item or \cs{fc@call} is \cs{let} to be equal to \cs{fc@call@opt@arg@first}, and then calling convention is
7850 % that the \meta{oarg} is first and \meta{aarg} is second,
7851 % \item if \meta{oarg} is absent, then it is by convention set empty,
7852 % \item \meta{some macro} is supposed to have two mandatory arguments of which \meta{oarg} is passed to the
7853 % first, and \meta{marg} is passed to the second, and
7854 % \item \meta{some macro} is called within a group.
7855 % \end{itemize}
7856 % \begin{macrocode}
7857 \def\fc@call@opt@arg@second#1#2{%
7858 \def\@tempb{%
7859 \ifx[\@tempa
7860 \def\@tempc[####1]{%
7861 {#1{####1}{#2}}%
7862 }%
7863 \else
7864 \def\@tempc{{#1{}{#2}}}%
7865 \fi
7866 \@tempc
7867 }%
7868 \futurelet\@tempa
7869 \@tempb
7870 }
7871 % \end{macrocode}
7872 % \begin{macrocode}
7873 \def\fc@call@opt@arg@first#1{%
7874 \def\@tempb{%
7875 \ifx[\@tempa
7876 \def\@tempc[####1]####2{{#1{####1}{####2}}}%
7877 \else
7878 \def\@tempc####1{{#1{}{####1}}}%
7879 \fi
7880 \@tempc
7881 }%
7882 \futurelet\@tempa
7883 \@tempb
7884 }
7885
7886 \let\fc@call\fc@call@opt@arg@first
7887 % \end{macrocode}
7888 % User API.
7889 %
7890 % \DescribeMacro{\@latinnumeralstringnum} Macro \cs{@latinnumeralstringnum}. Arguments as
7891 % follows:\newline\noindent
7892 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7893 % \#1&local options\\
7894 % \#2& input number
7895 % \end{tabularx}
7896 % \begin{macrocode}
7897 \newcommand*{\@latinnumeralstringnum}[2]{%
7898 \setkeys{fcprefix}{#1}%
7899 \fc@@latin@numeral@pefix{#2}\@tempa
7900 \@tempa
7901 }
7902 % \end{macrocode}
7903 % Arguments as follows:\newline\noindent
7904 % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}}
7905 % \#1&local options\\
7906 % \#2&input counter
7907 % \end{tabularx}
7908 % \begin{macrocode}
7909 \newcommand*{\@latinnumeralstring}[2]{%
7910 \setkeys{fcprefix}{#1}%
7911 \expandafter\let\expandafter
7912 \@tempa\expandafter\csname c@#2\endcsname
7913 \expandafter\fc@@latin@numeral@pefix\expandafter{\the\@tempa}\@tempa
7914 \@tempa
7915 }
7916 % \end{macrocode}
7917 % \begin{macrocode}
7918 \newcommand*{\latinnumeralstring}{%
7919 \fc@call\@latinnumeralstring
7920 }
7921 % \end{macrocode}
7922 % \begin{macrocode}
7923 \newcommand*{\latinnumeralstringnum}{%
7924 \fc@call\@latinnumeralstringnum
7925 }
7926 % \end{macrocode}
7927 % \setcounter{CodelineNo}{0}
7928 %\iffalse
7929 % \begin{macrocode}
7930 %</fcprefix.sty>
7931 % \end{macrocode}
7932 %\fi
7933 %\iffalse
7934 % \begin{macrocode}
7935 %<*fmtcount.sty>
7936 % \end{macrocode}
7937 %\fi
7938
7939 %\subsection{fmtcount.sty}
7940 % This section deals with the code for \verb|fmtcount.sty|.
7941 % \begin{macrocode}
7942 \NeedsTeXFormat{LaTeX2e}
7943 \ProvidesPackage{fmtcount}[2025/12/02 v3.12 Displaying the values of LaTeX counters (NT,VB,NE)]
7944 \RequirePackage{ifthen}
7945 % \end{macrocode}
7946 % \changes{3.01}{2014/12/03}{Use \styfmt{xkeyval} instead of \styfmt{keyval}, so that we do not get in trouble
7947 % with bracket spurious removals}
7948 % \begin{macrocode}
7949 \RequirePackage{xkeyval}
7950 \RequirePackage{etoolbox}
7951 \RequirePackage{fcprefix}
7952 % \end{macrocode}
7953 % \changes{3.00}{2014/07/3}{Add \cs{RequirePackage} for \texttt{ifxetex}}
7954 % \changes{3.05}{2017/12/24}{Stop using \cs{ifxetex} to trigger multilingual mode. Instead only packages are
7955 % tested for being loaded.}
7956 % \changes{1.3}{2007/7/19}{no longer using xspace package}
7957 %\changes{1.31}{2009/10/02}{amsgen now loaded (\cs{new@ifnextchar}
7958 % needed)}
7959 % Need to use \cs{new@ifnextchar} instead of \cs{@ifnextchar} in
7960 % commands that have a final optional argument (such as \cs{gls})
7961 % so require \sty{amsgen}.
7962 % \begin{macrocode}
7963 \RequirePackage{amsgen}
7964 % \end{macrocode}
7965 % These commands need to be defined before the
7966 % configuration file is loaded.
7967 %
7968 % Define the macro to format the \verb|st|, \verb|nd|, \verb|rd| or \verb|th| of an
7969 % ordinal.
7970 % \changes{3.01}{2014/12/3}{Make \cs{fmtord} language dependent.}
7971 % \changes{3.01}{2014/12/3}{Substitute \cs{textsuperscript} for \cs{fc@textsuperscript}, and define
7972 % \cs{fc@textsuperscript} as \cs{fup} when defined at beginning of document, or as \cs{textsuperscript}
7973 % otherwise}
7974 %\begin{macro}{\fc@orddef@ult}
7975 % \begin{macrocode}
7976 \providecommand*{\fc@orddef@ult}[1]{\fc@textsuperscript{#1}}
7977 % \end{macrocode}
7978 %\end{macro}
7979 %\begin{macro}{\fc@ord@multiling}
7980 % \begin{macrocode}
7981 \providecommand*{\fc@ord@multiling}[1]{%
7982 \ifcsundef{fc@\languagename @alias@of}{%
7983 % \end{macrocode}
7984 % Not a supported language, just use the default setting:
7985 % \begin{macrocode}
7986 \fc@orddef@ult{#1}}{%
7987 \expandafter\let\expandafter\@tempa\csname fc@\languagename @alias@of\endcsname
7988 \ifcsundef{fc@ord@\@tempa}{%
7989 % \end{macrocode}
7990 % Not language specfic setting, just use the default setting:
7991 % \begin{macrocode}
7992 \fc@orddef@ult{#1}}{%
7993 % \end{macrocode}
7994 % Language with specific setting, use that setting:
7995 % \begin{macrocode}
7996 \csname fc@ord@\@tempa\endcsname{#1}}}}
7997 % \end{macrocode}
7998 %\end{macro}
7999 %\begin{macro}{\padzeroes}
8000 %\begin{definition}
8001 %\cs{padzeroes}\oarg{n}
8002 %\end{definition}
8003 % Specifies how many digits should be displayed for commands such as
8004 % \cs{decimal} and \cs{binary}.
8005 % \begin{macrocode}
8006 \newcount\c@padzeroesN
8007 \c@padzeroesN=1\relax
8008 \providecommand*{\padzeroes}[1][17]{\c@padzeroesN=#1}
8009 % \end{macrocode}
8010 %\end{macro}
8011 %
8012 %\begin{macro}{\FCloadlang}
8013 %\changes{2.0}{2012/06/3}{new}
8014 %\changes{2.02}{2012/10/3}{ensured catcode for @ set to `letter'
8015 %before loading file}
8016 %\begin{definition}
8017 %\cs{FCloadlang}\marg{language}
8018 %\end{definition}
8019 % Load \styfmt{fmtcount} language file,
8020 % \texttt{fc-}\meta{language}\texttt{.def}, unless already loaded.
8021 % Unfortunately neither \styfmt{babel} nor \styfmt{polyglossia} keep a list of loaded
8022 % dialects, so we can't load all the necessary def files in the
8023 % preamble as we don't know which dialects the user requires.
8024 % Therefore the dialect definitions get loaded when a command such
8025 % as \cs{ordinalnum} is used, if they
8026 % haven't already been loaded.
8027 % \begin{macrocode}
8028 \newcount\fc@tmpcatcode
8029 \def\fc@languages{}%
8030 \def\fc@mainlang{}%
8031 \newcommand*{\FCloadlang}[1]{%
8032 \@FC@iflangloaded{#1}{}%
8033 {%
8034 \fc@tmpcatcode=\catcode`\@\relax
8035 \catcode `\@ 11\relax
8036 \InputIfFileExists{fc-#1.def}%
8037 {%
8038 \ifdefempty{\fc@languages}%
8039 {%
8040 \gdef\fc@languages{#1}%
8041 }%
8042 {%
8043 \gappto\fc@languages{,#1}%
8044 }%
8045 \gdef\fc@mainlang{#1}%
8046 }%
8047 {}%
8048 \catcode `\@ \fc@tmpcatcode\relax
8049 }%
8050 }
8051 % \end{macrocode}
8052 %\end{macro}
8053 %\begin{macro}{\@FC@iflangloaded}
8054 %\changes{2.0}{2012/06/3}{new}
8055 %\begin{definition}
8056 %\cs{@FC@iflangloaded}\marg{language}\marg{true}\marg{false}
8057 %\end{definition}
8058 %If fmtcount language definition file \texttt{fc-}\meta{language}\texttt{.def} has
8059 %been loaded, do \meta{true} otherwise do \meta{false}
8060 % \begin{macrocode}
8061 \newcommand{\@FC@iflangloaded}[3]{%
8062 \ifcsundef{ver@fc-#1.def}{#3}{#2}%
8063 }
8064 % \end{macrocode}
8065 %\end{macro}
8066 %\begin{macro}{\ProvidesFCLanguage}
8067 %\changes{2.0}{2012/06/3}{new}
8068 % Declare fmtcount language definition file. Adapted from
8069 % \ics{ProvidesFile}.
8070 % \begin{macrocode}
8071 \newcommand*{\ProvidesFCLanguage}[1]{%
8072 \ProvidesFile{fc-#1.def}%
8073 }
8074 % \end{macrocode}
8075 %\end{macro}
8076 %
8077 % We need that flag to remember that a language has been loaded via package option, so that in the end we can
8078 % set \styfmt{fmtcount} in multiling
8079 % \begin{macrocode}
8080 \newif\iffmtcount@language@option
8081 \fmtcount@language@optionfalse
8082 % \end{macrocode}
8083 %\begin{macro}{\fc@supported@language@list}
8084 % Declare list of supported languages, as a comma separated list. No space, no empty items. Each item is a
8085 % language for which fmtcount is able to load language specific definitions. \texttt{Aliases but be
8086 % \textit{after} their meaning, for instance `american' being an alias of `USenglish', it has to appear
8087 % after it in the list}. The raison d'\^etre of this list is to commonalize iteration on languages for the
8088 % two following purposes:
8089 % \begin{itemize}
8090 % \item loading language definition as a result of the language being used by
8091 % \styfmt{babel}/\styfmt{polyglossia}
8092 % \item loading language definition as a result of package option
8093 % \end{itemize}
8094 % These two purposes cannot be handled in the same pass, we need two different passes otherwise there would
8095 % be some corner cases when a package would be required --- as a result of loading language definition for
8096 % one language --- between a \cs{DeclareOption} and a \cs{ProcessOption} which is forbidden by \LaTeXe.
8097 %\changes{3.00}{2014/07/3}{new}
8098 %\changes{3.05}{2017/12/26}{Add brazilian and portuguese.}
8099 % \begin{macrocode}
8100 \newcommand*\fc@supported@language@list{%
8101 english,%
8102 UKenglish,%
8103 brazilian,%
8104 british,%
8105 USenglish,%
8106 american,%
8107 spanish,%
8108 portuges,%
8109 portuguese,%
8110 french,%
8111 frenchb,%
8112 francais,%
8113 german,%
8114 germanb,%
8115 ngerman,%
8116 ngermanb,%
8117 italian,%
8118 dutch}
8119 % \end{macrocode}
8120 %\end{macro}
8121 %\begin{macro}{\fc@iterate@on@languages}
8122 %\begin{definition}
8123 %\cs{fc@iterate@on@languages}\marg{body}
8124 %\end{definition}
8125 % Now make some language iterator, note that for the following to work properly
8126 % \cs{fc@supported@language@list} must not be empty. \meta{body} is a macro that takes one argument, and
8127 % \cs{fc@iterate@on@languages} applies it iteratively :
8128 %\changes{3.00}{2014/07/03}{new}
8129 % \begin{macrocode}
8130 \newcommand*\fc@iterate@on@languages[1]{%
8131 \ifx\fc@supported@language@list\@empty
8132 % \end{macrocode}
8133 % That case should never happen !
8134 % \begin{macrocode}
8135 \PackageError{fmtcount}{Macro `\protect\@fc@iterate@on@languages' is empty}{You should never get here:
8136 Something is broken within \texttt{fmtcount}, please report the issue on
8137 \texttt{https://github.com/search?q=fmtcount\&ref=cmdform\&type=Issues}}%
8138 \else
8139 \let\fc@iterate@on@languages@body#1
8140 \expandafter\@fc@iterate@on@languages\fc@supported@language@list,\@nil,%
8141 \fi
8142 }
8143 \def\@fc@iterate@on@languages#1,{%
8144 {%
8145 \def\@tempa{#1}%
8146 \ifx\@tempa\@nnil
8147 \let\@tempa\@empty
8148 \else
8149 \def\@tempa{%
8150 \fc@iterate@on@languages@body{#1}%
8151 \@fc@iterate@on@languages
8152 }%
8153 \fi
8154 \expandafter
8155 }\@tempa
8156 }%
8157 % \end{macrocode}
8158 %\end{macro}
8159 %\begin{macro}{\@fc@loadifbabelorpolyglossialdf}
8160 %\begin{definition}
8161 %\cs{@fc@loadifbabelorpolyglossialdf}\marg{language}
8162 %\end{definition}
8163 %Loads fmtcount language file,
8164 %\texttt{fc-}\meta{language}\texttt{.def},
8165 % if one of the following condition is met:
8166 % \begin{itemize}
8167 % \item \styfmt{babel} language definition file \meta{language}\texttt{.ldf} has been loaded --- conditionally
8168 % to compilation with \texttt{latex}, not \texttt{xelatex}.
8169 % \item \styfmt{polyglossia} language definition file \texttt{gloss-}\meta{language}\texttt{.ldf} has been
8170 % loaded --- conditionally to compilation with \texttt{xelatex}, not \texttt{latex}.
8171 % \item \meta{language} option has been passed to package \styfmt{fmtcount}.
8172 % \end{itemize}
8173 %
8174 %\changes{2.03}{2012/11/03}{renamed \cs{@fc@loadifbabelldf} to
8175 % \cs{@fc@loadifbabelorpolyglossialdf}}
8176 %\changes{2.03}{2012/11/03}{added check for polyglossia language.}
8177 %\changes{3.00}{2014/07/03}{use \cs{ifxetex} to discriminate between \styfmt{babel} and \styfmt{polyglossia}.}
8178 %\changes{3.05}{2017/12/24}{Stop using \cs{ifxetex} to discriminate between \styfmt{babel} and
8179 % \styfmt{polyglossia}, instead just test which package is loaded.}
8180 % \begin{macrocode}
8181 \newcommand*\@fc@loadifbabelldf[1]{\ifcsundef{ver@#1.ldf}{}{\FCloadlang{#1}}}
8182 \newcommand*{\@fc@loadifbabelorpolyglossialdf}[1]{}
8183 \@ifpackageloaded{polyglossia}{%
8184 \def\@fc@loadifbabelorpolyglossialdf#1{\IfFileExists{gloss-#1.ldf}{\iflanguageloaded{#1}{\FCloadlang{#1}}{}}{}%
8185 \@fc@loadifbabelldf{#1}%
8186 }%
8187 }{\@ifpackageloaded{babel}{%
8188 \let\@fc@loadifbabelorpolyglossialdf\@fc@loadifbabelldf
8189 }{}}
8190 % \end{macrocode}
8191 %\end{macro}
8192 %
8193 % Load appropriate language definition files:
8194 %\changes{1.1}{2007/06/14}{added check for UKenglish,
8195 % british and USenglish babel settings}
8196 %\changes{2.0}{2012/06/03}{changed check for \cs{l@}\meta{language}
8197 % to check for \cs{date}\meta{language}}
8198 %\changes{3.00}{2014/07/03}{use iterator rather than doing it flat on each language}
8199 %\changes{3.01}{2014/12/03}{Define language aliases to \cs{fmtord}
8200 % option dependent on ``true'' language .}
8201 % \begin{macrocode}
8202 \fc@iterate@on@languages\@fc@loadifbabelorpolyglossialdf
8203 % \end{macrocode}
8204 % By default all languages are unique --- i.e. aliases not yet defined.
8205 % \begin{macrocode}
8206 \def\fc@iterate@on@languages@body#1{%
8207 \expandafter\def\csname fc@#1@alias@of\endcsname{#1}}
8208 \expandafter\@fc@iterate@on@languages\fc@supported@language@list,\@nil,%
8209 % \end{macrocode}
8210 % Now define those languages that are aliases of another
8211 % language. This is done with: \cs{@tempa}\marg{alias}\marg{language}
8212 % \begin{macrocode}
8213 \def\@tempa#1#2{%
8214 \expandafter\def\csname fc@#1@alias@of\endcsname{#2}%
8215 }%
8216 \@tempa{frenchb}{french}
8217 \@tempa{francais}{french}
8218 \@tempa{germanb}{german}
8219 \@tempa{ngermanb}{german}
8220 \@tempa{ngerman}{german}
8221 \@tempa{british}{english}
8222 \@tempa{american}{USenglish}
8223 % \end{macrocode}
8224 % Now, thanks to the aliases, we are going to define one option for each language, so that each language can
8225 % have its own settings.
8226 % \begin{macrocode}
8227 \def\fc@iterate@on@languages@body#1{%
8228 \define@key{fmtcount}{#1}[]{%
8229 \@FC@iflangloaded{#1}%
8230 {%
8231 \setkeys{fc\csname fc@#1@alias@of\endcsname}{##1}%
8232 }{%
8233 \PackageError{fmtcount}%
8234 {Language `#1' not defined}%
8235 {You need to load \ifxetex polyglossia\else babel\fi\space before loading fmtcount}%
8236 }%
8237 }%
8238 \ifthenelse{\equal{\csname fc@#1@alias@of\endcsname}{#1}}{%
8239 \define@key{fc\csname fc@#1@alias@of\endcsname}{fmtord}{%
8240 \ifthenelse{\equal{##1}{raise}\or\equal{##1}{level}}{%
8241 \expandafter\let\expandafter\@tempa\csname fc@set@ord@as@##1\endcsname
8242 \expandafter\@tempa\csname fc@ord@#1\endcsname
8243 }{%
8244 \ifthenelse{\equal{##1}{undefine}}{%
8245 \expandafter\let\csname fc@ord@#1\endcsname\undefined
8246 }{%
8247 \PackageError{fmtcount}%
8248 {Invalid value `##1' to fmtord key}%
8249 {Option `fmtord' can only take the values `level', `raise'
8250 or `undefine'}%
8251 }}
8252 }%
8253 }{%
8254 % \end{macrocode}
8255 % When the language \texttt{\#1} is an alias, do the same as the language of which it is an alias:
8256 % \begin{macrocode}
8257 \expandafter\let\expandafter\@tempa\csname KV@\csname fc@#1@alias@of\endcsname @fmtord\endcsname
8258 \expandafter\let\csname KV@#1@fmtord\endcsname\@tempa
8259 }%
8260 }
8261 \expandafter\@fc@iterate@on@languages\fc@supported@language@list,\@nil,%
8262 % \end{macrocode}
8263 %\begin{option}{fmtord}
8264 % Key to determine how to display the ordinal
8265 % \changes{3.01}{2014/12/03}{Apply option directly, rather than doing a border effect on \cs{fmtcount@fmtord},
8266 % and then postprocessing depending on \cs{fmtcount@fmtord} at the end of \cs{fmtcountsetoptions}}
8267 % \begin{macrocode}
8268 \def\fc@set@ord@as@level#1{%
8269 \def#1##1{##1}%
8270 }
8271 \def\fc@set@ord@as@raise#1{%
8272 \let#1\fc@textsuperscript
8273 }
8274 \define@key{fmtcount}{fmtord}{%
8275 \ifthenelse{\equal{#1}{level}
8276 \or\equal{#1}{raise}}%
8277 {%
8278 \csname fc@set@ord@as@#1\endcsname\fc@orddef@ult
8279 \def\fmtcount@fmtord{#1}%
8280 }%
8281 {%
8282 \PackageError{fmtcount}%
8283 {Invalid value `#1' to fmtord key}%
8284 {Option `fmtord' can only take the values `level' or `raise'}%
8285 }%
8286 }
8287 % \end{macrocode}
8288 %\end{option}
8289 %\begin{macro}{\iffmtord@abbrv}
8290 % Key to determine whether the ordinal superscript should be
8291 % abbreviated (language dependent, currently only affects French
8292 % ordinals, non-abbreviated French ordinals ending --- i.e. `ier' and
8293 % `i\`eme' --- are considered faulty.)
8294 % \begin{macrocode}
8295 \newif\iffmtord@abbrv
8296 % \end{macrocode}
8297 % \changes{3.01}{2014/11/03}{Make `true' the default for option
8298 % `abbr', as in French this is the correct behaviour, and currently
8299 % only French uses that}
8300 % \begin{macrocode}
8301 \fmtord@abbrvtrue
8302 \define@key{fmtcount}{abbrv}[true]{%
8303 \ifthenelse{\equal{#1}{true}\or\equal{#1}{false}}%
8304 {%
8305 \csname fmtord@abbrv#1\endcsname
8306 }%
8307 {%
8308 \PackageError{fmtcount}%
8309 {Invalid value `#1' to fmtord key}%
8310 {Option `abbrv' can only take the values `true' or
8311 `false'}%
8312 }%
8313 }
8314 % \end{macrocode}
8315 %\end{macro}
8316 %\begin{option}{prefix}
8317 %\changes{2.0}{2012/06/03}{new}
8318 % \begin{macrocode}
8319 \define@key{fmtcount}{prefix}[scale=long]{%
8320 \RequirePackage{fmtprefix}%
8321 \fmtprefixsetoption{#1}%
8322 }
8323 % \end{macrocode}
8324 %\end{option}
8325 %\begin{macro}{\fmtcountsetoptions}
8326 % Define command to set options.
8327 % \changes{3.01}{2014/12/03}{Move French specific stuff to \styfmt{french.def}.}
8328 % \begin{macrocode}
8329 \def\fmtcountsetoptions{%
8330 \def\fmtcount@fmtord{}%
8331 \setkeys{fmtcount}}%
8332 % \end{macrocode}
8333 %\end{macro}
8334 % Load configuration file if it exists. This needs to be done
8335 % before the package options, to allow the user to override
8336 % the settings in the configuration file.
8337 %\changes{2.0}{2012/06/03}{Now no message if fmtcount.cfg not found}
8338 % \begin{macrocode}
8339 \InputIfFileExists{fmtcount.cfg}%
8340 {%
8341 \PackageInfo{fmtcount}{Using configuration file fmtcount.cfg}%
8342 }%
8343 {%
8344 }
8345 % \end{macrocode}
8346 %\begin{macro}{\fmtcount@loaded@by@option@lang@list}
8347 % \changes{3.01}{2014/10/03}{Declare language option so that actual loading happens after \cs{ProcessOptions},
8348 % and the \cs{ProcessOption} only registers the language for loading.}
8349 % \begin{macrocode}
8350 \newcommand*{\fmtcount@loaded@by@option@lang@list}{}
8351 % \end{macrocode}
8352 %\end{macro}
8353 %\begin{option}{\meta{language}}
8354 %Option \meta{language} causes language \meta{language} to be registered for loading.
8355 % \begin{macrocode}
8356 \newcommand*\@fc@declare@language@option[1]{%
8357 \DeclareOption{#1}{%
8358 \ifx\fmtcount@loaded@by@option@lang@list\@empty
8359 \def\fmtcount@loaded@by@option@lang@list{#1}%
8360 \else
8361 \edef\fmtcount@loaded@by@option@lang@list{\fmtcount@loaded@by@option@lang@list,#1}%
8362 \fi
8363 }}%
8364 \fc@iterate@on@languages\@fc@declare@language@option
8365 % \end{macrocode}
8366 %\end{option}
8367 %
8368 %\begin{option}{level}
8369 % \begin{macrocode}
8370 \DeclareOption{level}{\def\fmtcount@fmtord{level}%
8371 \def\fc@orddef@ult#1{#1}}
8372 % \end{macrocode}
8373 %\end{option}
8374 %\begin{option}{raise}
8375 % \begin{macrocode}
8376 \DeclareOption{raise}{\def\fmtcount@fmtord{raise}%
8377 \def\fc@orddef@ult#1{\fc@textsuperscript{#1}}}
8378 % \end{macrocode}
8379 %\end{option}
8380 % Process package options
8381 % \changes{3.00}{2014/07/03}{Add \cs{relax} after \cs{ProcessOptions} like shown in \texttt{clsguide.pdf}}
8382 % \begin{macrocode}
8383 \ProcessOptions\relax
8384 % \end{macrocode}
8385 % \changes{3.01}{2014/10/03}{Load languages that have been registered for loading by package option.}
8386 % Now we do the loading of all languages that have been set by option to be loaded.
8387 % \begin{macrocode}
8388 \ifx\fmtcount@loaded@by@option@lang@list\@empty\else
8389 \def\fc@iterate@on@languages@body#1{%
8390 \@FC@iflangloaded{#1}{}{%
8391 \fmtcount@language@optiontrue
8392 \FCloadlang{#1}%
8393 }}
8394 \expandafter\@fc@iterate@on@languages\fmtcount@loaded@by@option@lang@list,\@nil,%
8395 \fi
8396 % \end{macrocode}
8397 %\begin{macro}{\@FCmodulo}
8398 %\begin{definition}
8399 %\cs{@FCmodulo}\marg{count reg}\marg{n}
8400 %\end{definition}
8401 %\changes{2.04}{2014/06/03}{renamed \cs{@modulo} to \cs{@FCmodulo}}
8402 % Sets the count register to be its value modulo \meta{n}.
8403 % This is used for the
8404 % date, time, ordinal and numberstring commands. (The
8405 % \styfmt{fmtcount} package was originally part of the
8406 % \sty{datetime} package.)
8407 % \begin{macrocode}
8408 \newcount\@DT@modctr
8409 \newcommand*{\@FCmodulo}[2]{%
8410 \@DT@modctr=#1\relax
8411 \divide \@DT@modctr by #2\relax
8412 \multiply \@DT@modctr by #2\relax
8413 \advance #1 by -\@DT@modctr
8414 }
8415 % \end{macrocode}
8416 %\end{macro}
8417 % The following registers are needed by \verb|\@ordinal| etc
8418 % \begin{macrocode}
8419 \newcount\@ordinalctr
8420 \newcount\@orgargctr
8421 \newcount\@strctr
8422 \newcount\@tmpstrctr
8423 % \end{macrocode}
8424 %Define commands that display numbers in different bases.
8425 % Define counters and conditionals needed.
8426 % \begin{macrocode}
8427 \newif\if@DT@padzeroes
8428 \newcount\@DT@loopN
8429 \newcount\@DT@X
8430 % \end{macrocode}
8431 %\begin{macro}{\binarynum}
8432 % Converts a decimal number to binary, and display.
8433 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8434 % \begin{macrocode}
8435 \newrobustcmd*{\@binary}[1]{%
8436 \@DT@padzeroestrue
8437 \@DT@loopN=17\relax
8438 \@strctr=\@DT@loopN
8439 \whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by \@ne}%
8440 \@strctr=65536\relax
8441 \@DT@X=#1\relax
8442 \loop
8443 \@DT@modctr=\@DT@X
8444 \divide\@DT@modctr by \@strctr
8445 \ifthenelse{\boolean{@DT@padzeroes}
8446 \and \(\@DT@modctr=0\)
8447 \and \(\@DT@loopN>\c@padzeroesN\)}%
8448 {}%
8449 {\the\@DT@modctr}%
8450 \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi
8451 \multiply\@DT@modctr by \@strctr
8452 \advance\@DT@X by -\@DT@modctr
8453 \divide\@strctr by \tw@
8454 \advance\@DT@loopN by \m@ne
8455 \ifnum\@strctr>\@ne
8456 \repeat
8457 \the\@DT@X
8458 }
8459
8460 \let\binarynum=\@binary
8461 % \end{macrocode}
8462 %\end{macro}
8463 %\begin{macro}{\octalnum}
8464 % Converts a decimal number to octal, and displays.
8465 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8466 % \begin{macrocode}
8467 \newrobustcmd*{\@octal}[1]{%
8468 \@DT@X=#1\relax
8469 \ifnum\@DT@X>32768
8470 \PackageError{fmtcount}%
8471 {Value of counter too large for \protect\@octal}
8472 {Maximum value 32768}
8473 \else
8474 \@DT@padzeroestrue
8475 \@DT@loopN=6\relax
8476 \@strctr=\@DT@loopN
8477 \whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by \@ne}%
8478 \@strctr=32768\relax
8479 \loop
8480 \@DT@modctr=\@DT@X
8481 \divide\@DT@modctr by \@strctr
8482 \ifthenelse{\boolean{@DT@padzeroes}
8483 \and \(\@DT@modctr=0\)
8484 \and \(\@DT@loopN>\c@padzeroesN\)}%
8485 {}{\the\@DT@modctr}%
8486 \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi
8487 \multiply\@DT@modctr by \@strctr
8488 \advance\@DT@X by -\@DT@modctr
8489 \divide\@strctr by \@viiipt
8490 \advance\@DT@loopN by \m@ne
8491 \ifnum\@strctr>\@ne
8492 \repeat
8493 \the\@DT@X
8494 \fi
8495 }
8496 \let\octalnum=\@octal
8497 % \end{macrocode}
8498 %\end{macro}
8499 %\begin{macro}{\@@hexadecimal}
8500 % Converts number from 0 to 15 into lowercase hexadecimal notation.
8501 % \begin{macrocode}
8502 \newcommand*{\@@hexadecimal}[1]{%
8503 \ifcase#10\or1\or2\or3\or4\or5\or
8504 6\or7\or8\or9\or a\or b\or c\or d\or e\or f\fi
8505 }
8506 % \end{macrocode}
8507 %\end{macro}
8508 %\begin{macro}{\hexadecimalnum}
8509 % Converts a decimal number to a lowercase hexadecimal number,
8510 % and displays it.
8511 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8512 %\changes{3.06}{2018/06/27}{Rename \cs{Hexadecimalnum} to \cs{HEXADecimalnum} and \cs{Hexadecimal} to
8513 % \cs{HEXADecimal} and factorize the code between \cs{HEXADecimalnum} and \cs{hexadecimalnum}.}
8514 % \begin{macrocode}
8515 \newrobustcmd*{\hexadecimalnum}{\@hexadecimalengine\@@hexadecimal}
8516 % \end{macrocode}
8517 %\end{macro}
8518 %\begin{macro}{\@@Hexadecimal}
8519 % Converts number from 0 to 15 into uppercase hexadecimal notation.
8520 % \begin{macrocode}
8521 \newcommand*{\@@Hexadecimal}[1]{%
8522 \ifcase#10\or1\or2\or3\or4\or5\or6\or
8523 7\or8\or9\or A\or B\or C\or D\or E\or F\fi
8524 }
8525 % \end{macrocode}
8526 %\end{macro}
8527 %\begin{macro}{\HEXADecimalnum}
8528 % Uppercase hexadecimal
8529 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8530 %\changes{3.06}{2018/06/27}{Rename \cs{Hexadecimalnum} to \cs{HEXADecimalnum} and \cs{Hexadecimal} to
8531 % \cs{HEXADecimal} and factorize the code between \cs{HEXADecimalnum} and \cs{hexadecimalnum}.}
8532 % \begin{macrocode}
8533 \newrobustcmd*{\HEXADecimalnum}{\@hexadecimalengine\@@Hexadecimal}
8534 \newcommand*{\@hexadecimalengine}[2]{%
8535 \@DT@padzeroestrue
8536 \@DT@loopN=\@vpt
8537 \@strctr=\@DT@loopN
8538 \whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by \@ne}%
8539 \@strctr=65536\relax
8540 \@DT@X=#2\relax
8541 \loop
8542 \@DT@modctr=\@DT@X
8543 \divide\@DT@modctr by \@strctr
8544 \ifthenelse{\boolean{@DT@padzeroes}
8545 \and \(\@DT@modctr=0\)
8546 \and \(\@DT@loopN>\c@padzeroesN\)}
8547 {}{#1\@DT@modctr}%
8548 \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi
8549 \multiply\@DT@modctr by \@strctr
8550 \advance\@DT@X by -\@DT@modctr
8551 \divide\@strctr by 16\relax
8552 \advance\@DT@loopN by \m@ne
8553 \ifnum\@strctr>\@ne
8554 \repeat
8555 #1\@DT@X
8556 }
8557 \def\Hexadecimalnum{%
8558 \PackageWarning{fmtcount}{\string\Hexadecimalnum\space is deprecated, use \string\HEXADecimalnum\space
8559 instead. The \string\Hexadecimalnum\space control sequence name is confusing as it can mislead in thinking
8560 that only the 1st letter is upper-cased.}%
8561 \HEXADecimalnum}
8562 % \end{macrocode}
8563 %\end{macro}
8564 %\begin{macro}{\aaalphnum}
8565 % Lowercase alphabetical representation (a \ldots\ z aa \ldots\ zz)
8566 % \changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8567 % \changes{3.04}{2017/09/16}{Code optimization, use of \cs{@ne} and \cs{m@ne}, and assign \texttt{\#1} only
8568 % once. Factorize code with \cs{@AAAlph}.}
8569 % \begin{macrocode}
8570 \newrobustcmd*{\@aaalph}{\fc@aaalph\@alph}
8571 \newcommand*\fc@aaalph[2]{%
8572 \@DT@loopN=#2\relax
8573 \@DT@X\@DT@loopN
8574 \advance\@DT@loopN by \m@ne
8575 \divide\@DT@loopN by 26\relax
8576 \@DT@modctr=\@DT@loopN
8577 \multiply\@DT@modctr by 26\relax
8578 \advance\@DT@X by \m@ne
8579 \advance\@DT@X by -\@DT@modctr
8580 \advance\@DT@loopN by \@ne
8581 \advance\@DT@X by \@ne
8582 \edef\@tempa{#1\@DT@X}%
8583 \loop
8584 \@tempa
8585 \advance\@DT@loopN by \m@ne
8586 \ifnum\@DT@loopN>0
8587 \repeat
8588 }
8589
8590 \let\aaalphnum=\@aaalph
8591 % \end{macrocode}
8592 %\end{macro}
8593 %\begin{macro}{\AAAlphnum}
8594 % Uppercase alphabetical representation (a \ldots\ z aa \ldots\ zz)
8595 % \changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8596 % \changes{3.04}{2017/09/16}{Code optimization, factorize code with \@aaalph.}
8597 % \begin{macrocode}
8598 \newrobustcmd*{\@AAAlph}{\fc@aaalph\@Alph}%
8599
8600 \let\AAAlphnum=\@AAAlph
8601 % \end{macrocode}
8602 %\end{macro}
8603 %\begin{macro}{\abalphnum}
8604 % Lowercase alphabetical representation
8605 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8606 % \changes{3.04}{2017/09/16}{Code factorization with \cs{@ABAlph}. Code optimization, assign \texttt{\#1} only
8607 % once. Use \cs{@ne} and \cs{m@ne}.}
8608 % \begin{macrocode}
8609 \newrobustcmd*{\@abalph}{\fc@abalph\@alph}%
8610 \newcommand*\fc@abalph[2]{%
8611 \@DT@X=#2\relax
8612 \ifnum\@DT@X>17576\relax
8613 \ifx#1\@alph\def\@tempa{\@abalph}%
8614 \else\def\@tempa{\@ABAlph}\fi
8615 \PackageError{fmtcount}%
8616 {Value of counter too large for \expandafter\protect\@tempa}%
8617 {Maximum value 17576}%
8618 \else
8619 \@DT@padzeroestrue
8620 \@strctr=17576\relax
8621 \advance\@DT@X by \m@ne
8622 \loop
8623 \@DT@modctr=\@DT@X
8624 \divide\@DT@modctr by \@strctr
8625 \ifthenelse{\boolean{@DT@padzeroes}
8626 \and \(\@DT@modctr=1\)}%
8627 {}{#1\@DT@modctr}%
8628 \ifnum\@DT@modctr=\@ne\else\@DT@padzeroesfalse\fi
8629 \multiply\@DT@modctr by \@strctr
8630 \advance\@DT@X by -\@DT@modctr
8631 \divide\@strctr by 26\relax
8632 \ifnum\@strctr>\@ne
8633 \repeat
8634 \advance\@DT@X by \@ne
8635 #1\@DT@X
8636 \fi
8637 }
8638
8639 \let\abalphnum=\@abalph
8640 % \end{macrocode}
8641 %\end{macro}
8642 %\begin{macro}{\ABAlphnum}
8643 % Uppercase alphabetical representation
8644 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8645 %\changes{3.04}{2017/09/16}{Code optimization, factorize code with \cs{@abalph}.}
8646 % \begin{macrocode}
8647 \newrobustcmd*{\@ABAlph}{\fc@abalph\@Alph}%
8648 \let\ABAlphnum=\@ABAlph
8649 % \end{macrocode}
8650 %\end{macro}
8651 %\begin{macro}{\@fmtc@count}
8652 % Recursive command to count number of characters in argument.
8653 % \cs{@strctr} should be set to zero before calling it.
8654 % \begin{macrocode}
8655 \def\@fmtc@count#1#2\relax{%
8656 \if\relax#1%
8657 \else
8658 \advance\@strctr by 1\relax
8659 \@fmtc@count#2\relax
8660 \fi
8661 }
8662 % \end{macrocode}
8663 %\end{macro}
8664 %\begin{macro}{\@decimal}
8665 %\changes{1.31}{2009/10/02}{fixed unwanted space.}
8666 % Format number as a decimal, possibly padded with zeroes in front.
8667 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8668 % \begin{macrocode}
8669 \newrobustcmd*{\@decimal}[1]{%
8670 \@strctr=0\relax
8671 \expandafter\@fmtc@count\number#1\relax
8672 \@DT@loopN=\c@padzeroesN
8673 \advance\@DT@loopN by -\@strctr
8674 \ifnum\@DT@loopN>0\relax
8675 \@strctr=0\relax
8676 \whiledo{\@strctr < \@DT@loopN}{0\advance\@strctr by 1\relax}%
8677 \fi
8678 \number#1\relax
8679 }
8680
8681 \let\decimalnum=\@decimal
8682 % \end{macrocode}
8683 %\end{macro}
8684 %\begin{macro}{\FCordinal}
8685 %\begin{definition}
8686 %\cs{FCordinal}\marg{number}
8687 %\end{definition}
8688 % This is a bit cumbersome. Previously \cs{@ordinal}
8689 % was defined in a similar way to \cs{abalph} etc.
8690 % This ensured that the actual value of the counter was
8691 % written in the new label stuff in the .aux file. However
8692 % adding in an optional argument to determine the gender
8693 % for multilingual compatibility messed things up somewhat.
8694 % This was the only work around I could get to keep the
8695 % the cross-referencing stuff working, which is why
8696 % the optional argument comes \emph{after} the compulsory
8697 % argument, instead of the usual manner of placing it before.
8698 % Note however, that putting the optional argument means that
8699 % any spaces will be ignored after the command if the optional
8700 % argument is omitted.
8701 % Version 1.04 changed \cs{ordinal} to \cs{FCordinal}
8702 % to prevent it clashing with the memoir class.
8703 % \changes{3.02}{2015/08/01}{Suppress useless \cs{expandafter}'s and and use \cs{value} instead tweaking with
8704 % \cs{csname}. Do not use any longer \cs{protect} as \cs{ordinalnum} is made robust.}
8705 % \begin{macrocode}
8706 \newcommand{\FCordinal}[1]{%
8707 \ordinalnum{%
8708 \the\value{#1}}%
8709 }
8710 % \end{macrocode}
8711 %\end{macro}
8712 %\begin{macro}{\ordinal}
8713 % If \cs{ordinal} isn't defined make \cs{ordinal} a synonym
8714 % for \cs{FCordinal} to maintain compatibility with previous
8715 % versions.
8716 % \changes{3.00}{2014/07/03}{Use \cs{protect}, not \cs{string} in \cs{PackageWarning} to quote macros like
8717 % shown in \texttt{clsguide.pdf}}
8718 % \begin{macrocode}
8719 \ifcsundef{ordinal}
8720 {\let\ordinal\FCordinal}%
8721 {%
8722 \PackageWarning{fmtcount}%
8723 {\protect\ordinal \space already defined use
8724 \protect\FCordinal \space instead.}
8725 }
8726 % \end{macrocode}
8727 %\end{macro}
8728 %\begin{macro}{\ordinalnum}
8729 % Display ordinal where value is given as a number or
8730 % count register instead of a counter:
8731 %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with
8732 %\cs{new@ifnextchar}}
8733 % \changes{3.02}{2015/08/03}{Make \cs{ordinalnum} robust.}
8734 % \changes{3.04}{2017/09/03}{Use \texttt{etoobox}'s \cs{newrobustcmd*} instead of \LaTeX\ kernel
8735 % \cs{DeclareRobustcommand*} in order to make \cs{ordinalnum} robust. This is preferable, e.g. w.r.t. \TeX 4ht
8736 % compilation.}
8737 % \begin{macrocode}
8738 \newrobustcmd*{\ordinalnum}[1]{%
8739 \new@ifnextchar[%
8740 {\@ordinalnum{#1}}%
8741 {\@ordinalnum{#1}[m]}%
8742 }
8743 % \end{macrocode}
8744 %\end{macro}
8745 %\begin{macro}{\@ordinalnum}
8746 % Display ordinal according to gender (neuter added in v1.1,
8747 % \cs{xspace} added in v1.2, and removed in v1.3\footnote{I
8748 %couldn't get it to work consistently both with and without the
8749 %optional argument}):
8750 % \begin{macrocode}
8751 \def\@ordinalnum#1[#2]{%
8752 {%
8753 \ifthenelse{\equal{#2}{f}}%
8754 {%
8755 \protect\@ordinalF{#1}{\@fc@ordstr}%
8756 }%
8757 {%
8758 \ifthenelse{\equal{#2}{n}}%
8759 {%
8760 \protect\@ordinalN{#1}{\@fc@ordstr}%
8761 }%
8762 {%
8763 \ifthenelse{\equal{#2}{m}}%
8764 {}%
8765 {%
8766 \PackageError{fmtcount}%
8767 {Invalid gender option `#2'}%
8768 {Available options are m, f or n}%
8769 }%
8770 \protect\@ordinalM{#1}{\@fc@ordstr}%
8771 }%
8772 }%
8773 \@fc@ordstr
8774 }%
8775 }
8776 % \end{macrocode}
8777 %\end{macro}
8778 %\begin{macro}{\storeordinal}
8779 % Store the ordinal (first argument
8780 % is identifying name, second argument is a counter.)
8781 % \changes{3.02}{2015/08/03}{Suppress useless \cs{expandafter}'s and and use \cs{value} instead tweaking with
8782 % \cs{csname}. Do not use any longer \cs{protect} as \cs{storeordinalnum} is made robust.}
8783 % \changes{3.02}{2016/01/08}{Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before passing to \cs{storeordinalnum}}
8784 % \begin{macrocode}
8785 \newcommand*{\storeordinal}[2]{%
8786 {%
8787 \toks0{\storeordinalnum{#1}}%
8788 \expandafter
8789 }\the\toks0\expandafter{%
8790 \the\value{#2}}%
8791 }
8792 % \end{macrocode}
8793 %\end{macro}
8794 %\begin{macro}{\storeordinalnum}
8795 % Store ordinal (first argument
8796 % is identifying name, second argument is a number or
8797 % count register.)
8798 % \changes{3.02}{2016/01/08}{Make \cs{storeordinalnum} robust with etoolbox \cs{newrobustcmd}.}
8799 % \begin{macrocode}
8800 \newrobustcmd*{\storeordinalnum}[2]{%
8801 \@ifnextchar[%
8802 {\@storeordinalnum{#1}{#2}}%
8803 {\@storeordinalnum{#1}{#2}[m]}%
8804 }
8805 % \end{macrocode}
8806 %\end{macro}
8807 %\begin{macro}{\@storeordinalnum}
8808 % Store ordinal according to gender:
8809 % \begin{macrocode}
8810 \def\@storeordinalnum#1#2[#3]{%
8811 \ifthenelse{\equal{#3}{f}}%
8812 {%
8813 \protect\@ordinalF{#2}{\@fc@ord}
8814 }%
8815 {%
8816 \ifthenelse{\equal{#3}{n}}%
8817 {%
8818 \protect\@ordinalN{#2}{\@fc@ord}%
8819 }%
8820 {%
8821 \ifthenelse{\equal{#3}{m}}%
8822 {}%
8823 {%
8824 \PackageError{fmtcount}%
8825 {Invalid gender option `#3'}%
8826 {Available options are m or f}%
8827 }%
8828 \protect\@ordinalM{#2}{\@fc@ord}%
8829 }%
8830 }%
8831 \expandafter\let\csname @fcs@#1\endcsname\@fc@ord
8832 }
8833 % \end{macrocode}
8834 %\end{macro}
8835 %\begin{macro}{\FMCuse}
8836 % Get stored information:
8837 % \begin{macrocode}
8838 \newcommand*{\FMCuse}[1]{\csname @fcs@#1\endcsname}
8839 % \end{macrocode}
8840 %\end{macro}
8841 %\begin{macro}{\ordinalstring}
8842 % Display ordinal as a string (argument is a counter)
8843 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
8844 % and use \cs{value} instead tweaking with \cs{csname}. Do not use
8845 % any longer \cs{protect} as \cs{ordinalstringnum} is made
8846 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
8847 % passing to \cs{ordinalstringnum}}%
8848 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{ordinalstringnum} is
8849 % supposed to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for
8850 % compatibily with \texttt{glossaries}.}
8851 % \begin{macrocode}
8852 \newcommand*{\ordinalstring}[1]{%
8853 \ordinalstringnum{\expandafter\expandafter\expandafter
8854 \the\value{#1}}%
8855 }
8856 % \end{macrocode}
8857 %\end{macro}
8858 %\begin{macro}{\ordinalstringnum}
8859 % Display ordinal as a string (argument is a count register or
8860 % number.)
8861 %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with
8862 %\cs{new@ifnextchar}}
8863 %\changes{1.33}{2009/10/15}{Made robust}
8864 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8865 % \begin{macrocode}
8866 \newrobustcmd*{\ordinalstringnum}[1]{%
8867 \new@ifnextchar[%
8868 {\@ordinal@string{#1}}%
8869 {\@ordinal@string{#1}[m]}%
8870 }
8871 % \end{macrocode}
8872 %\end{macro}
8873 %\begin{macro}{\@ordinal@string}
8874 % Display ordinal as a string according to gender.
8875 % \changes{3.00}{2014/07/03}{Use \cs{protect}, not \cs{string} in \cs{PackageError} to quote macros like
8876 % shown in \texttt{clsguide.pdf}}
8877 % \changes{3.00}{2014/07/03}{Correct detailed error message, so `n' is one of available gender options}
8878 % \begin{macrocode}
8879 \def\@ordinal@string#1[#2]{%
8880 {%
8881 \ifthenelse{\equal{#2}{f}}%
8882 {%
8883 \protect\@ordinalstringF{#1}{\@fc@ordstr}%
8884 }%
8885 {%
8886 \ifthenelse{\equal{#2}{n}}%
8887 {%
8888 \protect\@ordinalstringN{#1}{\@fc@ordstr}%
8889 }%
8890 {%
8891 \ifthenelse{\equal{#2}{m}}%
8892 {}%
8893 {%
8894 \PackageError{fmtcount}%
8895 {Invalid gender option `#2' to \protect\ordinalstring}%
8896 {Available options are m, f or n}%
8897 }%
8898 \protect\@ordinalstringM{#1}{\@fc@ordstr}%
8899 }%
8900 }%
8901 \@fc@ordstr
8902 }%
8903 }
8904 % \end{macrocode}
8905 %\end{macro}
8906 %\begin{macro}{\storeordinalstring}
8907 % Store textual representation of number. First argument is
8908 % identifying name, second argument is the counter set to the
8909 % required number.
8910 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
8911 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
8912 % longer \cs{protect} as \cs{storeordinalstringnum} is made
8913 % robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before
8914 % passing to \cs{storeordinalstringnum}}
8915 % \begin{macrocode}
8916 \newcommand*{\storeordinalstring}[2]{%
8917 {%
8918 \toks0{\storeordinalstringnum{#1}}%
8919 \expandafter
8920 }\the\toks0\expandafter{\the\value{#2}}%
8921 }
8922 % \end{macrocode}
8923 %\end{macro}
8924 %\begin{macro}{\storeordinalstringnum}
8925 % Store textual representation of number. First argument is
8926 % identifying name, second argument is a count register or number.
8927 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8928 % \begin{macrocode}
8929 \newrobustcmd*{\storeordinalstringnum}[2]{%
8930 \@ifnextchar[%
8931 {\@store@ordinal@string{#1}{#2}}%
8932 {\@store@ordinal@string{#1}{#2}[m]}%
8933 }
8934 % \end{macrocode}
8935 %\end{macro}
8936 %\begin{macro}{\@store@ordinal@string}
8937 % Store textual representation of number according to gender.
8938 % \changes{3.00}{2014/07/03}{Use \cs{protect}, not \cs{string} in \cs{PackageWarning} to quote macros like
8939 % shown in \texttt{clsguide.pdf}}
8940 % \begin{macrocode}
8941 \def\@store@ordinal@string#1#2[#3]{%
8942 \ifthenelse{\equal{#3}{f}}%
8943 {%
8944 \protect\@ordinalstringF{#2}{\@fc@ordstr}%
8945 }%
8946 {%
8947 \ifthenelse{\equal{#3}{n}}%
8948 {%
8949 \protect\@ordinalstringN{#2}{\@fc@ordstr}%
8950 }%
8951 {%
8952 \ifthenelse{\equal{#3}{m}}%
8953 {}%
8954 {%
8955 \PackageError{fmtcount}%
8956 {Invalid gender option `#3' to \protect\ordinalstring}%
8957 {Available options are m, f or n}%
8958 }%
8959 \protect\@ordinalstringM{#2}{\@fc@ordstr}%
8960 }%
8961 }%
8962 \expandafter\let\csname @fcs@#1\endcsname\@fc@ordstr
8963 }
8964 % \end{macrocode}
8965 %\end{macro}
8966 %\begin{macro}{\Ordinalstring}
8967 % Display ordinal as a string with initial letters in upper case
8968 % (argument is a counter)
8969 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
8970 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
8971 % longer \cs{protect} as \cs{Ordinalstringnum} is made
8972 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
8973 % passing to \cs{Ordinalstringnum}}
8974 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{Ordinalstringnum} is
8975 % supposed to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for
8976 % compatibily with \texttt{glossaries}.}
8977 % \begin{macrocode}
8978 \newcommand*{\Ordinalstring}[1]{%
8979 \Ordinalstringnum{\expandafter\expandafter\expandafter\the\value{#1}}%
8980 }
8981 % \end{macrocode}
8982 %\end{macro}
8983 %\begin{macro}{\Ordinalstringnum}
8984 % Display ordinal as a string with initial letters in upper case
8985 % (argument is a number or count register)
8986 %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with
8987 %\cs{new@ifnextchar}}
8988 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
8989 % \begin{macrocode}
8990 \newrobustcmd*{\Ordinalstringnum}[1]{%
8991 \new@ifnextchar[%
8992 {\@Ordinal@string{#1}}%
8993 {\@Ordinal@string{#1}[m]}%
8994 }
8995 % \end{macrocode}
8996 %\end{macro}
8997 %\begin{macro}{\@Ordinal@string}
8998 % Display ordinal as a string with initial letters in upper case
8999 % according to gender
9000 % \begin{macrocode}
9001 \def\@Ordinal@string#1[#2]{%
9002 {%
9003 \ifthenelse{\equal{#2}{f}}%
9004 {%
9005 \protect\@OrdinalstringF{#1}{\@fc@ordstr}%
9006 }%
9007 {%
9008 \ifthenelse{\equal{#2}{n}}%
9009 {%
9010 \protect\@OrdinalstringN{#1}{\@fc@ordstr}%
9011 }%
9012 {%
9013 \ifthenelse{\equal{#2}{m}}%
9014 {}%
9015 {%
9016 \PackageError{fmtcount}%
9017 {Invalid gender option `#2'}%
9018 {Available options are m, f or n}%
9019 }%
9020 \protect\@OrdinalstringM{#1}{\@fc@ordstr}%
9021 }%
9022 }%
9023 \@fc@ordstr
9024 }%
9025 }
9026 % \end{macrocode}
9027 %\end{macro}
9028 %\begin{macro}{\storeOrdinalstring}
9029 % Store textual representation of number, with initial letters in
9030 % upper case. First argument is identifying name, second argument
9031 % is the counter set to the
9032 % required number.
9033 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9034 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9035 % longer \cs{protect} as \cs{storeOrdinalstringnum} is made
9036 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9037 % passing to \cs{storeOrdinalstringnum}}
9038 % \begin{macrocode}
9039 \newcommand*{\storeOrdinalstring}[2]{%
9040 {%
9041 \toks0{\storeOrdinalstringnum{#1}}%
9042 \expandafter
9043 }\the\toks0\expandafter{\the\value{#2}}%
9044 }
9045 % \end{macrocode}
9046 %\end{macro}
9047 %\begin{macro}{\storeOrdinalstringnum}
9048 % Store textual representation of number, with initial letters in
9049 % upper case. First argument is identifying name, second argument
9050 % is a count register or number.
9051 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
9052 % \begin{macrocode}
9053 \newrobustcmd*{\storeOrdinalstringnum}[2]{%
9054 \@ifnextchar[%
9055 {\@store@Ordinal@string{#1}{#2}}%
9056 {\@store@Ordinal@string{#1}{#2}[m]}%
9057 }
9058 % \end{macrocode}
9059 %\end{macro}
9060 %\begin{macro}{\@store@Ordinal@string}
9061 % Store textual representation of number according to gender,
9062 % with initial letters in upper case.
9063 % \begin{macrocode}
9064 \def\@store@Ordinal@string#1#2[#3]{%
9065 \ifthenelse{\equal{#3}{f}}%
9066 {%
9067 \protect\@OrdinalstringF{#2}{\@fc@ordstr}%
9068 }%
9069 {%
9070 \ifthenelse{\equal{#3}{n}}%
9071 {%
9072 \protect\@OrdinalstringN{#2}{\@fc@ordstr}%
9073 }%
9074 {%
9075 \ifthenelse{\equal{#3}{m}}%
9076 {}%
9077 {%
9078 \PackageError{fmtcount}%
9079 {Invalid gender option `#3'}%
9080 {Available options are m or f}%
9081 }%
9082 \protect\@OrdinalstringM{#2}{\@fc@ordstr}%
9083 }%
9084 }%
9085 \expandafter\let\csname @fcs@#1\endcsname\@fc@ordstr
9086 }
9087 % \end{macrocode}
9088 %\end{macro}
9089 %
9090 %\begin{macro}{\storeORDINALstring}
9091 % Store upper case textual representation of ordinal. The first
9092 % argument is identifying name, the second argument is a counter.
9093 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9094 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9095 % longer \cs{protect} as \cs{storeORDINALstringnum} is made
9096 % robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before
9097 % passing to \cs{storeORDINALstringnum}.}
9098 % \begin{macrocode}
9099 \newcommand*{\storeORDINALstring}[2]{%
9100 {%
9101 \toks0{\storeORDINALstringnum{#1}}%
9102 \expandafter
9103 }\the\toks0\expandafter{\the\value{#2}}%
9104 }
9105 % \end{macrocode}
9106 %\end{macro}
9107 %\begin{macro}{\storeORDINALstringnum}
9108 % As above, but the second argument is a count register or a
9109 % number.
9110 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
9111 % \begin{macrocode}
9112 \newrobustcmd*{\storeORDINALstringnum}[2]{%
9113 \@ifnextchar[%
9114 {\@store@ORDINAL@string{#1}{#2}}%
9115 {\@store@ORDINAL@string{#1}{#2}[m]}%
9116 }
9117 % \end{macrocode}
9118 %\end{macro}
9119 %\begin{macro}{\@store@ORDINAL@string}
9120 % Gender is specified as an optional argument at the end.
9121 % \begin{macrocode}
9122 \def\@store@ORDINAL@string#1#2[#3]{%
9123 \ifthenelse{\equal{#3}{f}}%
9124 {%
9125 \protect\@ordinalstringF{#2}{\@fc@ordstr}%
9126 }%
9127 {%
9128 \ifthenelse{\equal{#3}{n}}%
9129 {%
9130 \protect\@ordinalstringN{#2}{\@fc@ordstr}%
9131 }%
9132 {%
9133 \ifthenelse{\equal{#3}{m}}%
9134 {}%
9135 {%
9136 \PackageError{fmtcount}%
9137 {Invalid gender option `#3'}%
9138 {Available options are m or f}%
9139 }%
9140 \protect\@ordinalstringM{#2}{\@fc@ordstr}%
9141 }%
9142 }%
9143 % \end{macrocode}
9144 % \changes{3.01}{2014/11/03}{Protect \cs{`}.}
9145 % \begin{macrocode}
9146 \expandafter\protected@edef\csname @fcs@#1\endcsname{%
9147 \noexpand\MakeUppercase{\@fc@ordstr}%
9148 }%
9149 }
9150 % \end{macrocode}
9151 %\end{macro}
9152 %\begin{macro}{\ORDINALstring}
9153 % Display upper case textual representation of an ordinal. The
9154 % argument must be a counter.
9155 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9156 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9157 % longer \cs{protect} as \cs{ORDINALstringnum} is made
9158 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9159 % passing to \cs{ORDINALstringnum}}
9160 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{ORDINALstringnum} is
9161 % supposed to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for
9162 % compatibily with \texttt{glossaries}.}
9163 % \begin{macrocode}
9164 \newcommand*{\ORDINALstring}[1]{%
9165 \ORDINALstringnum{\expandafter\expandafter\expandafter
9166 \the\value{#1}%
9167 }%
9168 }
9169 % \end{macrocode}
9170 %\end{macro}
9171 %\begin{macro}{\ORDINALstringnum}
9172 % As above, but the argument is a count register or a number.
9173 %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with
9174 %\cs{new@ifnextchar}}
9175 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
9176 % \begin{macrocode}
9177 \newrobustcmd*{\ORDINALstringnum}[1]{%
9178 \new@ifnextchar[%
9179 {\@ORDINAL@string{#1}}%
9180 {\@ORDINAL@string{#1}[m]}%
9181 }
9182 % \end{macrocode}
9183 %\end{macro}
9184 %\begin{macro}{\@ORDINAL@string}
9185 % Gender is specified as an optional argument at the end.
9186 % \begin{macrocode}
9187 \def\@ORDINAL@string#1[#2]{%
9188 {%
9189 \ifthenelse{\equal{#2}{f}}%
9190 {%
9191 \protect\@ordinalstringF{#1}{\@fc@ordstr}%
9192 }%
9193 {%
9194 \ifthenelse{\equal{#2}{n}}%
9195 {%
9196 \protect\@ordinalstringN{#1}{\@fc@ordstr}%
9197 }%
9198 {%
9199 \ifthenelse{\equal{#2}{m}}%
9200 {}%
9201 {%
9202 \PackageError{fmtcount}%
9203 {Invalid gender option `#2'}%
9204 {Available options are m, f or n}%
9205 }%
9206 \protect\@ordinalstringM{#1}{\@fc@ordstr}%
9207 }%
9208 }%
9209 \MakeUppercase{\@fc@ordstr}%
9210 }%
9211 }
9212 % \end{macrocode}
9213 %\end{macro}
9214 %\begin{macro}{\storenumberstring}
9215 % Convert number to textual respresentation, and store. First
9216 % argument is the identifying name, second argument is a counter
9217 % containing the number.
9218 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9219 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9220 % longer \cs{protect} as \cs{storenumberstringnum} is made
9221 % robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before
9222 % passing to \cs{storenumberstringnum}}
9223 % \begin{macrocode}
9224 \newcommand*{\storenumberstring}[2]{%
9225 \expandafter\protect\expandafter\storenumberstringnum{#1}{%
9226 \expandafter\the\value{#2}}%
9227 }
9228 % \end{macrocode}
9229 %\end{macro}
9230 %\begin{macro}{\storenumberstringnum}
9231 % As above, but second argument is a number or count register.
9232 % \begin{macrocode}
9233 \newcommand{\storenumberstringnum}[2]{%
9234 \@ifnextchar[%
9235 {\@store@number@string{#1}{#2}}%
9236 {\@store@number@string{#1}{#2}[m]}%
9237 }
9238 % \end{macrocode}
9239 %\end{macro}
9240 %\begin{macro}{\@store@number@string}
9241 % Gender is given as optional argument, \emph{at the end}.
9242 % \begin{macrocode}
9243 \def\@store@number@string#1#2[#3]{%
9244 \ifthenelse{\equal{#3}{f}}%
9245 {%
9246 \protect\@numberstringF{#2}{\@fc@numstr}%
9247 }%
9248 {%
9249 \ifthenelse{\equal{#3}{n}}%
9250 {%
9251 \protect\@numberstringN{#2}{\@fc@numstr}%
9252 }%
9253 {%
9254 \ifthenelse{\equal{#3}{m}}%
9255 {}%
9256 {%
9257 \PackageError{fmtcount}
9258 {Invalid gender option `#3'}%
9259 {Available options are m, f or n}%
9260 }%
9261 \protect\@numberstringM{#2}{\@fc@numstr}%
9262 }%
9263 }%
9264 \expandafter\let\csname @fcs@#1\endcsname\@fc@numstr
9265 }
9266 % \end{macrocode}
9267 %\end{macro}
9268 %\begin{macro}{\numberstring}
9269 % Display textual representation of a number. The argument
9270 % must be a counter.
9271 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9272 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9273 % longer \cs{protect} as \cs{numberstringnum} is made
9274 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9275 % passing to \cs{numberstringnum}}
9276 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{numberstringnum} is
9277 % supposed to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for
9278 % compatibily with \texttt{glossaries}.}
9279 % \begin{macrocode}
9280 \newcommand*{\numberstring}[1]{%
9281 \numberstringnum{\expandafter\expandafter\expandafter
9282 \the\value{#1}}%
9283 }
9284 % \end{macrocode}
9285 %\end{macro}
9286 %\begin{macro}{\numberstringnum}
9287 % As above, but the argument is a count register or a number.
9288 %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with
9289 %\cs{new@ifnextchar}}
9290 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
9291 % \begin{macrocode}
9292 \newrobustcmd*{\numberstringnum}[1]{%
9293 \new@ifnextchar[%
9294 {\@number@string{#1}}%
9295 {\@number@string{#1}[m]}%
9296 }
9297 % \end{macrocode}
9298 %\end{macro}
9299 %
9300 %\begin{macro}{\@number@string}
9301 % Gender is specified as an optional argument \emph{at the end}.
9302 % \begin{macrocode}
9303 \def\@number@string#1[#2]{%
9304 {%
9305 \ifthenelse{\equal{#2}{f}}%
9306 {%
9307 \protect\@numberstringF{#1}{\@fc@numstr}%
9308 }%
9309 {%
9310 \ifthenelse{\equal{#2}{n}}%
9311 {%
9312 \protect\@numberstringN{#1}{\@fc@numstr}%
9313 }%
9314 {%
9315 \ifthenelse{\equal{#2}{m}}%
9316 {}%
9317 {%
9318 \PackageError{fmtcount}%
9319 {Invalid gender option `#2'}%
9320 {Available options are m, f or n}%
9321 }%
9322 \protect\@numberstringM{#1}{\@fc@numstr}%
9323 }%
9324 }%
9325 \@fc@numstr
9326 }%
9327 }
9328 % \end{macrocode}
9329 %\end{macro}
9330 %\begin{macro}{\storeNumberstring}
9331 % Store textual representation of number. First argument is
9332 % identifying name, second argument is a counter.
9333 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9334 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9335 % longer \cs{protect} as \cs{storeNumberstringnum} is made
9336 % robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before
9337 % passing to \cs{storeNumberstringnum}}
9338 % \begin{macrocode}
9339 \newcommand*{\storeNumberstring}[2]{%
9340 {%
9341 \toks0{\storeNumberstringnum{#1}}%
9342 \expandafter
9343 }\the\toks0\expandafter{\the\value{#2}}%
9344 }
9345 % \end{macrocode}
9346 %\end{macro}
9347 %\begin{macro}{\storeNumberstringnum}
9348 % As above, but second argument is a count register or number.
9349 % \begin{macrocode}
9350 \newcommand{\storeNumberstringnum}[2]{%
9351 \@ifnextchar[%
9352 {\@store@Number@string{#1}{#2}}%
9353 {\@store@Number@string{#1}{#2}[m]}%
9354 }
9355 % \end{macrocode}
9356 %\end{macro}
9357 %\begin{macro}{\@store@Number@string}
9358 % Gender is specified as an optional argument \emph{at the end}:
9359 % \begin{macrocode}
9360 \def\@store@Number@string#1#2[#3]{%
9361 \ifthenelse{\equal{#3}{f}}%
9362 {%
9363 \protect\@NumberstringF{#2}{\@fc@numstr}%
9364 }%
9365 {%
9366 \ifthenelse{\equal{#3}{n}}%
9367 {%
9368 \protect\@NumberstringN{#2}{\@fc@numstr}%
9369 }%
9370 {%
9371 \ifthenelse{\equal{#3}{m}}%
9372 {}%
9373 {%
9374 \PackageError{fmtcount}%
9375 {Invalid gender option `#3'}%
9376 {Available options are m, f or n}%
9377 }%
9378 \protect\@NumberstringM{#2}{\@fc@numstr}%
9379 }%
9380 }%
9381 \expandafter\let\csname @fcs@#1\endcsname\@fc@numstr
9382 }
9383 % \end{macrocode}
9384 %\end{macro}
9385 %\begin{macro}{\Numberstring}
9386 % Display textual representation of number. The argument must be
9387 % a counter.
9388 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9389 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9390 % longer \cs{protect} as \cs{Numberstringnum} is made
9391 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9392 % passing to \cs{Numberstringnum}}
9393 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{Numberstringnum} is
9394 % supposed to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for
9395 % compatibily with \texttt{glossaries}.}
9396 % \begin{macrocode}
9397 \newcommand*{\Numberstring}[1]{%
9398 \Numberstringnum{\expandafter\expandafter\expandafter
9399 \the\value{#1}}%
9400 }
9401 % \end{macrocode}
9402 %\end{macro}
9403 %\begin{macro}{\Numberstringnum}
9404 % As above, but the argument is a count register or number.
9405 %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with
9406 %\cs{new@ifnextchar}}
9407 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
9408 % \begin{macrocode}
9409 \newrobustcmd*{\Numberstringnum}[1]{%
9410 \new@ifnextchar[%
9411 {\@Number@string{#1}}%
9412 {\@Number@string{#1}[m]}%
9413 }
9414 % \end{macrocode}
9415 %\end{macro}
9416 %\begin{macro}{\@Number@string}
9417 % Gender is specified as an optional argument at the end.
9418 % \begin{macrocode}
9419 \def\@Number@string#1[#2]{%
9420 {%
9421 \ifthenelse{\equal{#2}{f}}%
9422 {%
9423 \protect\@NumberstringF{#1}{\@fc@numstr}%
9424 }%
9425 {%
9426 \ifthenelse{\equal{#2}{n}}%
9427 {%
9428 \protect\@NumberstringN{#1}{\@fc@numstr}%
9429 }%
9430 {%
9431 \ifthenelse{\equal{#2}{m}}%
9432 {}%
9433 {%
9434 \PackageError{fmtcount}%
9435 {Invalid gender option `#2'}%
9436 {Available options are m, f or n}%
9437 }%
9438 \protect\@NumberstringM{#1}{\@fc@numstr}%
9439 }%
9440 }%
9441 \@fc@numstr
9442 }%
9443 }
9444 % \end{macrocode}
9445 %\end{macro}
9446 %\begin{macro}{\storeNUMBERstring}
9447 % Store upper case textual representation of number. The first
9448 % argument is identifying name, the second argument is a counter.
9449 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9450 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9451 % longer \cs{protect} as \cs{storeNUMBERstringnum} is made
9452 % robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before
9453 % passing to \cs{storeNUMBERstringnum}.}
9454 % \begin{macrocode}
9455 \newcommand{\storeNUMBERstring}[2]{%
9456 {%
9457 \toks0{\storeNUMBERstringnum{#1}}%
9458 \expandafter
9459 }\the\toks0\expandafter{\the\value{#2}}%
9460 }
9461 % \end{macrocode}
9462 %\end{macro}
9463 %\begin{macro}{\storeNUMBERstringnum}
9464 % As above, but the second argument is a count register or a
9465 % number.
9466 % \begin{macrocode}
9467 \newcommand{\storeNUMBERstringnum}[2]{%
9468 \@ifnextchar[%
9469 {\@store@NUMBER@string{#1}{#2}}%
9470 {\@store@NUMBER@string{#1}{#2}[m]}%
9471 }
9472 % \end{macrocode}
9473 %\end{macro}
9474 %\begin{macro}{\@store@NUMBER@string}
9475 % Gender is specified as an optional argument at the end.
9476 % \begin{macrocode}
9477 \def\@store@NUMBER@string#1#2[#3]{%
9478 \ifthenelse{\equal{#3}{f}}%
9479 {%
9480 \protect\@numberstringF{#2}{\@fc@numstr}%
9481 }%
9482 {%
9483 \ifthenelse{\equal{#3}{n}}%
9484 {%
9485 \protect\@numberstringN{#2}{\@fc@numstr}%
9486 }%
9487 {%
9488 \ifthenelse{\equal{#3}{m}}%
9489 {}%
9490 {%
9491 \PackageError{fmtcount}%
9492 {Invalid gender option `#3'}%
9493 {Available options are m or f}%
9494 }%
9495 \protect\@numberstringM{#2}{\@fc@numstr}%
9496 }%
9497 }%
9498 \expandafter\edef\csname @fcs@#1\endcsname{%
9499 \noexpand\MakeUppercase{\@fc@numstr}%
9500 }%
9501 }
9502 % \end{macrocode}
9503 %\end{macro}
9504 %\begin{macro}{\NUMBERstring}
9505 % Display upper case textual representation of a number. The
9506 % argument must be a counter.
9507 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9508 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9509 % longer \cs{protect} as \cs{NUMBERstringnum} is made
9510 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9511 % passing to \cs{NUMBERstringnum}.}
9512 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{NUMBERstringnum} is
9513 % supposed to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for
9514 % compatibily with \texttt{glossaries}.}
9515 % \begin{macrocode}
9516 \newcommand*{\NUMBERstring}[1]{%
9517 \NUMBERstringnum{\expandafter\expandafter\expandafter
9518 \the\value{#1}}%
9519 }
9520 % \end{macrocode}
9521 %\end{macro}
9522 %\begin{macro}{\NUMBERstringnum}
9523 % As above, but the argument is a count register or a number.
9524 %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with
9525 %\cs{new@ifnextchar}}
9526 %\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}}
9527 % \begin{macrocode}
9528 \newrobustcmd*{\NUMBERstringnum}[1]{%
9529 \new@ifnextchar[%
9530 {\@NUMBER@string{#1}}%
9531 {\@NUMBER@string{#1}[m]}%
9532 }
9533 % \end{macrocode}
9534 %\end{macro}
9535 %\begin{macro}{\@NUMBER@string}
9536 % Gender is specified as an optional argument at the end.
9537 % \begin{macrocode}
9538 \def\@NUMBER@string#1[#2]{%
9539 {%
9540 \ifthenelse{\equal{#2}{f}}%
9541 {%
9542 \protect\@numberstringF{#1}{\@fc@numstr}%
9543 }%
9544 {%
9545 \ifthenelse{\equal{#2}{n}}%
9546 {%
9547 \protect\@numberstringN{#1}{\@fc@numstr}%
9548 }%
9549 {%
9550 \ifthenelse{\equal{#2}{m}}%
9551 {}%
9552 {%
9553 \PackageError{fmtcount}%
9554 {Invalid gender option `#2'}%
9555 {Available options are m, f or n}%
9556 }%
9557 \protect\@numberstringM{#1}{\@fc@numstr}%
9558 }%
9559 }%
9560 \protect\MakeUppercase{\@fc@numstr}%
9561 }%
9562 }
9563 % \end{macrocode}
9564 %\end{macro}
9565 %\begin{macro}{\binary}
9566 % Number representations in other bases. Binary:
9567 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9568 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9569 % longer \cs{protect} as \cs{@binary} is made
9570 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9571 % passing to \cs{@binary}}
9572 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@binary} is supposed
9573 % to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for compatibily with
9574 % \texttt{glossaries}.}
9575 % \begin{macrocode}
9576 \providecommand*{\binary}[1]{%
9577 \@binary{\expandafter\expandafter\expandafter
9578 \the\value{#1}}%
9579 }
9580 % \end{macrocode}
9581 %\end{macro}
9582 %\begin{macro}{\aaalph}
9583 % Like \ics{alph}, but goes beyond 26.
9584 % (a \ldots\ z aa \ldots zz \ldots)
9585 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9586 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9587 % longer \cs{protect} as \cs{@aaalph} is made
9588 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9589 % passing to \cs{@aaalph}.}
9590 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@aaalph} is supposed
9591 % to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for compatibily with
9592 % \texttt{glossaries}.}
9593 % \begin{macrocode}
9594 \providecommand*{\aaalph}[1]{%
9595 \@aaalph{\expandafter\expandafter\expandafter
9596 \the\value{#1}}%
9597 }
9598 % \end{macrocode}
9599 %\end{macro}
9600 %\begin{macro}{\AAAlph}
9601 % As before, but upper case.
9602 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9603 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9604 % longer \cs{protect} as \cs{@AAAlph} is made
9605 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9606 % passing to \cs{@AAAlph}.}
9607 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@AAAlph} is supposed
9608 % to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for compatibily with
9609 % \texttt{glossaries}.}
9610 % \begin{macrocode}
9611 \providecommand*{\AAAlph}[1]{%
9612 \@AAAlph{\expandafter\expandafter\expandafter
9613 \the\value{#1}}%
9614 }
9615 % \end{macrocode}
9616 %\end{macro}
9617 %\begin{macro}{\abalph}
9618 % Like \ics{alph}, but goes beyond 26.
9619 % (a \ldots\ z ab \ldots az \ldots)
9620 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9621 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9622 % longer \cs{protect} as \cs{@abalph} is made
9623 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9624 % passing to \cs{@abalph}.}
9625 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@abalph} is supposed
9626 % to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for compatibily with
9627 % \texttt{glossaries}.}
9628 % \begin{macrocode}
9629 \providecommand*{\abalph}[1]{%
9630 \@abalph{\expandafter\expandafter\expandafter
9631 \the\value{#1}}%
9632 }
9633 % \end{macrocode}
9634 %\end{macro}
9635 %\begin{macro}{\ABAlph}
9636 % As above, but upper case.
9637 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9638 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9639 % longer \cs{protect} as \cs{@ABAlph} is made
9640 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9641 % passing to \cs{@ABAlph}.}
9642 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@ABAlph} is supposed
9643 % to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for compatibily with
9644 % \texttt{glossaries}.}
9645 % \begin{macrocode}
9646 \providecommand*{\ABAlph}[1]{%
9647 \@ABAlph{\expandafter\expandafter\expandafter
9648 \the\value{#1}}%
9649 }
9650 % \end{macrocode}
9651 %\end{macro}
9652 %\begin{macro}{\hexadecimal}
9653 % Hexadecimal:
9654 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9655 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9656 % longer \cs{protect} as \cs{@hexadecimal} is made
9657 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9658 % passing to \cs{@hexadecimal}.}
9659 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@hexadecimal} is
9660 % supposed to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for
9661 % compatibily with \texttt{glossaries}.}
9662 % \begin{macrocode}
9663 \providecommand*{\hexadecimal}[1]{%
9664 \hexadecimalnum{\expandafter\expandafter\expandafter
9665 \the\value{#1}}%
9666 }
9667 % \end{macrocode}
9668 %\end{macro}
9669 %\begin{macro}{\HEXADecimal}
9670 % As above, but in upper case.
9671 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9672 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9673 % longer \cs{protect} as \cs{@Hexadecimal} is made
9674 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9675 % passing to \cs{@Hexadecimal}.}
9676 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@Hexadecimal} is
9677 % supposed to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for
9678 % compatibily with \texttt{glossaries}.}
9679 % \begin{macrocode}
9680 \providecommand*{\HEXADecimal}[1]{%
9681 \HEXADecimalnum{\expandafter\expandafter\expandafter
9682 \the\value{#1}}%
9683 }
9684 \newrobustcmd*\FC@Hexadecimal@warning{%
9685 \PackageWarning{fmtcount}{\string\Hexadecimal\space is deprecated, use \string\HEXADecimal\space
9686 instead. The \string\Hexadecimal\space control sequence name is confusing as it can mislead in thinking
9687 that only the 1st letter is upper-cased.}%
9688 }
9689 \def\Hexadecimal{%
9690 \FC@Hexadecimal@warning
9691 \HEXADecimal}
9692 % \end{macrocode}
9693 %\end{macro}
9694 %\begin{macro}{\octal}
9695 % Octal:
9696 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9697 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9698 % longer \cs{protect} as \cs{@octal} is made
9699 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9700 % passing to \cs{@octal}}
9701 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@octal} is supposed
9702 % to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for compatibily with
9703 % \texttt{glossaries}.}
9704 % \begin{macrocode}
9705 \providecommand*{\octal}[1]{%
9706 \@octal{\expandafter\expandafter\expandafter
9707 \the\value{#1}}%
9708 }
9709 % \end{macrocode}
9710 %\end{macro}
9711 %\begin{macro}{\decimal}
9712 % Decimal:
9713 % \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and
9714 % and use \cs{value} instead tweaking with \cs{csname}. Do not use any
9715 % longer \cs{protect} as \cs{@decimal} is made
9716 % robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before
9717 % passing to \cs{@decimal}}
9718 % \changes{3.03}{2017/09/14}{Suppress leading \cs{expandafter}'s, they are useless as \cs{@decimal} is supposed
9719 % to fully expand its argument, and place 3 \cs{expandafter}'s before \cs{the}\cs{value} for compatibily with
9720 % \texttt{glossaries}.}
9721 % \begin{macrocode}
9722 \providecommand*{\decimal}[1]{%
9723 \@decimal{\expandafter\expandafter\expandafter
9724 \the\value{#1}}%
9725 }
9726 % \end{macrocode}
9727 %\end{macro}
9728 %
9729 %\subsubsection{Multilinguage Definitions}
9730 % Flag \cs{fc@languagemode@detected} allows to stop scanning for multilingual mode trigger conditions. It is
9731 % initialized to \texttt{false} as no such scanning as taken place yet.
9732 %\changes{3.05}{2017/12/22}{New flag \cs{iffc@languagemode@detected}.}
9733 % \begin{macrocode}
9734 \newif\iffc@languagemode@detected
9735 \fc@languagemode@detectedfalse
9736 % \end{macrocode}
9737 %\begin{macro}{\@setdef@ultfmtcount}
9738 % If multilingual support is provided, make \cs{@numberstring}
9739 % etc use the correct language (if defined).
9740 % Otherwise use English definitions. \cs{@setdef@ultfmtcount}
9741 % sets the macros to use English.
9742 %\changes{3.05}{2017/12/22}{Set flag \cs{iffc@languagemode@detected}.}
9743 % \begin{macrocode}
9744 \def\@setdef@ultfmtcount{%
9745 \fc@languagemode@detectedtrue
9746 \ifcsundef{@ordinalMenglish}{\FCloadlang{english}}{}%
9747 \def\@ordinalstringM{\@ordinalstringMenglish}%
9748 \let\@ordinalstringF=\@ordinalstringMenglish
9749 \let\@ordinalstringN=\@ordinalstringMenglish
9750 \def\@OrdinalstringM{\@OrdinalstringMenglish}%
9751 \let\@OrdinalstringF=\@OrdinalstringMenglish
9752 \let\@OrdinalstringN=\@OrdinalstringMenglish
9753 \def\@numberstringM{\@numberstringMenglish}%
9754 \let\@numberstringF=\@numberstringMenglish
9755 \let\@numberstringN=\@numberstringMenglish
9756 \def\@NumberstringM{\@NumberstringMenglish}%
9757 \let\@NumberstringF=\@NumberstringMenglish
9758 \let\@NumberstringN=\@NumberstringMenglish
9759 \def\@ordinalM{\@ordinalMenglish}%
9760 \let\@ordinalF=\@ordinalM
9761 \let\@ordinalN=\@ordinalM
9762 \let\fmtord\fc@orddef@ult
9763 }
9764 % \end{macrocode}
9765 %\end{macro}
9766 %
9767 %\begin{macro}{\fc@multiling}
9768 %\changes{2.02}{2012/10/03}{new}
9769 %\cs{fc@multiling}\marg{name}\marg{gender}
9770 %\changes{3.00}{2014/07/03}{Use \cs{protect}, not \cs{string} in \cs{PackageWarning} to quote macros like
9771 % shown in \texttt{clsguide.pdf}}
9772 % \begin{macrocode}
9773 \newcommand*{\fc@multiling}[2]{%
9774 \ifcsundef{@#1#2\languagename}%
9775 {% try loading it
9776 \FCloadlang{\languagename}%
9777 }%
9778 {%
9779 }%
9780 \ifcsundef{@#1#2\languagename}%
9781 {%
9782 \PackageWarning{fmtcount}%
9783 {No support for \expandafter\protect\csname #1\endcsname\space for
9784 language '\languagename'}%
9785 \ifthenelse{\equal{\languagename}{\fc@mainlang}}%
9786 {%
9787 \FCloadlang{english}%
9788 }%
9789 {%
9790 }%
9791 \ifcsdef{@#1#2\fc@mainlang}%
9792 {%
9793 \csuse{@#1#2\fc@mainlang}%
9794 }%
9795 {%
9796 \PackageWarningNoLine{fmtcount}%
9797 {No languages loaded at all! Loading english definitions}%
9798 \FCloadlang{english}%
9799 \def\fc@mainlang{english}%
9800 \csuse{@#1#2english}%
9801 }%
9802 }%
9803 {%
9804 \csuse{@#1#2\languagename}%
9805 }%
9806 }
9807 % \end{macrocode}
9808 %\end{macro}
9809 %\begin{macro}{\@set@mulitling@fmtcount}
9810 % This defines the number and ordinal string macros to use
9811 % \cs{languagename}:
9812 %\changes{2.0}{2012/06/03}{changed errors to warnings for
9813 %unsupported languages}
9814 %\changes{3.05}{2017/12/22}{Set flag \cs{iffc@languagemode@detected}.}
9815 % \begin{macrocode}
9816 \def\@set@mulitling@fmtcount{%
9817 \fc@languagemode@detectedtrue
9818 % \end{macrocode}
9819 % The masculine version of \cs{numberstring}:
9820 % \begin{macrocode}
9821 \def\@numberstringM{%
9822 \fc@multiling{numberstring}{M}%
9823 }%
9824 % \end{macrocode}
9825 % The feminine version of \cs{numberstring}:
9826 % \begin{macrocode}
9827 \def\@numberstringF{%
9828 \fc@multiling{numberstring}{F}%
9829 }%
9830 % \end{macrocode}
9831 % The neuter version of \cs{numberstring}:
9832 % \begin{macrocode}
9833 \def\@numberstringN{%
9834 \fc@multiling{numberstring}{N}%
9835 }%
9836 % \end{macrocode}
9837 % The masculine version of \cs{Numberstring}:
9838 % \begin{macrocode}
9839 \def\@NumberstringM{%
9840 \fc@multiling{Numberstring}{M}%
9841 }%
9842 % \end{macrocode}
9843 % The feminine version of \cs{Numberstring}:
9844 % \begin{macrocode}
9845 \def\@NumberstringF{%
9846 \fc@multiling{Numberstring}{F}%
9847 }%
9848 % \end{macrocode}
9849 % The neuter version of \cs{Numberstring}:
9850 % \begin{macrocode}
9851 \def\@NumberstringN{%
9852 \fc@multiling{Numberstring}{N}%
9853 }%
9854 % \end{macrocode}
9855 % The masculine version of \cs{ordinal}:
9856 % \begin{macrocode}
9857 \def\@ordinalM{%
9858 \fc@multiling{ordinal}{M}%
9859 }%
9860 % \end{macrocode}
9861 % The feminine version of \cs{ordinal}:
9862 % \begin{macrocode}
9863 \def\@ordinalF{%
9864 \fc@multiling{ordinal}{F}%
9865 }%
9866 % \end{macrocode}
9867 % The neuter version of \cs{ordinal}:
9868 % \begin{macrocode}
9869 \def\@ordinalN{%
9870 \fc@multiling{ordinal}{N}%
9871 }%
9872 % \end{macrocode}
9873 % The masculine version of \cs{ordinalstring}:
9874 % \begin{macrocode}
9875 \def\@ordinalstringM{%
9876 \fc@multiling{ordinalstring}{M}%
9877 }%
9878 % \end{macrocode}
9879 % The feminine version of \cs{ordinalstring}:
9880 % \begin{macrocode}
9881 \def\@ordinalstringF{%
9882 \fc@multiling{ordinalstring}{F}%
9883 }%
9884 % \end{macrocode}
9885 % The neuter version of \cs{ordinalstring}:
9886 % \begin{macrocode}
9887 \def\@ordinalstringN{%
9888 \fc@multiling{ordinalstring}{N}%
9889 }%
9890 % \end{macrocode}
9891 % The masculine version of \cs{Ordinalstring}:
9892 % \begin{macrocode}
9893 \def\@OrdinalstringM{%
9894 \fc@multiling{Ordinalstring}{M}%
9895 }%
9896 % \end{macrocode}
9897 % The feminine version of \cs{Ordinalstring}:
9898 % \begin{macrocode}
9899 \def\@OrdinalstringF{%
9900 \fc@multiling{Ordinalstring}{F}%
9901 }%
9902 % \end{macrocode}
9903 % The neuter version of \cs{Ordinalstring}:
9904 % \begin{macrocode}
9905 \def\@OrdinalstringN{%
9906 \fc@multiling{Ordinalstring}{N}%
9907 }%
9908 % \end{macrocode}
9909 % Make \cs{fmtord} language dependent:
9910 % \changes{3.01}{2014/12/03}{Make \cs{fmtord} language dependent.}
9911 % \begin{macrocode}
9912 \let\fmtord\fc@ord@multiling
9913 }
9914 % \end{macrocode}
9915 %\end{macro}
9916 %\changes{3.05}{2017/12/22}{Change all the code about detecting multiling. \cs{ifxetex} is no longer used,
9917 % instead we loop on the list of packages of interest \styfmt{babel}, \styfmt{polyglossia}, \styfmt{mlp}, or
9918 % \styfmt{ngerman}, and set or not \cs{iffc@languagemode@detected} flag as a result.}
9919 % Check to see if \styfmt{babel}, \styfmt{polyglossia}, \styfmt{mlp}, or \styfmt{ngerman} packages have been
9920 % loaded, and if yes set \styfmt{fmtcount} in multiling. First we define some \cs{fc@check@for@multiling}
9921 % macro to do such action where \texttt{\#1} is the package name, and \texttt{\#2} is a callback.
9922 % \begin{macrocode}
9923 \def\fc@check@for@multiling#1:#2\@nil{%
9924 \@ifpackageloaded{#1}{%
9925 #2\@set@mulitling@fmtcount
9926 }{}%
9927 }
9928 % \end{macrocode}
9929 % Now we define \cs{fc@loop@on@multiling@pkg} as an iterator to scan whether any of \styfmt{babel},
9930 % \styfmt{polyglossia}, \styfmt{mlp}, or \styfmt{ngerman} packages has been loaded, and if so set multilingual
9931 % mode.
9932 % \begin{macrocode}
9933 \def\fc@loop@on@multiling@pkg#1,{%
9934 \def\@tempb{#1}%
9935 \ifx\@tempb\@nnil
9936 % \end{macrocode}
9937 % We have reached the end of the loop, so stop here.
9938 % \begin{macrocode}
9939 \let\fc@loop@on@multiling@pkg\@empty
9940 \else
9941 % \end{macrocode}
9942 % Make the \cs{@ifpackageloaded} test and break the loop if it was positive.
9943 % \begin{macrocode}
9944 \fc@check@for@multiling#1\@nil
9945 \iffc@languagemode@detected
9946 \def\fc@loop@on@multiling@pkg##1\@nil,{}%
9947 \fi
9948 \fi
9949 \fc@loop@on@multiling@pkg
9950 }
9951 % \end{macrocode}
9952 % Now, do the loop itself, we do this at beginning of document not to constrain the order of loading
9953 % \styfmt{fmtcount} and the multilingual package \styfmt{babel}, \styfmt{polyglossia}, etc.:
9954 % \begin{macrocode}
9955 \AtBeginDocument{%
9956 \fc@loop@on@multiling@pkg babel:,polyglossia:,ngerman:\FCloadlang{ngerman},\@nil,
9957 % \end{macrocode}
9958 % In the case that no multilingual package (such as
9959 % \styfmt{babel}/\styfmt{polyglossia}/\styfmt{ngerman}) has been loaded, then we go to multiling
9960 % if a language has been loaded by package option.
9961 % \begin{macrocode}
9962 \unless\iffc@languagemode@detected\iffmtcount@language@option
9963 % \end{macrocode}
9964 % If the multilingual mode has not been yet activated, but a language option has been passed to
9965 % \styfmt{fmtcount}, we should go to multilingual mode. However, first of, we do some sanity check, as this
9966 % may help the end user understand what is wrong: we check that macro \cs{languagename} is defined, and
9967 % activate the multilingual mode only then, and otherwise fall back to default legacy mode.
9968 % \begin{macrocode}
9969 \ifcsundef{languagename}%
9970 {%
9971 \PackageWarning{fmtcount}{%
9972 `\protect\languagename' is undefined, you should use a language package such as babel/polyglossia
9973 when loading a language via package option. Reverting to default language.
9974 }%
9975 \@setdef@ultfmtcount
9976 }{%
9977 \@set@mulitling@fmtcount
9978
9979 % \end{macrocode}
9980 % Now, some more checking, having activated multilingual mode after a language option has been passed to
9981 % \styfmt{fmtcount}, we check that the \styfmt{fmtcount} language definitions corresponding to
9982 % \cs{languagename} have been loaded, and otherwise fall \cs{languagename} back to the latest
9983 % \styfmt{fmtcount} language definition loaded.
9984 % \begin{macrocode}
9985 \@FC@iflangloaded{\languagename}{}{%
9986 % \end{macrocode}
9987 % The current \cs{languagename} is not a \styfmt{fmtcount} language that has been previously loaded. The
9988 % correction is to have \cs{languagename} let to \cs{fc@mainlang}. Please note that, as
9989 % \cs{iffmtcount@language@option} is true, we know that \texttt{fmtcount} has loaded some language.
9990 % \begin{macrocode}
9991 \PackageWarning{fmtcount}{%
9992 Setting `\protect\languagename' to `\fc@mainlang'.\MessageBreak
9993 Reason is that `\protect\languagename' was `\languagename',\MessageBreak
9994 but `\languagename' was not loaded by fmtcount,\MessageBreak
9995 whereas `\fc@mainlang' was the last language loaded by fmtcount ;
9996 }%
9997 \let\languagename\fc@mainlang
9998 }%
9999 }%
10000 \else
10001 \@setdef@ultfmtcount
10002 \fi\fi
10003 % \end{macrocode}
10004 % \changes{3.01}{2014/12/03}{Substitute \cs{textsuperscript} for \cs{fc@textsuperscript}, and define
10005 % \cs{fc@textsuperscript} as \cs{fup} when defined at beginning of document, or as \cs{textsuperscript}
10006 % otherwise}
10007 % \begin{macrocode}
10008 \ifcsundef{FBsupR}{\let\fc@textsuperscript\textsuperscript}{\let\fc@textsuperscript\fup}%
10009 }
10010 % \end{macrocode}
10011 % Backwards compatibility:
10012 % \begin{macrocode}
10013 \let\@ordinal=\@ordinalM
10014 \let\@ordinalstring=\@ordinalstringM
10015 \let\@Ordinalstring=\@OrdinalstringM
10016 \let\@numberstring=\@numberstringM
10017 \let\@Numberstring=\@NumberstringM
10018 % \end{macrocode}
10019 % \setcounter{CodelineNo}{0}
10020 %\iffalse
10021 % \begin{macrocode}
10022 %</fmtcount.sty>
10023 % \end{macrocode}
10024 %\fi
10025 %\Finale
10026 \endinput