diff options
author | Karl Berry <karl@freefriends.org> | 2007-08-24 18:37:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-08-24 18:37:22 +0000 |
commit | b7edbe05e19bc98b914e35d67cc6ac17c6490bbd (patch) | |
tree | 7b6f70ae65702966157e4e57febe77f3d87bef69 /Master | |
parent | c97f5f7b9e9ce228ddb7f2895fdb6019f2a71753 (diff) |
fmtcount 1.3 (21aug07)
git-svn-id: svn://tug.org/texlive/trunk@4800 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
18 files changed, 11190 insertions, 1118 deletions
diff --git a/Master/texmf-dist/doc/latex/fmtcount/README b/Master/texmf-dist/doc/latex/fmtcount/README index f6d1dbb18cd..9efe57f814a 100644 --- a/Master/texmf-dist/doc/latex/fmtcount/README +++ b/Master/texmf-dist/doc/latex/fmtcount/README @@ -1,6 +1,6 @@ -LaTeX Package : fmtcount v 1.1 +LaTeX Package : fmtcount v 1.3 -Last Modified : 14 June 2007 +Last Modified : 20 Aug 2007 Author : Nicola Talbot diff --git a/Master/texmf-dist/doc/latex/fmtcount/doc/CHANGES b/Master/texmf-dist/doc/latex/fmtcount/doc/CHANGES index 6b302dcb615..ea92a56993a 100644 --- a/Master/texmf-dist/doc/latex/fmtcount/doc/CHANGES +++ b/Master/texmf-dist/doc/latex/fmtcount/doc/CHANGES @@ -1,5 +1,16 @@ fmtcount package versions: +Version 1.3: + + * no longer loads xspace package (was causing extraneous + spaces when the optional argument to \ordinalstring etc + was omitted.) + * Made some long commands short. + * Changes licence text in fmtcount.ins to conform with LPPL. + +Version 1.2: fmtcount now loads xspace package, and uses \xspace +after \numberstring etc. + Version 1.1: Added German support. Added check for USenglish and UKenglish babel settings. diff --git a/Master/texmf-dist/doc/latex/fmtcount/doc/fmtcount-manual.html b/Master/texmf-dist/doc/latex/fmtcount/doc/fmtcount-manual.html new file mode 100644 index 00000000000..2d7fd1c0d6e --- /dev/null +++ b/Master/texmf-dist/doc/latex/fmtcount/doc/fmtcount-manual.html @@ -0,0 +1,700 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> + +<!--Converted with LaTeX2HTML 2002 (1.67) +original version by: Nikos Drakos, CBLU, University of Leeds +* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan +* with significant contributions from: + Jens Lippmann, Marek Rouchal, Martin Wilck and others --> +<HTML> +<HEAD> +<TITLE>fmtcount.sty v1.3: Displaying the Values of LaTeX Counters</TITLE> +<META NAME="description" CONTENT="fmtcount.sty v1.3: Displaying the Values of LaTeX Counters"> +<META NAME="keywords" CONTENT="manual"> +<META NAME="resource-type" CONTENT="document"> +<META NAME="distribution" CONTENT="global"> + +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> +<META NAME="Generator" CONTENT="LaTeX2HTML v2002"> +<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> + + +</HEAD> + +<BODY > + +<P> + + <H1 ALIGN="CENTER">fmtcount.sty v1.3: Displaying the Values of +LaTeX Counters</H1> +<P ALIGN="CENTER"><STRONG>Nicola L.C. Talbot +<BR> +<BR> +School of Computing Sciences +<BR> +University of East Anglia +<BR> +Norwich. NR4 7TJ. +<BR> +United Kingdom. +<BR> <TT><A NAME="tex2html1" + HREF="http://theoval.cmp.uea.ac.uk/~nlct/">http://theoval.cmp.uea.ac.uk/~nlct/</A></TT></STRONG></P> +<P ALIGN="CENTER"><STRONG>20 Aug 2007</STRONG></P> + <BR> + +<H2><A NAME="SECTION00010000000000000000"> +Contents</A> +</H2> +<!--Table of Contents--> + +<UL> +<LI><A NAME="tex2html16" + HREF="manual.html#SECTION00020000000000000000">Introduction</A> +<LI><A NAME="tex2html17" + HREF="manual.html#SECTION00030000000000000000">Installation</A> +<LI><A NAME="tex2html18" + HREF="manual.html#SECTION00040000000000000000">Available Commands</A> +<LI><A NAME="tex2html19" + HREF="manual.html#SECTION00050000000000000000">Package Options</A> +<LI><A NAME="tex2html20" + HREF="manual.html#SECTION00060000000000000000">Multilingual Support</A> +<LI><A NAME="tex2html21" + HREF="manual.html#SECTION00070000000000000000">Configuration File fmtcount.cfg</A> +<LI><A NAME="tex2html22" + HREF="manual.html#SECTION00080000000000000000">LaTeX2HTML style</A> +<LI><A NAME="tex2html23" + HREF="manual.html#SECTION00090000000000000000">Acknowledgements</A> +<LI><A NAME="tex2html24" + HREF="manual.html#SECTION000100000000000000000">Troubleshooting</A> +</UL> +<!--End of Table of Contents--> +<H1><A NAME="SECTION00020000000000000000"> +Introduction</A> +</H1> +The <TT>fmtcount</TT> package provides commands to display +the values of LaTeX counters in a variety of formats. It also +provides equivalent commands for actual numbers rather than +counter names. Limited multilingual support is available. +Currently, there is only support for English, French (including +Belgian and Swiss variations), Spanish, Portuguese and German. + +<P> + +<H1><A NAME="SECTION00030000000000000000"> +Installation</A> +</H1> + +<P> +This package is distributed with the files <TT>fmtcount.dtx</TT> +and <TT>fmtcount.ins</TT>. To extract the code do: +<PRE> +latex fmtcount.ins +</PRE> +This will create the files <TT>fmtcount.sty</TT> and +<TT>fmtcount.perl</TT>, along with several <TT>.def</TT> files. +Place <TT>fmtcount.sty</TT> and the <TT>.def</TT> files somewhere +where LaTeX will find them (e.g. +<TT>texmf/tex/latex/fmtcount/</TT>) and place <TT>fmtcount.perl</TT> +somewhere where LaTeX2HTML +will find it (e.g. <TT>latex2html/styles</TT>). Remember to refresh +the TeX database (using <TT>texhash</TT> or <TT>mktexlsr</TT> +under Linux, for +other operating systems check the manual.) + +<P> + +<H1><A NAME="SECTION00040000000000000000"> +Available Commands</A> +</H1> + +<P> +The commands can be divided into two categories: those that +take the name of a counter as the argument, and those +that take a number as the argument. + +<P> + +<P> +<TT>\ordinal{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +This will print the value of a LaTeX counter <I>counter</I> as an +ordinal, where the macro + +<P> +<TT>\fmtord{</TT><EM>text</EM><TT>}</TT> +<P> +is used to format the st, nd, rd, th bit. By default the ordinal is +formatted as a superscript, if the package option <TT>level</TT> is +used, it is level with the text. For example, if the current section +is 3, then <code>\ordinal{section}</code> will produce the output: +3<SUP>rd</SUP>. Note that the optional argument <I>gender</I> +occurs <I>at the end</I>. This argument may only take one of +the following values: <TT>m</TT> (masculine), <TT>f</TT> +(feminine) or <TT>n</TT> (neuter.) If <I>gender</I> is omitted, +or if the given gender has no meaning in the current language, +<TT>m</TT> is assumed. + +<P> +<B>Notes:</B> + +<OL> +<LI>the <TT>memoir</TT> class also defines a command called +<TT>\ordinal</TT> which takes a number as an argument instead of a +counter. In order to overcome this incompatiblity, if you want +to use the <TT>fmtcount</TT> package with the <TT>memoir</TT> class +you should use <TT>\FCordinal</TT> to access +<TT>fmtcount</TT>'s version of <TT>\ordinal</TT>, and use +<TT>\ordinal</TT> to use <TT>memoir</TT>'s version of that command. + +<P> +</LI> +<LI>As with all commands which have an optional argument as the +last argument, if the optional argument is omitted, any spaces +following the final argument will be ignored. Whereas, if the +optional argument is present, any spaces following the optional +argument won't be ignored. so <code>\ordinal{section} !</code> +will produce: 3<SUP>rd</SUP>! whereas + <code>\ordinal{section}[m] !</code> will produce: +3<SUP>rd</SUP> ! +</LI> +</OL> + +<P> + +<P> +<TT>\ordinalnum{</TT><EM>n</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +This is like <TT>\ordinal</TT> but takes an actual number rather than a +counter as the argument. For example: <code>\ordinalnum{3}</code> will +produce: 3<SUP>rd</SUP>. + +<P> + +<P> +<TT>\numberstring{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +This will print the value of <I>counter</I> as text. E.g. <code>\numberstring{section}</code> will produce: three. The optional +argument is the same as that for <TT>\ordinal</TT>. + +<P> + +<P> +<TT>\Numberstring{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +This does the same as <TT>\numberstring</TT>, but with initial letters in +uppercase. For example, <code>\Numberstring{section}</code> will produce: +Three. + +<P> + +<P> +<TT>\NUMBERstring{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +This does the same as <TT>\numberstring</TT>, but converts the string to +upper case. Note that +<code>\MakeUppercase{\NUMBERstring{</code><I>counter</I><code>}}</code> doesn't +work, due to the way that <TT>\MakeUppercase</TT> expands its +argument<A NAME="tex2html2" + HREF="#foot515"><SUP>1</SUP></A>. + +<P> + +<P> +<TT>\numberstringnum{</TT><EM>n</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\Numberstringnum{</TT><EM>n</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\NUMBERstringnum{</TT><EM>n</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +Theses macros work like +<TT>\numberstring</TT>, <TT>\Numberstring</TT> and <TT>\NUMBERstring</TT>, +respectively, but take an actual number +rather than a counter as the argument. For example: +<code>\Numberstringnum{105}</code> will produce: One Hundred and Five. + +<P> + +<P> +<TT>\ordinalstring{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +This will print the value of <I>counter</I> as a textual ordinal. +E.g. <code>\ordinalstring{section}</code> will produce: third. The +optional argument is the same as that for <TT>\ordinal</TT>. + +<P> + +<P> +<TT>\Ordinalstring{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +This does the same as <TT>\ordinalstring</TT>, but with initial letters in +uppercase. For example, <code>\Ordinalstring{section}</code> will produce: +Third. + +<P> + +<P> +<TT>\ORDINALstring{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +This does the same as <TT>\ordinalstring</TT>, but with all words in upper +case (see previous note about <TT>\MakeUppercase</TT>). + +<P> + +<P> +<TT>\ordinalstringnum{</TT><EM>n</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\Ordinalstringnum{</TT><EM>n</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\ORDINALstringnum{</TT><EM>n</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> +These macros work like <TT>\ordinalstring</TT>, <TT>\Ordinalstring</TT> and +<TT>\ORDINALstring</TT>, respectively, but take an actual number rather +than a counter as the argument. For example, +<code>\ordinalstringnum{3}</code> will produce: third. + +<P> +As from version 1.09, textual representations can be stored for +later use. This overcomes the problems encountered when you +attempt to use one of the above commands in <TT>\edef</TT>. + +<P> +Each of the following commands takes a label as the first argument, +the other arguments are as the analogous commands above. These +commands do not display anything, but store the textual +representation. This can later be retrieved using + +<P> +<TT>\FMCuse{</TT><EM>label</EM><TT>}</TT> +<P> +Note: with <TT>\storeordinal</TT> and <TT>\storeordinalnum</TT>, the +only bit that doesn't get expanded is <TT>\fmtord</TT>. So, for +example, <code>\storeordinalnum{mylabel}{3}</code> will be stored as +<code>3\relax \fmtord{rd}</code>. + +<P> + +<P> +<TT>\storeordinal{</TT><EM>label</EM><TT>}{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeordinalstring{</TT><EM>label</EM><TT>}{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeOrdinalstring{</TT><EM>label</EM><TT>}{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> + +<P> +<TT>\storeORDINALstring{</TT><EM>label</EM><TT>}{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storenumberstring{</TT><EM>label</EM><TT>}{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeNumberstring{</TT><EM>label</EM><TT>}{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeNUMBERstring{</TT><EM>label</EM><TT>}{</TT><EM>counter</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeordinalnum{</TT><EM>label</EM><TT>}{</TT><EM>number</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeordinalstring{</TT><EM>label</EM><TT>}{</TT><EM>number</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeOrdinalstringnum{</TT><EM>label</EM><TT>}{</TT><EM>number</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeORDINALstringnum{</TT><EM>label</EM><TT>}{</TT><EM>number</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storenumberstring{</TT><EM>label</EM><TT>}{</TT><EM>number</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeNumberstring{</TT><EM>label</EM><TT>}{</TT><EM>number</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> +<TT>\storeNUMBERstring{</TT><EM>label</EM><TT>}{</TT><EM>number</EM><TT>}[</TT><EM>gender</EM><TT>]</TT> +<P> + +<P> + +<P> +<TT>\binary{</TT><EM>counter</EM><TT>}</TT> +<P> +This will print the +value of <I>counter</I> as a binary number. +E.g. <code>\binary{section}</code> will produce: 11. The declaration + +<P> +<TT>\padzeroes[</TT><EM>n</EM><TT>]</TT> +<P> +will ensure numbers are written to <I>n</I> digits, padding with +zeroes if necessary. E.g. <code>\padzeroes[8]\binary{section}</code> +will produce: 00000011. The default value for <I>n</I> is 17. + +<P> + +<P> +<TT>\binary{</TT><EM>n</EM><TT>}</TT> +<P> +This is like <TT>\binary</TT> but takes an actual number rather than a +counter as the argument. For example: <code>\binarynum{5}</code> will +produce: 101. + +<P> + +<P> +<TT>\octal{</TT><EM>counter</EM><TT>}</TT> +<P> +This will print the value of <I>counter</I> as an octal number. For +example, if you have a counter called, say <TT>mycounter</TT>, and +you set the value to 125, then <code>\octal{mycounter}</code> will produce: +177. Again, the number will be padded with zeroes if necessary, +depending on whether <TT>\padzeroes</TT> has been used. + +<P> + +<P> +<TT>\octalnum{</TT><EM>n</EM><TT>}</TT> +<P> +This is like <TT>\octal</TT> but takes an actual number rather than a +counter as the argument. For example: <code>\octalnum{125}</code> will +produce: 177. + +<P> + +<P> +<TT>\hexadecimal{</TT><EM>counter</EM><TT>}</TT> +<P> +This will print the value of <I>counter</I> as a hexadecimal number. +Going back to the counter used in the previous example, +<code>\hexadecimal{mycounter}</code> will produce: 7d. Again, the number +will be padded with zeroes if necessary, depending on whether +<TT>\padzeroes</TT> has been used. + +<P> + +<P> +<TT>\Hexadecimal{</TT><EM>counter</EM><TT>}</TT> +<P> +This does the same thing, but uses uppercase characters, e.g. <code>\Hexadecimal{mycounter}</code> will produce: 7D. + +<P> + +<P> +<TT>\hexadecimalnum{</TT><EM>n</EM><TT>}</TT> +<P> + +<P> +<TT>\Hexadecimalnum{</TT><EM>n</EM><TT>}</TT> +<P> +These are like <TT>\hexadecimal</TT> and <TT>\Hexadecimal</TT> +but take an actual number rather than a counter as the +argument. For example: <code>\hexadecimalnum{125}</code> will +produce: 7d, and <code>\Hexadecimalnum{125}</code> will +produce: 7D. + +<P> + +<P> +<TT>\decimal{</TT><EM>counter</EM><TT>}</TT> +<P> +This is similar to <TT>\arabic</TT> but the number can be padded with +zeroes depending on whether <TT>\padzeroes</TT> has been used. For +example: <code>\padzeroes[8]\decimal{section}</code> will produce: +00000005. + +<P> + +<P> +<TT>\decimalnum{</TT><EM>n</EM><TT>}</TT> +<P> +This is like <TT>\decimal</TT> but takes an actual number rather than a +counter as the argument. For example: +<code>\padzeroes[8]\decimalnum{5}</code> will produce: 00000005. + +<P> + +<P> +<TT>\aaalph{</TT><EM>counter</EM><TT>}</TT> +<P> +This will print the value of <I>counter</I> as: a b ... z aa bb +... zz etc. For example, <code>\aaalpha{mycounter}</code> will +produce: uuuuu if <TT>mycounter</TT> is set to 125. + +<P> + +<P> +<TT>\AAAlph{</TT><EM>counter</EM><TT>}</TT> +<P> +This does the same thing, but uses uppercase characters, e.g. <code>\AAAlph{mycounter}</code> will produce: UUUUU. + +<P> + +<P> +<TT>\aaalphnum{</TT><EM>n</EM><TT>}</TT> +<P> + +<P> +<TT>\AAAlphnum{</TT><EM>n</EM><TT>}</TT> +<P> +These macros are like <TT>\aaalph</TT> and <TT>\AAAlph</TT> +but take an actual number rather than a counter as the +argument. For example: <code>\aaalphnum{125}</code> will +produce: uuuuu, and <code>\AAAlphnum{125}</code> will +produce: UUUUU. + +<P> + +<P> +<TT>\abalph{</TT><EM>counter</EM><TT>}</TT> +<P> +This will print the value of <I>counter</I> as: a b ... z aa ab +... az etc. For example, <code>\abalpha{mycounter}</code> will +produce: du if <TT>mycounter</TT> is set to 125. + +<P> + +<P> +<TT>\ABAlph{</TT><EM>counter</EM><TT>}</TT> +<P> +This does the same thing, but uses uppercase characters, e.g. <code>\ABAlph{mycounter}</code> will produce: DU. + +<P> + +<P> +<TT>\abalphnum{</TT><EM>n</EM><TT>}</TT> +<P> + +<P> +<TT>\ABAlphnum{</TT><EM>n</EM><TT>}</TT> +<P> +These macros are like <TT>\abalph</TT> and <TT>\ABAlph</TT> +but take an actual number rather than a counter as the +argument. For example: <code>\abalphnum{125}</code> will +produce: du, and <code>\ABAlphnum{125}</code> will +produce: DU. + +<P> + +<H1><A NAME="SECTION00050000000000000000"> +Package Options</A> +</H1> + +<P> +The following options can be passed to this package: + +<P> +<TABLE CELLPADDING=3> +<TR><TD ALIGN="LEFT">raise</TD> +<TD ALIGN="LEFT">make ordinal st,nd,rd,th appear as superscript</TD> +</TR> +<TR><TD ALIGN="LEFT">level</TD> +<TD ALIGN="LEFT">make ordinal st,nd,rd,th appear level with rest of +text</TD> +</TR> +</TABLE> + +<P> +These can also be set using the command: + +<P> + +<P> +<TT>\fmtcountsetoptions</TT><code>{fmtord=</code><I>type</I><code>}</code> +<P> +where <I>type</I> is either <TT>level</TT> or +<TT>raise</TT>. + +<P> + +<H1><A NAME="SECTION00060000000000000000"> +Multilingual Support</A> +</H1> + +<P> +Version 1.02 of the <TT>fmtcount</TT> package now has +limited multilingual support. The following languages are +implemented: English, Spanish, Portuguese, French, French (Swiss) +and French (Belgian). German support was added in version +1.1<A NAME="tex2html3" + HREF="#foot461"><SUP>2</SUP></A>. + +<P> +The package checks to see if the command <TT>\l@</TT><I>language</I> is +defined<A NAME="tex2html4" + HREF="#foot516"><SUP>3</SUP></A>, +and will load the code for those languages. The commands +<TT>\ordinal</TT>, <TT>\ordinalstring</TT> and <TT>\numberstring</TT> (and their +variants) will then be formatted in the currently selected language. + +<P> +If the French language is selected, the French (France) version +will be used by default (e.g. soxiante-dix for 70). To +select the Swiss or Belgian variants (e.g. septente for 70) use: +<code>\fmtcountsetoptions{french=</code><I>dialect</I><code>}</code> +where <I>dialect</I> is either <TT>swiss</TT> or <TT>belgian</TT>. +You can also use this command to change the action of +<TT>\ordinal</TT>. +<code>\fmtcountsetoptions{abbrv=true}</code> to produce ordinals +of the form 2<SUP>e</SUP> or +<code>\fmtcountsetoptions{abbrv=false}</code> to produce ordinals +of the form 2<SUP>eme</SUP> (default). + +<P> +The <TT>french</TT> and <TT>abbrv</TT> settings only have an +effect if the French language has been defined. + +<P> +The male gender for all languages is used by default, however the +feminine or neuter forms can be obtained by passing <TT>f</TT> or +<TT>n</TT> as an optional argument to <TT>\ordinal</TT>, +<TT>\ordinalnum</TT> etc. For example: +<code>\numberstring{section}[f]</code>. Note that the optional argument +comes <I>after</I> the compulsory argument. If a gender is +not defined in a given language, the masculine version will +be used instead. + +<P> +Let me know if you find any spelling mistakes (has been known +to happen in English, let alone other languages with which I'm not so +familiar.) If you want to add support for another language, +you will need to let me know how to form the numbers and ordinals +from 0 to 99999 in that language for each gender. + +<P> + +<H1><A NAME="SECTION00070000000000000000"> +Configuration File <TT>fmtcount.cfg</TT></A> +</H1> + +<P> +You can save your preferred default settings to a file called +<TT>fmtcount.cfg</TT>, and place it on the TeX path. These +settings will then be loaded by the <TT>fmtcount</TT> +package. + +<P> +Note that if you are using the <TT>datetime</TT> package, +the <TT>datetime.cfg</TT> configuration file will override +the <TT>fmtcount.cfg</TT> configuration file. +For example, if <TT>datetime.cfg</TT> has the line: +<PRE> +\renewcommand{\fmtord}[1]{\textsuperscript{\underline{#1}}} +</PRE> +and if <TT>fmtcount.cfg</TT> has the line: +<PRE> +\fmtcountsetoptions{fmtord=level} +</PRE> +then the former definition of <TT>\fmtord</TT> will take +precedence. + +<P> + +<H1><A NAME="SECTION00080000000000000000"> +LaTeX2HTML style</A> +</H1> + +<P> +The LaTeX2HTML style file <TT>fmtcount.perl</TT> is provided. +The following limitations apply: + +<P> + +<UL> +<LI><TT>\padzeroes</TT> only has an effect in the preamble. + +<P> +</LI> +<LI>The configuration file +<TT>fmtcount.cfg</TT> is currently ignored. (This is because +I can't work out the correct code to do this. If you +know how to do this, please let me know.) You can however +do: +<PRE> +\usepackage{fmtcount} +\html{\input{fmtcount.cfg}} +</PRE> +This, I agree, is an unpleasant cludge. + +<P> +</LI> +</UL> + +<P> + +<H1><A NAME="SECTION00090000000000000000"> +Acknowledgements</A> +</H1> + +<P> +I would like to thank my mother for the French and Portuguese +support and my Spanish dictionary for the Spanish support. +Thank you to K. H. Fricke for providing me with the German +translations. + +<P> + +<H1><A NAME="SECTION000100000000000000000"> +Troubleshooting</A> +</H1> + +<P> +There is a FAQ available at: +<TT><A NAME="tex2html5" + HREF="http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/">http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/</A></TT>. + +<P> +<BR><HR><H4>Footnotes</H4> +<DL> +<DT><A NAME="foot515">... +argument</A><A + HREF="manual.html#tex2html2"><SUP>1</SUP></A></DT> +<DD>See all the various postings to +<TT>comp.text.tex</TT> about <TT>\MakeUppercase</TT> + +</DD> +<DT><A NAME="foot461">... +1.1</A><A + HREF="manual.html#tex2html3"><SUP>2</SUP></A></DT> +<DD>Thanks to K. H. Fricke for supplying the information + +</DD> +<DT><A NAME="foot516">... +defined</A><A + HREF="manual.html#tex2html4"><SUP>3</SUP></A></DT> +<DD>this will be true if you have loaded <TT>babel</TT> + +</DD> +</DL> +<BR><HR> +<ADDRESS> +<A href=http://theoval.cmp.uea.ac.uk/~nlct/>Nicola L. C. Talbot</A>. +<A HREF=http://www.cmp.uea.ac.uk/>School of Computing Sciences</A>. +<A HREF=http://www.uea.ac.uk/>University of East Anglia.</A> +Last Modified: 2007-08-20 +</ADDRESS> +</BODY> +</HTML> diff --git a/Master/texmf-dist/doc/latex/fmtcount/doc/fmtcount.pdf b/Master/texmf-dist/doc/latex/fmtcount/doc/fmtcount.pdf Binary files differindex fe3cccc2ab0..84132f07fb4 100644 --- a/Master/texmf-dist/doc/latex/fmtcount/doc/fmtcount.pdf +++ b/Master/texmf-dist/doc/latex/fmtcount/doc/fmtcount.pdf diff --git a/Master/texmf-dist/doc/latex/fmtcount/doc/manual.html b/Master/texmf-dist/doc/latex/fmtcount/doc/manual.html deleted file mode 100644 index be8c0b2c915..00000000000 --- a/Master/texmf-dist/doc/latex/fmtcount/doc/manual.html +++ /dev/null @@ -1,567 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> - -<!--Converted with LaTeX2HTML 2002 (1.67) -original version by: Nikos Drakos, CBLU, University of Leeds -* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan -* with significant contributions from: - Jens Lippmann, Marek Rouchal, Martin Wilck and others --> -<HTML> -<HEAD> -<TITLE>fmtcount.sty v1.1: Displaying the Values of LaTeX Counters</TITLE> -<META NAME="description" CONTENT="fmtcount.sty v1.1: Displaying the Values of LaTeX Counters"> -<META NAME="keywords" CONTENT="manual"> -<META NAME="resource-type" CONTENT="document"> -<META NAME="distribution" CONTENT="global"> - -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> -<META NAME="Generator" CONTENT="LaTeX2HTML v2002"> -<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> - - -</HEAD> - -<BODY > -<A NAME="tex2html1" - HREF="http://theoval.cmp.uea.ac.uk/~nlct/">Dr Nicola Talbot</A> -| -<A NAME="tex2html2" - HREF="http://www.cmp.uea.ac.uk/">School of Computing Sciences</A> -| -<A NAME="tex2html3" - HREF="http://www.uea.ac.uk/">University of East Anglia</A> - -<P> - - <H1 ALIGN="CENTER">fmtcount.sty v1.1: Displaying the Values of -LaTeX Counters</H1> -<P ALIGN="CENTER"><STRONG>Nicola L.C. Talbot</STRONG></P> -<P ALIGN="CENTER"><STRONG>26th May 2007</STRONG></P> - <BR> - -<H2><A NAME="SECTION00010000000000000000"> -Contents</A> -</H2> -<!--Table of Contents--> - -<UL> -<LI><A NAME="tex2html20" - HREF="manual.html#SECTION00020000000000000000">Introduction</A> -<LI><A NAME="tex2html21" - HREF="manual.html#SECTION00030000000000000000">Installation</A> -<LI><A NAME="tex2html22" - HREF="manual.html#SECTION00040000000000000000">Available Commands</A> -<LI><A NAME="tex2html23" - HREF="manual.html#SECTION00050000000000000000">Package Options</A> -<LI><A NAME="tex2html24" - HREF="manual.html#SECTION00060000000000000000">Multilingual Support</A> -<LI><A NAME="tex2html25" - HREF="manual.html#SECTION00070000000000000000">Configuration File fmtcount.cfg</A> -<LI><A NAME="tex2html26" - HREF="manual.html#SECTION00080000000000000000">LaTeX2HTML style</A> -<LI><A NAME="tex2html27" - HREF="manual.html#SECTION00090000000000000000">Acknowledgements</A> -<LI><A NAME="tex2html28" - HREF="manual.html#SECTION000100000000000000000">Troubleshooting</A> -<LI><A NAME="tex2html29" - HREF="manual.html#SECTION000110000000000000000">Contact Details</A> -</UL> -<!--End of Table of Contents--> -<H1><A NAME="SECTION00020000000000000000"> -Introduction</A> -</H1> -The <TT>fmtcount</TT> package provides commands to display -the values of LaTeX counters in a variety of formats. It also -provides equivalent commands for actual numbers rather than -counter names. Limited multilingual support is available. - -<P> - -<H1><A NAME="SECTION00030000000000000000"> -Installation</A> -</H1> - -<P> -This package is distributed with the files <TT>fmtcount.dtx</TT> -and <TT>fmtcount.ins</TT>. To extract the code do: -<PRE> -latex fmtcount.ins -</PRE> -This will create the files <TT>fmtcount.sty</TT> and -<TT>fmtcount.perl</TT>, along with several <TT>.def</TT> files. -Place <TT>fmtcount.sty</TT> and the <TT>.def</TT> files somewhere -where LaTeX will find them (e.g. <TT>texmf/tex/latex/fmtcount/</TT>) and place <TT>fmtcount.perl</TT> somewhere where LaTeX2HTML -will find it (e.g. latex2html/styles). Remember to refresh -the TeX database (using <TT>texhash</TT> under Linux, for -other operating systems check the manual.) - -<P> - -<H1><A NAME="SECTION00040000000000000000"> -Available Commands</A> -</H1> - -<P> -The commands can be divided into two categories: those that -take the name of a counter as the argument, and those -that take a number as the argument. - -<P> -The macro <code>\ordinal{</code><I>counter</I><code>}</code> will - print the value of a LaTeX counter <I>counter</I> as an ordinal, - - where the macro <code>\fmtord{</code><I>text</I><code>}</code> is used to format the st,nd,rd,th bit. - By default the ordinal is formatted as a superscript, if the package option <TT>level</TT> - is used, it is level with the text. - For example, if the current section is 3, then <code>\ordinal{section}</code> will produce - the output: 3<SUP>rd</SUP>. - -<P> -<B>Note:</B> the <TT>memoir</TT> class also defines a command called -<code>\ordinal</code> which takes a number as an argument instead of a -counter. In order to overcome this incompatiblity, if you want -to use the <TT>fmtcount</TT> package with the <TT>memoir</TT> class -you should use <code>\FCordinal</code> to access <TT>fmtcount</TT>'s -version of <code>\ordinal</code>, and use <code>\ordinal</code> to use -<TT>memoir</TT>'s version of that command. - -<P> -The macro <code>\ordinalnum</code> is like <code>\ordinal</code> -but takes an actual number rather than a counter as the -argument. For example: <code>\ordinalnum{3}</code> will -produce: 3<SUP>rd</SUP>. - -<P> -The macro <code>\numberstring{</code><I>counter</I><code>}</code> will print the value - of <I>counter</I> as text. E.g. <code>\numberstring{section}</code> will produce: - three. - - The macro <code>\Numberstring{</code><I>counter</I><code>}</code> does the same as - <code>\numberstring</code>, but with initial letters in uppercase. For - example, <code>\Numberstring{section}</code> will produce: Three. - -The macro <code>\NUMBERstring{</code><I>counter</I><code>}</code> does the same -as <code>\numberstring</code>, but converted to upper case. Note that -<code>\MakeUppercase{\NUMBERstring{</code><I>counter</I><code>}}</code> doesn't -work, due to the way that <code>\MakeUppercase</code> expands its -argument<A NAME="tex2html4" - HREF="#foot290"><SUP>1</SUP></A>. - -<P> -The macros <code>\numberstringnum</code>, -<code>\Numberstringnum</code> and -<code>\NUMBERstringnum</code> work like -<code>\numberstring</code>, -<code>\Numberstring</code> and -<code>\NUMBERstring</code>, respectively, but take an actual number -rather than a counter as the argument. For example: -<code>\Numberstringnum{105}</code> will produce: One Hundred and Five. - -<P> -The macro <code>\ordinalstring{</code><I>counter</I><code>}</code> will print the - value of <I>counter</I> as a textual ordinal. E.g. <code>\ordinalstring{section}</code> will produce: third. - - The macro <code>\Ordinalstring{</code><I>counter</I><code>}</code> does the same as - <code>\ordinalstring</code>, but with initial letters in uppercase. For example, - <code>\Ordinalstring{section}</code> will produce: Third. - - The macro <code>\ORDINALstring{</code><I>counter</I><code>}</code> does the same as -<code>\ordinalstring</code>, but with all words in upper case (see previous -note about <TT>\MakeUppercase</TT>). - -<P> -The macros <code>\ordinalstringnum</code>, -<code>\Ordinalstringnum</code> and <TT>\ORDINALstringnum</TT> work like -<code>\ordinalstring</code>, -<code>\Ordinalstring</code> and <TT>\ORDINALstring</TT>, respectively, but take an actual number -rather than a counter as the argument. For example, -<code>\ordinalstringnum{3}</code> will produce: third. - -<P> -As from version 1.09, textual representations can be stored for -later use. This overcomes the problems encountered when you -attempt to use one of the above commands in <TT>\edef</TT>. - -<P> -Each of the following commands takes a label as the first argument, -the other arguments are as the analogous commands above. These -commands do not display anything, but store the textual -representation. This can later be retrieved using -<TT>\FMCuse</TT>{<I>label</I>}. -Note: with <TT>\storeordinal</TT> and <TT>\storeordinalnum</TT>, the -only bit that doesn't get expanded is <TT>\fmtord</TT>. So, for -example, <code>\storeordinalnum{mylabel}{3}</code> will be stored as -<code>3\relax \fmtord{rd}</code>. - -<P> - -<TT>\storeordinal</TT>{<I>label</I>}{<I>counter</I>}[<I>gender</I>] - -<P> - -<TT>\storeordinalstring</TT>{<I>label</I>}{<I>counter</I>}[<I>gender</I>] - -<P> - -<TT>\storeOrdinalstring</TT>{<I>label</I>}{<I>counter</I>}[<I>gender</I>] - -<P> - -<TT>\storeORDINALstring</TT>{<I>label</I>}{<I>counter</I>}[<I>gender</I>] - -<P> - -<TT>\storenumberstring</TT>{<I>label</I>}{<I>counter</I>}[<I>gender</I>] - -<P> - -<TT>\storeNumberstring</TT>{<I>label</I>}{<I>counter</I>}[<I>gender</I>] - -<P> - -<TT>\storeNUMBERstring</TT>{<I>label</I>}{<I>counter</I>}[<I>gender</I>] - -<P> - -<TT>\storeordinalnum</TT>{<I>label</I>}{<I>number</I>}[<I>gender</I>] - -<P> - -<TT>\storeordinalstring</TT>{<I>label</I>}{<I>number</I>}[<I>gender</I>] - -<P> - -<TT>\storeOrdinalstringnum</TT>{<I>label</I>}{<I>number</I>}[<I>gender</I>] - -<P> - -<TT>\storeORDINALstringnum</TT>{<I>label</I>}{<I>number</I>}[<I>gender</I>] - -<P> - -<TT>\storenumberstring</TT>{<I>label</I>}{<I>number</I>}[<I>gender</I>] - -<P> - -<TT>\storeNumberstring</TT>{<I>label</I>}{<I>number</I>}[<I>gender</I>] - -<P> - -<TT>\storeNUMBERstring</TT>{<I>label</I>}{<I>number</I>}[<I>gender</I>] - -<P> -The macro <code>\binary{</code><I>counter</I><code>}</code> will print the -value of <I>counter</I> as a binary number. -E.g. <code>\binary{section}</code> will produce: 11. The declaration -<code>\padzeroes[</code><I>n</I><code>]</code> -will ensure numbers are written to <I>n</I> digits, padding with -zeroes if necessary. E.g. <code>\padzeroes[8]\binary{section}</code> -will produce: 00000011. - The default value for <I>n</I> is 17. - -<P> -The macro <code>\binarynum</code> is like <code>\binary</code> -but takes an actual number rather than a counter as the -argument. For example: <code>\binarynum{5}</code> will -produce: 101. - -<P> -The macro <code>\octal{</code><I>counter</I><code>}</code> will print the -value of <I>counter</I> as an octal number. For example, if you -have a counter called, say <TT>mycounter</TT>, and you set the -value to 125, then <code>\octal{mycounter}</code> will produce: 177. - Again, the number will be padded with zeroes if necessary, -depending on whether <code>\padzeroes</code> has been used. - -<P> -The macro <code>\octalnum</code> is like <code>\octal</code> -but takes an actual number rather than a counter as the -argument. For example: <code>\octalnum{125}</code> will -produce: 177. - -<P> -The macro <code>\hexadecimal{</code><I>counter</I><code>}</code> will print -the value of <I>counter</I> as a hexadecimal number. Going back -to the previous example, <code>\hexadecimal{mycounter}</code> will - produce: 7d. Again, the number will be padded with zeroes if -necessary, depending on whether <code>\padzeroes</code> has been used. - - <code>\Hexadecimal{</code><I>counter</I><code>}</code> does the same thing, -but uses uppercase characters, e.g. - <code>\Hexadecimal{mycounter}</code> will produce: 7D. - -<P> -The macros <code>\hexadecimalnum</code> and -<code>\Hexadecimalnum</code> are like -<code>\hexadecimal</code> and <code>\Hexadecimal</code> -but take an actual number rather than a counter as the -argument. For example: <code>\hexadecimalnum{125}</code> will -produce: 7d, and <code>\Hexadecimalnum{125}</code> will -produce: 7D. - -<P> -The macro <code>\decimal{</code><I>counter</I><code>}</code> is similar to -<code>\arabic</code> but the number can be padded with zeroes - depending on whether <code>\padzeroes</code> has been used. -For example: <code>\padzeroes[8]\decimal{section}</code> will - produce: 00000005. - -<P> -The macro <code>\decimalnum</code> is like <code>\decimal</code> -but takes an actual number rather than a counter as the -argument. For example: <code>\padzeroes[8]\decimalnum{5}</code> will -produce: 00000005. - -<P> -The macro <code>\aaalph{</code><I>counter</I><code>}</code> will print the -value of <I>counter</I> as: a b ... z aa bb ... zz etc. - For example, <code>\aaalpha{mycounter}</code> will produce: uuuuu if -<TT>mycounter</TT> is set to 125. - - <code>\AAAlph{</code><I>counter</I><code>}</code> does the same thing, but -uses uppercase characters, e.g. - <code>\AAAlph{mycounter}</code> will produce: UUUUU. - -<P> -The macros <code>\aaalphnum</code> and -<code>\AAAlphnum</code> are like -<code>\aaalph</code> and <code>\AAAlph</code> -but take an actual number rather than a counter as the -argument. For example: <code>\aaalphnum{125}</code> will -produce: uuuuu, and <code>\AAAlphnum{125}</code> will -produce: UUUUU. - -<P> -The macro <code>\abalph{</code><I>counter</I><code>}</code> will print the -value of <I>counter</I> as: a b ... z aa ab ... az etc. - For example, <code>\abalpha{mycounter}</code> will produce: du if -<TT>mycounter</TT> is set to 125. - - <code>\ABAlph{</code><I>counter</I><code>}</code> does the same thing, but -uses uppercase characters, e.g. - <code>\ABAlph{mycounter}</code> will produce: DU. - -<P> -The macros <code>\abalphnum</code> and -<code>\ABAlphnum</code> are like -<code>\abalph</code> and <code>\ABAlph</code> -but take an actual number rather than a counter as the -argument. For example: <code>\abalphnum{125}</code> will -produce: du, and <code>\ABAlphnum{125}</code> will -produce: DU. - -<P> - -<H1><A NAME="SECTION00050000000000000000"> -Package Options</A> -</H1> - -<P> -The following options can be passed to this package: - -<P> -<TABLE CELLPADDING=3> -<TR><TD ALIGN="LEFT">raise</TD> -<TD ALIGN="LEFT">make ordinal st,nd,rd,th appear as superscript</TD> -</TR> -<TR><TD ALIGN="LEFT">level</TD> -<TD ALIGN="LEFT">make ordinal st,nd,rd,th appear level with rest of -text</TD> -</TR> -</TABLE> - -<P> -These can also be set using the command: - -<P> - -<code>\fmtcountsetoptions{fmtord=</code><I>type</I><code>}</code> - -<P> -where <I>type</I> is either <TT>level</TT> or -<TT>raise</TT>. - -<P> - -<H1><A NAME="SECTION00060000000000000000"> -Multilingual Support</A> -</H1> - -<P> -Version 1.02 of the <TT>fmtcount</TT> package now has -limited multilingual support. The following languages are -implemented: English, Spanish, Portuguese, French, French (Swiss) -and French (Belgian). German support was added in version -1.1<A NAME="tex2html5" - HREF="#foot244"><SUP>2</SUP></A>. - -<P> -The package checks to see if the -command <code>\date</code><I>language</I> is defined<A NAME="tex2html6" - HREF="#foot291"><SUP>3</SUP></A>, and will -load the code for those languages. The commands <code>\ordinal</code>, -<code>\ordinalstring</code> and <code>\numberstring</code> (and their -variants) will then be formatted in the currently -selected language. - -<P> -If the French language is selected, the French (France) version -will be used by default (e.g. soxiante-dix for 70). To -select the Swiss or Belgian variants (e.g. septente for 70) use: -<code>\fmtcountsetoptions{french=</code><I>dialect</I><code>}</code> -where <I>dialect</I> is either <TT>swiss</TT> or <TT>belgian</TT>. -You can also use this command to change the action of -<code>\ordinal</code>. -<code>\fmtcountsetoptions{abbrv=true}</code> to produce ordinals -of the form 2<SUP>e</SUP> or -<code>\fmtcountsetoptions{abbrv=false}</code> to produce ordinals -of the form 2<SUP>eme</SUP> (default). - -<P> -The <TT>french</TT> and <TT>abbrv</TT> settings only have an -effect if the French language has been defined. - -<P> -The male gender for all languages is used by default, however the -feminine or neuter forms can be obtained by passing <TT>f</TT> or -<TT>n</TT> as an optional argument to <code>\ordinal</code>, -<code>\ordinalnum</code> etc. For example: -<code>\numberstring{section}[f]</code>. Note that the optional argument -comes <I>after</I> the compulsory argument. If a gender is -not defined in a given language, the masculine version will -be used instead. - -<P> -Let me know if you find any spelling mistakes (has been known -to happen in English, let alone other languages I'm not so -familiar with.) If you want to add support for another language, -you will need to let me know how to form the numbers and ordinals -from 0 to 99999 in that language for each gender. - -<P> - -<H1><A NAME="SECTION00070000000000000000"> -Configuration File <TT>fmtcount.cfg</TT></A> -</H1> - -<P> -You can save your preferred default settings to a file called -<TT>fmtcount.cfg</TT>, and place it on the TeX path. These -settings will then be loaded by the <TT>fmtcount</TT> -package. - -<P> -Note that if you are using the <TT>datetime</TT> package, -the <TT>datetime.cfg</TT> configuration file will override -the <TT>fmtcount.cfg</TT> configuration file. -For example, if <TT>datetime.cfg</TT> has the line: -<PRE> -\renewcommand{\fmtord}[1]{\textsuperscript{\underline{#1}}} -</PRE> -and if <TT>fmtcount.cfg</TT> has the line: -<PRE> -\fmtcountsetoptions{fmtord=level} -</PRE> -then the former definition of <code>\fmtord</code> will take -precedence. - -<P> - -<H1><A NAME="SECTION00080000000000000000"> -LaTeX2HTML style</A> -</H1> - -<P> -The LaTeX2HTML style file <TT>fmtcount.perl</TT> is provided. -The following limitations apply: - -<P> - -<UL> -<LI><code>\padzeroes</code> only has an effect in the preamble. - -<P> -</LI> -<LI>The configuration file -<TT>fmtcount.cfg</TT> is currently ignored. (This is because -I can't work out the correct code to do this. If you -know how to do this, please let me know.) You can however -do: -<PRE> -\usepackage{fmtcount} -\html{\input{fmtcount.cfg}} -</PRE> -This, I agree, is an unpleasant cludge. - -<P> -</LI> -</UL> - -<P> - -<H1><A NAME="SECTION00090000000000000000"> -Acknowledgements</A> -</H1> - -<P> -I would like to thank my mother for the French and Portuguese -support and my Spanish dictionary for the Spanish support. -Thank you to K. H. Fricke for providing me with the German -translations. - -<P> - -<H1><A NAME="SECTION000100000000000000000"> -Troubleshooting</A> -</H1> - -<P> -There is a FAQ available at: <TT><A NAME="tex2html7" - HREF="http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/">http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/</A></TT>. - -<P> - -<H1><A NAME="SECTION000110000000000000000"> -Contact Details</A> -</H1> - Dr Nicola Talbot -<BR> -School of Computing Sciences -<BR> -University of East Anglia -<BR> -Norwich. NR4 7TJ. -<BR> -United Kingdom. -<BR> <TT><A NAME="tex2html8" - HREF="http://theoval.cmp.uea.ac.uk/~nlct/">http://theoval.cmp.uea.ac.uk/~nlct/</A></TT> -<BR><HR><H4>Footnotes</H4> -<DL> -<DT><A NAME="foot290">... -argument</A><A - HREF="manual.html#tex2html4"><SUP>1</SUP></A></DT> -<DD>See all the various postings to -<TT>comp.text.tex</TT> about <TT>\MakeUppercase</TT> - -</DD> -<DT><A NAME="foot244">... -1.1</A><A - HREF="manual.html#tex2html5"><SUP>2</SUP></A></DT> -<DD>Thanks to K. H. Fricke for supplying the information - -</DD> -<DT><A NAME="foot291">... defined</A><A - HREF="manual.html#tex2html6"><SUP>3</SUP></A></DT> -<DD>this -will be true if you have loaded <TT>babel</TT> - -</DD> -</DL> -<BR><HR> -<ADDRESS> -<A href=http://theoval.cmp.uea.ac.uk/~nlct/>Nicola L. C. Talbot</A>. -<A HREF=http://www.cmp.uea.ac.uk/>School of Computing Sciences</A>. -<A HREF=http://www.uea.ac.uk/>University of East Anglia.</A> -Last Modified: 2007-06-14 -</ADDRESS> -</BODY> -</HTML> diff --git a/Master/texmf-dist/doc/latex/fmtcount/fmtcount.perl b/Master/texmf-dist/doc/latex/fmtcount/fmtcount.perl new file mode 100644 index 00000000000..bc7d3b9fb4e --- /dev/null +++ b/Master/texmf-dist/doc/latex/fmtcount/fmtcount.perl @@ -0,0 +1,2670 @@ +# File : fmtcount.perl +# Author : Nicola Talbot +# Date : 26 May 2007 +# Version : 1.05 +# Description : LaTeX2HTML implementation of fmtcount package + +package main; + +sub do_fmtcount_raise{ + local($tmp)=""; + + $tmp .= 'sub do_cmd_fmtord{'; + $tmp .= 'local($_) = @_;'; + $tmp .= 'local($suffix) = &missing_braces unless (s/$next_pair_pr_rx/$suffix=$2;\'\'/eo);'; + $tmp .= 'join("", "<SUP>",$suffix,"</SUP>",$_);'; + $tmp .='}'; + + eval($tmp); +} + +sub do_fmtcount_level{ + local($tmp)=""; + + $tmp .= 'sub do_cmd_fmtord{'; + $tmp .= 'local($_) = @_;'; + $tmp .= 'local($suffix) = &missing_braces unless (s/$next_pair_pr_rx/$suffix=$2;\'\'/eo);'; + $tmp .= 'join("", $suffix,$_);'; + $tmp .='}'; + + eval($tmp); +} + +if (not defined &do_cmd_fmtord) +{ + &do_fmtcount_raise(@_); +} + +$frenchdialect = 'france'; +$ordinalabbrv = 0; + +sub get_ordinal_suffix_english{ + local($num,$gender) = @_; + local($suffix); + + if ((($num % 10) == 1) && ($num%100 != 11)) + { + $suffix = 'st'; + } + elsif ((($num % 10) == 2) && ($num%100 != 12)) + { + $suffix = 'nd'; + } + elsif ((($num % 10) == 3) && ($num%100 != 13)) + { + $suffix = 'rd'; + } + else + { + $suffix = 'th'; + } + + $suffix; +} + +sub get_ordinal_suffix_french{ + local($num,$gender) = @_; + local($_); + + if ($ordinalabbrv > 0) + { + $_ = 'e'; + } + else + { + if ($num == 1) + { + $_ = ($gender eq 'f' ? 'ere' : 'er'); + } + else + { + $_ = 'eme'; + } + } +} + +sub get_ordinal_suffix_spanish{ + local($num,$gender) = @_; + + ($gender eq 'f' ? 'a' : 'o'); +} + +sub get_ordinal_suffix_portuges{ + local($num,$gender) = @_; + + ($gender eq 'f' ? 'a' : 'o'); +} + +sub get_ordinal_suffix_german{ + local($num,$gender) = @_; + + ''; +} + +sub get_ordinal_suffix_ngerman{ + local($num,$gender) = @_; + + ''; +} + +sub get_ordinal_suffix{ + local($num,$gender) = @_; + local($suffix,$suffixsub); + + $suffixsub = "get_ordinal_suffix_$default_language"; + + if (defined ($suffixsub)) + { + $suffix = &$suffixsub($num,$gender); + } + else + { + $suffix = &get_ordinal_suffix_english($num,$gender); + } + + $suffix; +} + +sub getordinal{ + local($num,$gender) = @_; + local($suffix) = &get_ordinal_suffix($num,$gender); + local($text)=''; + + if ($suffix eq '') + { + $text = $num; + } + else + { + local($br_id) = ++$global{'max_id'}; + $text = $num . "\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}"; + } + + $text; +} + +sub do_cmd_ordinalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + my($gender)='m'; + local($suffix)=''; + + if (s/\[([mfn])\]//) + { + $gender = $1; + } + + $suffix = &get_ordinal_suffix($num,$gender); + + local($br_id) = ++$global{'max_id'}; + join('', $num, "\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}", $_); +} + +sub do_cmd_FCordinal{ + &do_cmd_ordinal; +} + +sub do_cmd_ordinal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $str eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{ORDINAL{', $ctr, '}}', $_[0]); + } + else + { + join('', &getordinal($val, $gender), $_[0]); + } +} + +sub do_cmd_storeordinal{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{ORDINAL{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = &getordinal($val, $gender); + } + + $_; +} + +sub do_cmd_storeordinalnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = &getordinal($val, $gender); + + $_; +} + +@unitthstring = ('zeroth', + 'first', + 'second', + 'third', + 'fourth', + 'fifth', + 'sixth', + 'seventh', + 'eighth', + 'ninth'); + +@tenthstring = ('', + 'tenth', + 'twentieth', + 'thirtieth', + 'fortieth', + 'fiftieth', + 'sixtieth', + 'seventieth', + 'eightieth', + 'ninetieth'); + +@teenthstring = ('tenth', + 'eleventh', + 'twelfth', + 'thirteenth', + 'fourteenth', + 'fifteenth', + 'sixteenth', + 'seventeenth', + 'eighteenth', + 'nineteenth'); + +@unitstring = ('zero', + 'one', + 'two', + 'three', + 'four', + 'five', + 'six', + 'seven', + 'eight', + 'nine'); + +@teenstring = ('ten', + 'eleven', + 'twelve', + 'thirteen', + 'fourteen', + 'fifteen', + 'sixteen', + 'seventeen', + 'eighteen', + 'nineteen'); +@tenstring = ('', + 'ten', + 'twenty', + 'thirty', + 'forty', + 'fifty', + 'sixty', + 'seventy', + 'eighty', + 'ninety'); + +$hundredname = "hundred"; +$hundredthname = "hundredth"; +$thousandname = "thousand"; +$thousandthname = "thousandth"; + +sub get_numberstringenglish{ + local($num) = @_; + local($name)=""; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = &get_numberstringenglish($num/1000); + $name .= $thousands . " $thousandname"; + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = &get_numberstringenglish($num/100); + $name .= $hundreds . " $hundredname"; + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " and "; } + + if ($num >= 20) + { + $name .= $tenstring[$num/10]; + + if ($num%10 > 0) { $name .= '-'; } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenstring[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitstring[$num%10]; + } + } + + $name; +} + +@unitthstringfrench = ('zeroi\`eme', + 'uni\`eme', + 'deuxi\`eme', + 'troisi\`eme', + 'quatri\`eme', + 'cinqui\`eme', + 'sixi\`eme', + 'septi\`eme', + 'huiti\`eme', + 'neuvi\`eme'); + +@tenthstringfrench = ('', + 'dixi\`eme', + 'vingti\`eme', + 'trentri\`eme', + 'quaranti\`eme', + 'cinquanti\`eme', + 'soixanti\`eme', + 'septenti\`eme', + 'huitanti\`eme', + 'nonenti\`eme'); + +@teenthstringfrench = ('dixi\`eme', + 'onzi\`eme', + 'douzi\`eme', + 'treizi\`eme', + 'quatorzi\`eme', + 'quinzi\`eme', + 'seizi\`eme', + 'dix-septi\`eme', + 'dix-huiti\`eme', + 'dix-neuvi\`eme'); + +@unitstringfrench = ('zero', + 'un', + 'deux', + 'trois', + 'quatre', + 'cinq', + 'six', + 'sept', + 'huit', + 'neuf'); + +@teenstringfrench = ('dix', + 'onze', + 'douze', + 'treize', + 'quatorze', + 'quinze', + 'seize', + 'dix-sept', + 'dix-huit', + 'dix-neuf'); + +@tenstringfrench = ('', + 'dix', + 'vingt', + 'trente', + 'quarante', + 'cinquante', + 'soixante', + 'septente', + 'huitante', + 'nonente'); + +$hundrednamefrench = "cent"; +$hundredthnamefrench = "centi\\`eme"; +$thousandnamefrench = "mille"; +$thousandthnamefrench = "mili\\`eme"; + +@unitthstringspanish = ('cero', + 'primero', + 'segundo', + 'tercero', + 'cuarto', + 'quinto', + 'sexto', + 's\\\'eptimo', + 'octavo', + 'noveno'); + +@tenthstringspanish = ('', + 'd\\\'ecimo', + 'vig\\\'esimo', + 'trig\\\'esimo', + 'cuadrag\\\'esimo', + 'quincuag\\\'esimo', + 'sexag\\\'esimo', + 'septuag\\\'esimo', + 'octog\\\'esimo', + 'nonag\\\'esimo'); + +@teenthstringspanish = ('d\\\'ecimo', + 'und\\\'ecimo', + 'duod\\\'ecimo', + 'decimotercero', + 'decimocuarto', + 'decimoquinto', + 'decimosexto', + 'decimos\\\'eptimo', + 'decimoctavo', + 'decimonoveno'); + +@hundredthstringspanish = ('', + 'cent\\\'esimo', + 'ducent\\\'esimo', + 'tricent\\\'esimo', + 'cuadringent\\\'esimo', + 'quingent\\\'esimo', + 'sexcent\\\'esimo', + 'septing\\\'esimo', + 'octingent\\\'esimo', + 'noningent\\\'esimo'); + +@unitstringspanish = ('cero', + 'uno', + 'dos', + 'tres', + 'cuatro', + 'cinco', + 'seis', + 'siete', + 'ocho', + 'nueve'); + +@teenstringspanish = ('diez', + 'once', + 'doce', + 'trece', + 'catorce', + 'quince', + 'diecis\\\'eis', + 'diecisiete', + 'dieciocho', + 'diecinueve'); + +@twentystringspanish = ('viente', + 'vientiuno', + 'vientid\\\'os', + 'vientitr\\\'es', + 'vienticuatro', + 'vienticinco', + 'vientis\\\'eis', + 'vientisiete', + 'vientiocho', + 'vientinueve'); + +@tenstringspanish = ('', + 'diez', + 'viente', + 'treinta', + 'cuarenta', + 'cincuenta', + 'sesenta', + 'setenta', + 'ochenta', + 'noventa'); + +@hundredstringspanish = ('', + 'ciento', + 'doscientos', + 'trescientos', + 'cuatrocientos', + 'quinientos', + 'seiscientos', + 'setecientos', + 'ochocientos', + 'novecientos'); + +$hundrednamespanish = "cien"; +$hundredthnamespanish = "centi\\`eme"; +$thousandnamespanish = "mil"; +$thousandthnamespanish = "mil\\'esimo"; + +@unitthstringportuges = ('zero', + 'primeiro', + 'segundo', + 'terceiro', + 'quatro', + 'quinto', + 'sexto', + 's\\\'etimo', + 'oitavo', + 'nono'); + +@tenthstringportuges = ('', + 'd\\\'ecimo', + 'vig\\\'esimo', + 'trig\\\'esimo', + 'quadrag\\\'esimo', + 'q\"uinquag\\\'esimo', + 'sexag\\\'esimo', + 'setuag\\\'esimo', + 'octog\\\'esimo', + 'nonag\\\'esimo'); + +@hundredthstringportuges = ('', + 'cent\\\'esimo', + 'ducent\\\'esimo', + 'trecent\\\'esimo', + 'quadringent\\\'esimo', + 'q\"uingent\\\'esimo', + 'seiscent\\\'esimo', + 'setingent\\\'esimo', + 'octingent\\\'esimo', + 'nongent\\\'esimo'); + +@unitstringportuges = ('zero', + 'um', + 'dois', + 'tr\^es', + 'quatro', + 'cinco', + 'seis', + 'sete', + 'oito', + 'nove'); + +@teenstringportuges = ('dez', + 'onze', + 'doze', + 'treze', + 'quatorze', + 'quinze', + 'dezesseis', + 'dezessete', + 'dezoito', + 'dezenove'); + +@tenstringportuges = ('', + 'dez', + 'vinte', + 'trinta', + 'quaranta', + 'cinq\"uenta', + 'sessenta', + 'setenta', + 'oitenta', + 'noventa'); + +@hundredstringportuges = ('', + 'cento', + 'duzentos', + 'trezentos', + 'quatrocentos', + 'quinhentos', + 'seiscentos', + 'setecentos', + 'oitocentos', + 'novecentos'); + +$hundrednameportuges = "cem"; +$thousandnameportuges = "mil"; +$thousandthnameportuges = "mil\\'esimo"; + +sub get_numberstringfrench{ + local($num,$gender) = @_; + local($name)=""; + + if ($gender eq 'f') + { + $unitstringfrench[1] = 'une'; + } + else + { + $unitstringfrench[1] = 'un'; + } + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = ''; + + if ($num >= 2000) + { + $thousands = &get_numberstringfrench($num/1000,$gender).' '; + } + + $name .= $thousands . $thousandnamefrench; + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = ''; + + if ($num >= 200) + { + $hundreds = &get_numberstringfrench($num/100,$gender).' '; + } + + $name .= $hundreds . $hundrednamefrench; + $num = $num%100; + + if (($_[0]%100 == 0) && ($_[0]/100 > 1)) + { + $name .= 's'; + } + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " "; } + + if ($num >= 20) + { + if ($frenchdialect eq 'france' and $num >= 70) + { + if ($num < 80) + { + $name .= $tenstringfrench[6]; + + if ($num%10 == 1) + { + $name .= ' et '; + } + else + { + $name .= '-'; + } + + $num = 10+($num%10); + } + else + { + $name .= 'quatre-vingt' . ($num==80?'s':'-'); + + if ($num >= 90) + { + $num = 10+($num%10); + } + } + } + elsif ($frenchdialect eq 'belgian' + && ($num >= 80) && ($num < 90)) + { + $name .= 'quatre-vingt' . ($num==80?'s':'-'); + } + else + { + $name .= $tenstringfrench[$num/10]; + + if ($num%10 == 1) { $name .= ' et ';} + elsif ($num%10 > 0) { $name .= '-'; } + } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenstringfrench[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitstringfrench[$num%10]; + } + } + + $name; +} + +sub get_numberstringspanish{ + local($num,$gender) = @_; + local($name)=""; + + if ($gender eq 'f') + { + $unitstringspanish[1] = 'una'; + } + else + { + $unitstringspanish[1] = 'uno'; + } + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = ''; + + if ($num >= 2000) + { + $thousands = &get_numberstringspanish($num/1000,$gender).' '; + } + + $name .= $thousands . $thousandnamespanish; + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = ''; + + if ($num > 100) + { + $hundreds = $hundredstringspanish[$num/100]; + } + else + { + $hundreds = 'cien'; + } + + $name .= $hundreds; + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " y "; } + + if ($num >= 30) + { + $name .= $tenstringspanish[$num/10]; + + if ($num%10 > 0) { $name .= ' y '; } + } + + if (($num >=20) && ($num < 30)) + { + $name .= $twentystringspanish[$num%10]; + } + elsif (($num >= 10) && ($num < 20)) + { + $name .= $teenstringspanish[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitstringspanish[$num%10]; + } + } + + $name; +} + +sub get_numberstringportuges{ + local($num,$gender) = @_; + local($name)=""; + + if ($gender eq 'f') + { + $unitstringportuges[0] = 'zera'; + $unitstringportuges[1] = 'uma'; + $unitstringportuges[2] = 'duas'; + } + else + { + $unitstringportuges[0] = 'zero'; + $unitstringportuges[1] = 'um'; + $unitstringportuges[2] = 'dois'; + } + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = ''; + + if ($num >= 2000) + { + $thousands = &get_numberstringportuges($num/1000,$gender).' '; + } + + $name .= $thousands . $thousandnameportuges; + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = ''; + + if ($num > 100) + { + $hundreds = $hundredstringportuges[$num/100]; + + if ($gender eq 'f' and $num >= 200) + { + $hundreds =~s/o(s?)$/a\1/; + } + } + else + { + $hundreds = $hundrednameportuges; + } + + $name .= $hundreds; + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " e "; } + + if ($num >= 20) + { + $name .= $tenstringportuges[$num/10]; + + if ($num%10 == 1) { $name .= ' e ';} + elsif ($num%10 > 0) { $name .= ' '; } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenstringportuges[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitstringportuges[$num%10]; + } + } + + $name; +} + +@unitthstringMgerman = ('nullter', + 'erster', + 'zweiter', + 'dritter', + 'vierter', + 'f\\"unter', + 'sechster', + 'siebter', + 'achter', + 'neunter'); + +@tenthstringMgerman = ('', + 'zehnter', + 'zwanzigster', + 'drei\\ss igster', + 'vierzigster', + 'f\\"unfzigster', + 'sechzigster', + 'siebzigster', + 'achtzigster', + 'neunzigster'); + +@teenthstringMgerman = ('zehnter', + 'elfter', + 'zw\\"olfter', + 'dreizehnter', + 'vierzehnter', + 'f\\"unfzehnter', + 'sechzehnter', + 'siebzehnter', + 'achtzehnter', + 'neunzehnter'); + +@unitthstringFgerman = ('nullte', + 'erste', + 'zweite', + 'dritte', + 'vierte', + 'f\\"unfte', + 'sechste', + 'siebte', + 'achte', + 'neunte'); + +@tenthstringFgerman = ('', + 'zehnte', + 'zwanzigste', + 'drei\\ss igste', + 'vierzigste', + 'f\\"unfzigste', + 'sechzigste', + 'siebzigste', + 'achtzigste', + 'neunzigste'); + +@teenthstringFgerman = ('zehnte', + 'elfte', + 'zw\\"olfte', + 'dreizehnte', + 'vierzehnte', + 'f\\"unfzehnte', + 'sechzehnte', + 'siebzehnte', + 'achtzehnte', + 'neunzehnte'); + +@unitthstringNgerman = ('nulltes', + 'erstes', + 'zweites', + 'drittes', + 'viertes', + 'f\\"unte', + 'sechstes', + 'siebtes', + 'achtes', + 'neuntes'); + +@tenthstringNgerman = ('', + 'zehntes', + 'zwanzigstes', + 'drei\\ss igstes', + 'vierzigstes', + 'f\\"unfzigstes', + 'sechzigstes', + 'siebzigstes', + 'achtzigstes', + 'neunzigstes'); + +@teenthstringNgerman = ('zehntes', + 'elftes', + 'zw\\"olftes', + 'dreizehntes', + 'vierzehntes', + 'f\\"unfzehntes', + 'sechzehntes', + 'siebzehntes', + 'achtzehntes', + 'neunzehntes'); + +@unitstringgerman = ('null', + 'ein', # eins dealt with separately (this is for prefixes) + 'zwei', + 'drei', + 'vier', + 'f\\"unf', + 'sechs', + 'sieben', + 'acht', + 'neun'); + +@teenstringgerman = ('zehn', + 'elf', + 'zw\\"olf', + 'dreizehn', + 'vierzehn', + 'f\\"unfzehn', + 'sechzehn', + 'siebzehn', + 'achtzehn', + 'neunzehn'); + +@tenstringgerman = ('', + 'zehn', + 'zwanzig', + 'drei\\ss ig', + 'vierzig', + 'f\\"unfzig', + 'sechzig', + 'siebzig', + 'achtzig', + 'neunzig'); + +sub do_cmd_einhundert{ + local($_) = @_; + + "einhundert$_"; +} + +sub do_cmd_eintausend{ + local($_) = @_; + + "eintausend$_"; +} + +sub get_numberunderhundredgerman{ + local($num)=@_; + local($name)=''; + + if ($num == 1) + { + $name = 'eins'; + } + elsif ($num < 10) + { + $name = $unitstringgerman[$num]; + } + elsif ($num%10 == 0) + { + $name = $tenstringgerman[$num/10]; + } + else + { + $name = join('und', $unitstringgerman[$num%10], + $tenstringgerman[$num/10]); + } + + $name; +} + +sub get_numberstringgerman{ + local($orgnum,$gender) = @_; + local($name)=""; + + local($num) = $orgnum; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000 and $num < 2000) + { + $name = &translate_commands("\\eintausend "); + } + elsif ($num >= 2000) + { + $name = &get_numberunderhundredgerman($num/1000) + . "tausend"; + } + + $num = $orgnum%1000; + + if ($num >= 100 and $num < 200) + { + if ($orgnum > 1000) + { + $name .= "einhundert"; + } + else + { + $name = &translate_commands("\\einhundert "); + } + } + elsif ($num >= 200) + { + $name .= $unitstringgerman[$num/100]."hundert"; + } + + $num = $num%100; + + if ($orgnum == 0) + { + $name = 'null'; + } + elsif ($num > 0) + { + $name .= &get_numberunderhundredgerman($num); + } + } + + $name; +} + +sub get_numberstring{ + local($val,$gender) = @_; + + if ($default_language eq 'french') + { + &get_numberstringfrench($val,$gender); + } + elsif ($default_language eq 'spanish') + { + &get_numberstringspanish($val,$gender); + } + elsif ($default_language eq 'portuges') + { + &get_numberstringportuges($val,$gender); + } + elsif ($default_language eq 'german' + or $default_language eq 'ngerman') + { + &get_numberstringgerman($val,$gender); + } + else + { + &get_numberstringenglish($val); + } +} + +sub do_cmd_numberstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces unless + s/$next_pair_pr_rx/$num=$2;''/eo; + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', &get_numberstring($num,$gender), $_); +} + +sub do_cmd_numberstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{NUMBERSTRING{', $ctr, '}}', $_[0]); + } + else + { + join('', &get_numberstring($val, $gender), $_[0]); + } +} + +sub do_cmd_storenumberstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{NUMBERSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = join('', &get_numberstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storenumberstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = join('', &get_numberstring($val, $gender)); + + $_; +} + +sub get_Numberstring{ + local($val,$gender) = @_; + local($string) = &get_numberstring($val,$gender); + + if ($default_language=~m/german/) + { + $string =~ s/([a-z])([^\s\-]+)/\u\1\2/; + } + else + { + $string =~ s/([a-z])([^\s\-]+)/\u\1\2/g; + + if ($default_language eq 'french') + { + $string =~ s/ Et / et /g; + } + elsif ($default_language eq 'spanish') + { + $string =~ s/ Y / y /g; + } + elsif ($default_language eq 'portuges') + { + $string =~ s/ E / e /g; + } + else + { + $string =~ s/ And / and /g; + } + } + + $string; +} + +sub do_cmd_Numberstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', &get_Numberstring($num,$gender), $_); +} + +sub do_cmd_Numberstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{NNUMBERSTRING{', $ctr, '}}', $_[0]); + } + else + { + join('', &get_Numberstring($val, $gender), $_[0]); + } +} + +sub do_cmd_storeNumberstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{NNUMBERSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = join('', &get_Numberstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeNumberstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = join('', &get_Numberstring($val, $gender)); + + $_; +} + +sub do_cmd_NUMBERstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', uc(&get_numberstring($num,$gender)), $_); +} + +sub do_cmd_NUMBERstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{CAPNUMBERSTRING{', $ctr, '}}', $_); + } + else + { + join('', uc(&get_numberstring($val, $gender)), $_); + } +} + +sub do_cmd_storeNUMBERstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{CAPNUMBERSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = uc(&get_numberstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeNUMBERstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = uc(&get_numberstring($val, $gender)); + + $_; +} + +sub get_ordinalstringenglish{ + local($num) = @_; + local($name)=""; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = &get_numberstring($num/1000); + $name .= $thousands; + + if ($num%1000 > 0) + { + $name .= " $thousandname"; + } + else + { + $name .= " $thousandthname"; + } + + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = &get_numberstring($num/100); + $name .= $hundreds; + + if ($num%100 > 0) + { + $name .= " $hundredname"; + } + else + { + $name .= " $hundredthname"; + } + + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " and "; } + + if ($num >= 20) + { + if ($num%10 > 0) + { + $name .= $tenstring[$num/10] . '-'; + } + else + { + $name .= $tenthstring[$num/10]; + } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenthstring[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitthstring[$num%10]; + } + } + + $name; +} + +sub get_ordinalstringfrench{ + local($num,$gender) = @_; + local($name)=""; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = ''; + + if ($num >= 2000) + { + $thousands = &get_numberstringfrench($num/1000,$gender).' '; + } + + $num = $num%1000; + + if ($num > 0) + { + $name .= $thousands . $thousandnamefrench; + } + else + { + $name .= $thousands . $thousandthnamefrench; + } + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = ''; + + if ($num >= 200) + { + $hundreds = &get_numberstringfrench($num/100,$gender).' '; + } + + $num = $num%100; + + if ($num > 0) + { + $name .= $hundreds . $hundrednamefrench; + } + else + { + $name .= $hundreds . $hundredthnamefrench; + } + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " "; } + + if ($num >= 20) + { + if ($frenchdialect eq 'france' and $num >= 70) + { + if ($num < 80) + { + if ($num%10 > 0) + { + $name .= $tenstringfrench[6]; + } + else + { + $name .= $tenthstringfrench[6]; + } + + if ($num%10 == 1) + { + $name .= ' et '; + } + else + { + $name .= '-'; + } + + $num = 10+($num%10); + } + else + { + $name .= 'quatre-vingt' . ($num==80?'i\`eme':'-'); + + if ($num >= 90) + { + $num = 10+($num%10); + } + } + } + elsif ($frenchdialect eq 'belgian' and $num >= 80) + { + $name .= 'quatre-vingt' . ($num==80?'i\`eme':'-'); + + if ($num >= 90) + { + $num = 10+($num%10); + } + } + else + { + if ($num%10 > 0) + { + $name .= $tenstringfrench[$num/10]; + } + else + { + $name .= $tenthstringfrench[$num/10]; + } + + if ($num%10 == 1) { $name .= ' et ';} + elsif ($num%10 > 0) { $name .= '-'; } + } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenthstringfrench[$num%10]; + } + elsif ($_[0] == 1) + { + $name = 'premi\`ere'; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitthstringfrench[$num%10]; + } + } + + $name; +} + +sub get_ordinalstringspanish{ + local($num,$gender) = @_; + local($name)=""; + local($str); + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + if ($num >= 2000) + { + local($thousands) = &get_ordinalstringspanish($num/1000); + + if ($gender eq 'f') + { + $thousands =~s/o(s?)$/a\1/; + } + + $name .= $thousands. " "; + } + else + { + $name = ""; + } + + $name .= "$thousandthnamespanish"; + + if ($gender eq 'f') + { + $name =~s/o$/a/; + } + + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = $hundredthstringspanish[$num/100]; + + if ($gender eq 'f') + { + $hundreds =~s/o$/a/; + } + + $name .= $hundreds; + + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " "; } + + local($lastbit)=""; + + if ($num >= 20) + { + $lastbit = $tenthstringspanish[$num/10]; + + if ($num%10 > 0) + { + $lastbit .= ' '; + } + + if ($gender eq 'f') + { + $lastbit =~s/o([ s]*)$/a\1/; + } + + $name .= $lastbit; + + $lastbit = ""; + } + + if (($num >= 10) && ($num < 20)) + { + $lastbit = $teenthstringspanish[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $lastbit = $unitthstringspanish[$num%10]; + } + + if ($gender eq 'f') + { + $lastbit =~s/o([ s]*)$/a\1/; + } + + $name .= $lastbit; + } + + $name; +} + +sub get_ordinalstringportuges{ + local($num,$gender) = @_; + local($name)=""; + local($str); + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + if ($num >= 2000) + { + local($thousands) = &get_ordinalstringportuges($num/1000); + + if ($gender eq 'f') + { + $thousands =~s/o(s?)$/a\1/; + } + + $name .= $thousands. " "; + } + else + { + $name = ""; + } + + $name .= "$thousandthnameportuges"; + + if ($gender eq 'f') + { + $name =~s/o$/a/; + } + + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = $hundredthstringportuges[$num/100]; + + if ($gender eq 'f') + { + $hundreds =~s/o$/a/; + } + + $name .= $hundreds; + + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= "-"; } + + local($lastbit)=""; + + if ($num >= 10) + { + $lastbit = $tenthstringportuges[$num/10]; + + if ($num%10 > 0) + { + $lastbit .= '-'; + } + + if ($gender eq 'f') + { + $lastbit =~s/o([ s]*)$/a\1/; + } + + $name .= $lastbit; + + $lastbit = ""; + } + + if (($num%10 > 0) || ($_[0] == 0)) + { + $lastbit = $unitthstringportuges[$num%10]; + } + + if ($gender eq 'f') + { + $lastbit =~s/o([ s]*)$/a\1/; + } + + $name .= $lastbit; + } + + $name; +} + +sub get_numberunderhundredthgerman{ + local($num,$gender)=@_; + local($name)=''; + + if ($num < 10) + { + if ($gender eq 'F') + { + $name = $unitthstringFgerman[$num]; + } + elsif ($gender eq 'N') + { + $name = $unitthstringNgerman[$num]; + } + else + { + $name = $unitthstringMgerman[$num]; + } + } + elsif ($num%10 == 0) + { + if ($gender eq 'F') + { + $name = $tenthstringFgerman[$num/10]; + } + elsif ($gender eq 'N') + { + $name = $tenthstringNgerman[$num/10]; + } + else + { + $name = $tenthstringMgerman[$num/10]; + } + } + else + { + local($tenth); + if ($gender eq 'F') + { + $tenth = $tenthstringFgerman[$num/10]; + } + elsif ($gender eq 'N') + { + $tenth = $tenthstringNgerman[$num/10]; + } + else + { + $tenth = $tenthstringMgerman[$num/10]; + } + + $name = join('und', $unitstringgerman[$num%10], $tenth); + } + + $name; +} + +sub get_ordinalstringgerman{ + local($orgnum,$gender) = @_; + local($name)=""; + local($suffix)=''; + + $gender = uc($gender); + + if ($gender eq 'F') + { + $suffix = 'ste'; + } + elsif ($gender eq 'N') + { + $suffix = 'stes'; + } + else + { + $suffix = 'ster'; + $gender = 'M'; + } + + local($num) = $orgnum; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000 and $num < 2000) + { + $name = &translate_commands("\\eintausend "); + } + elsif ($num >= 2000) + { + $name = &get_numberunderhundredgerman($num/1000) + . "tausend"; + } + + $num = $orgnum%1000; + + # is that it or is there more? + if ($orgnum >= 1000 and $num == 0) + { + $name .= $suffix; + return $name; + } + + if ($num >= 100 and $num < 200) + { + if ($orgnum > 1000) + { + $name .= "einhundert"; + } + else + { + $name = &translate_commands("\\einhundert "); + } + } + elsif ($num >= 200) + { + $name .= $unitstringgerman[$num/100]."hundert"; + } + + $num = $num%100; + + # is that it or is there more? + if ($orgnum >= 100 and $num == 0) + { + $name .= $suffix; + return $name; + } + + if ($orgnum == 0) + { + if ($gender eq 'F') + { + $name = $unitthstringFgerman[0]; + } + elsif ($gender eq 'N') + { + $name = $unitthstringNgerman[0]; + } + else + { + $name = $unitthstringMgerman[0]; + } + } + elsif ($num > 0) + { + $name .= &get_numberunderhundredthgerman($num,$gender); + } + } + + $name; +} + +sub get_ordinalstring{ + local($val,$gender) = @_; + + if ($default_language eq 'french') + { + &get_ordinalstringfrench($val,$gender); + } + elsif ($default_language eq 'spanish') + { + &get_ordinalstringspanish($val,$gender); + } + elsif ($default_language eq 'portuges') + { + &get_ordinalstringportuges($val,$gender); + } + elsif ($default_language eq 'german' + or $default_language eq 'ngerman') + { + &get_ordinalstringgerman($val,$gender); + } + else + { + &get_ordinalstringenglish($val); + } +} + +sub do_cmd_ordinalstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', &get_ordinalstring($num,$gender), $_); +} + +sub do_cmd_ordinalstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{ORDINALSTRING{', $ctr, '}}', $_); + } + else + { + join('', &get_ordinalstring($val, $gender), $_); + } +} + + %fmtcntvar = (); + +sub do_cmd_FMCuse{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $fmtcntvar{$key}.$_; +} + +sub do_cmd_storeordinalstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{ORDINALSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = join('', &get_ordinalstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeordinalstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = join('', &get_ordinalstring($val, $gender)); + + $_; +} + +sub get_Ordinalstring{ + local($val,$gender) = @_; + local($string) = &get_ordinalstring($val,$gender); + + if ($default_language=~m/german/) + { + $string =~ s/\b([a-z])([^\s\-]+)/\u\1\2/; + } + else + { + $string =~ s/\b([a-z])([^\s\-]+)/\u\1\2/g; + + if ($default_language eq 'french') + { + $string =~ s/ Et / et /g; + } + else + { + $string =~ s/ And / and /g; + } + } + + $string; +} + +sub do_cmd_Ordinalstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', &get_Ordinalstring($num,$gender), $_); +} + +sub do_cmd_Ordinalstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{OORDINALSTRING{', $ctr, '}}', $_[0]); + } + else + { + join('', &get_Ordinalstring($val, $gender), $_[0]); + } +} + +sub do_cmd_storeOrdinalstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{OORDINALSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = join('', &get_Ordinalstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeOrdinalstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = join('', &get_Ordinalstring($val, $gender)); + + $_; +} + +sub do_cmd_ORDINALstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', uc(&get_ordinalstring($num,$gender)), $_); +} + +sub do_cmd_ORDINALstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{CAPORDINALSTRING{', $ctr, '}}', $_); + } + else + { + join('', uc(&get_ordinalstring($val, $gender)), $_); + } +} + +sub do_cmd_storeORDINALstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{CAPORDINALSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = uc(&get_ordinalstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeORDINALstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = uc(&get_ordinalstring($val, $gender)); + + $_; +} + +sub do_cmd_fmtcountsetoptions{ + local($_) = @_; + local($options) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($options=$2)); + + if ($options =~ m/french=?(\w*)(,|$)/) + { + if ($1 eq 'france' or $1 eq 'swiss' or $1 eq 'belgian') + { + $frenchdialect = $1; + + print "Using French dialect: $1" if ($VERBOSITY > 0) ; + } + elsif ($1 eq '') + { + $frenchdialect = 'france'; + + print "Using French dialect: france" if ($VERBOSITY > 0); + } + else + { + &write_warnings("unknown french dialect '$1'"); + } + } + + if ($options =~ m/abbrv=?(\w*)(,|$)/) + { + if ($1 eq 'true' or $1 eq '') + { + $ordinalabbrv = 1; + + print "Setting abbrv=true" if ($VERBOSITY > 0); + } + elsif ($1 eq 'false') + { + $ordinalabbrv = 0; + + print "Setting abbrv=false" if ($VERBOSITY > 0); + } + else + { + &write_warnings("fmtcountsetoptions key abbrv: unknown value '$1'."); + } + } + + if ($options =~ m/fmtord=(\w*)(,|$)/) + { + if ($1 eq 'raise') + { + &do_fmtcount_raise(); + + print "Using raised ordinals" if ($VERBOSITY > 0); + } + elsif ($1 eq 'level') + { + &do_fmtcount_level(); + + print "Using level ordinals" if ($VERBOSITY > 0); + } + elsif ($1 eq 'user') + { + # do nothing + + print "Using user defined fmtord" if ($VERBOSITY > 0); + } + else + { + &write_warnings("unknown fmtcount option fmtord=$1"); + } + } + + $_[0]; +} + +$padzeroes = 0; + +sub do_cmd_padzeroes{ + local($_) = @_; + local($val,$pat) = &get_next_optional_argument; + + if ($val eq '') + { + $padzeroes = 17; + } + else + { + $padzeroes = $val; + } + + $_; +} + +sub get_binary{ + local($num) = @_; + local($val) = ""; + + for (my $i=17; $i>=0; $i--) + { + if (($i < $padzeroes) || ($num & (1 << $i)) || !($val eq "")) + { + $val .= ($num & (1 << $i) ? 1 : 0); + } + } + + $val; +} + +sub do_cmd_binary{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_binary($val), $_); +} + +sub do_cmd_binarynum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_binary($num), $_); +} + +sub get_decimal{ + local($num) = @_; + + sprintf "%0${padzeroes}d", $num; +} + +sub do_cmd_decimal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_decimal($val), $_); +} + +sub do_cmd_decimalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_decimal($num), $_); +} + +sub get_hexadecimal{ + local($num) = @_; + + sprintf "%0${padzeroes}lx", $num; +} + +sub do_cmd_hexadecimal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_hexadecimal($val), $_); +} + +sub do_cmd_hexadecimalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_hexadecimal($num), $_); +} + +sub get_Hexadecimal{ + local($num) = @_; + + sprintf "%0${padzeroes}lX", $num; +} + +sub do_cmd_Hexadecimal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_Hexadecimal($val), $_); +} + +sub do_cmd_Hexadecimalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_Hexadecimal($num), $_); +} + +sub get_octal{ + local($num) = @_; + + sprintf "%0${padzeroes}lo", $num; +} + +sub do_cmd_octal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_octal($val), $_); +} + +sub do_cmd_octalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_octal($num), $_); +} + +sub get_aaalph{ + local($num) = @_; + local($rep) = int($num/26) + 1; + local($c) = chr(ord('a')-1+$num%26); + + local($_) = $c x $rep; +} + +sub do_cmd_aaalph{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_aaalph($val), $_); +} + +sub get_AAAlph{ + local($num) = @_; + local($rep) = int($num/26) + 1; + local($c) = chr(ord('A')-1+$num%26); + + local($_) = $c x $rep; +} + +sub do_cmd_AAAlph{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_AAAlph($val), $_); +} + +sub do_cmd_aaalphnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', (sprintf "%${padzeroes}s", &get_aaalph($num)), $_); +} + +sub do_cmd_AAAlphnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', uc(sprintf "%${padzeroes}s", &get_aaalph($num)), $_); +} + +sub get_abalph{ + local($num) = @_; + local($str); + + if ($num == 0) + { + $str = ''; + } + elsif ($num > 0 && $num <= 26) + { + $str = chr(ord('a')-1+$num); + } + else + { + $str = &get_abalph(int($num/26)) . chr(ord('a')-1+($num%26)); + } + + $str; +} + +sub do_cmd_abalph{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', (sprintf "%${padzeroes}s", &get_abalph($val)), $_); +} + +sub do_cmd_abalphnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', (sprintf "%${padzeroes}s", &get_abalph($num)), $_); +} + +sub do_cmd_ABAlph{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', uc(sprintf "%${padzeroes}s", &get_abalph($val)), $_); +} + +sub do_cmd_ABAlphnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', uc(sprintf "%${padzeroes}s", &get_abalph($num)), $_); +} + +sub get_twodigit{ + local($num) = @_; + + sprintf "%02d", $num; +} + +sub do_cmd_twodigit{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + # this is a cludge + if ($num eq "THEDAY" or $num eq "THEYEAR" or $num eq "THEMONTH") + { + join('', 'TWODIGIT{', $num, '}', $_); + } + else + { + join('', &get_twodigit($num), $_); + } +} + +# this was put here to help with the definition of \datelatin + +sub do_cmd_romannumeral{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + # this is a cludge + if ($num eq "THEDAY" or $num eq "THEYEAR" or $num eq "THEMONTH") + { + join('', 'ROMANNUMERAL{', $num, '}', $_); + } + else + { + join('', &froman($num), $_); + } +} + +# load configuration file if it exists +# Note: The configuration file should be loaded before +# the package options are executed. + +# why doesn't this work? If I call this subroutine it +# causes an infinite loop. + +sub load_fmtcount_cfg{ + local($file,$found); + + $file = &fulltexpath('fmtcount.cfg'); + + $found = (-f $file); + + if (!$found) + { + foreach $texpath (split /$envkey/, $TEXINPUTS) + { + $file = "$texpath${dd}fmtcount.cfg"; + + last if ($found = (-f $file)); + } + } + + if ($found) + { + print "\nusing configuration file $file\n"; + + &slurp_input($file); + &pre_process; + &substitute_meta_cmds if (%new_command || %new_environment); + &wrap_shorthand_environments; + $_ = &translate_commands(&translate_environments($_)); + + print "\n processed size: ".length($_)."\n" if ($VERBOSITY>1) + } + else + { + print "\nNo configuation file fmtcount.cfg found\n" if ($VERBOSITY>1) + } +} + +1; diff --git a/Master/texmf-dist/doc/latex/fmtcount/latex2html/fmtcount.perl b/Master/texmf-dist/doc/latex/fmtcount/latex2html/fmtcount.perl index a0460f733b1..bc7d3b9fb4e 100644 --- a/Master/texmf-dist/doc/latex/fmtcount/latex2html/fmtcount.perl +++ b/Master/texmf-dist/doc/latex/fmtcount/latex2html/fmtcount.perl @@ -191,7 +191,7 @@ sub do_cmd_storeordinal{ local($_) = @_; local($key); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); local($ctr, $val, $id, $_) = &read_counter_value($_); @@ -221,10 +221,10 @@ sub do_cmd_storeordinalnum{ local($_) = @_; local($key, $val); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); - $val = &missing_braces + $val = &missing_braces unless (s/$next_pair_pr_rx/$val=$2;''/eo); my($gender)='m'; @@ -239,37 +239,37 @@ sub do_cmd_storeordinalnum{ $_; } -@unitthstring = ('zeroth', - 'first', - 'second', - 'third', - 'fourth', - 'fifth', - 'sixth', - 'seventh', - 'eighth', +@unitthstring = ('zeroth', + 'first', + 'second', + 'third', + 'fourth', + 'fifth', + 'sixth', + 'seventh', + 'eighth', 'ninth'); -@tenthstring = ('', - 'tenth', - 'twentieth', - 'thirtieth', - 'fortieth', - 'fiftieth', - 'sixtieth', - 'seventieth', - 'eightieth', +@tenthstring = ('', + 'tenth', + 'twentieth', + 'thirtieth', + 'fortieth', + 'fiftieth', + 'sixtieth', + 'seventieth', + 'eightieth', 'ninetieth'); -@teenthstring = ('tenth', - 'eleventh', - 'twelfth', - 'thirteenth', - 'fourteenth', - 'fifteenth', - 'sixteenth', - 'seventeenth', - 'eighteenth', +@teenthstring = ('tenth', + 'eleventh', + 'twelfth', + 'thirteenth', + 'fourteenth', + 'fifteenth', + 'sixteenth', + 'seventeenth', + 'eighteenth', 'nineteenth'); @unitstring = ('zero', @@ -348,42 +348,42 @@ sub get_numberstringenglish{ { $name .= $unitstring[$num%10]; } - } + } $name; } -@unitthstringfrench = ('zeroi\`eme', - 'uni\`eme', - 'deuxi\`eme', - 'troisi\`eme', - 'quatri\`eme', - 'cinqui\`eme', - 'sixi\`eme', - 'septi\`eme', - 'huiti\`eme', +@unitthstringfrench = ('zeroi\`eme', + 'uni\`eme', + 'deuxi\`eme', + 'troisi\`eme', + 'quatri\`eme', + 'cinqui\`eme', + 'sixi\`eme', + 'septi\`eme', + 'huiti\`eme', 'neuvi\`eme'); -@tenthstringfrench = ('', - 'dixi\`eme', - 'vingti\`eme', - 'trentri\`eme', - 'quaranti\`eme', - 'cinquanti\`eme', - 'soixanti\`eme', - 'septenti\`eme', - 'huitanti\`eme', +@tenthstringfrench = ('', + 'dixi\`eme', + 'vingti\`eme', + 'trentri\`eme', + 'quaranti\`eme', + 'cinquanti\`eme', + 'soixanti\`eme', + 'septenti\`eme', + 'huitanti\`eme', 'nonenti\`eme'); -@teenthstringfrench = ('dixi\`eme', - 'onzi\`eme', - 'douzi\`eme', - 'treizi\`eme', - 'quatorzi\`eme', - 'quinzi\`eme', - 'seizi\`eme', - 'dix-septi\`eme', - 'dix-huiti\`eme', +@teenthstringfrench = ('dixi\`eme', + 'onzi\`eme', + 'douzi\`eme', + 'treizi\`eme', + 'quatorzi\`eme', + 'quinzi\`eme', + 'seizi\`eme', + 'dix-septi\`eme', + 'dix-huiti\`eme', 'dix-neuvi\`eme'); @unitstringfrench = ('zero', @@ -424,37 +424,37 @@ $hundredthnamefrench = "centi\\`eme"; $thousandnamefrench = "mille"; $thousandthnamefrench = "mili\\`eme"; -@unitthstringspanish = ('cero', - 'primero', - 'segundo', - 'tercero', - 'cuarto', - 'quinto', - 'sexto', - 's\\\'eptimo', - 'octavo', +@unitthstringspanish = ('cero', + 'primero', + 'segundo', + 'tercero', + 'cuarto', + 'quinto', + 'sexto', + 's\\\'eptimo', + 'octavo', 'noveno'); -@tenthstringspanish = ('', - 'd\\\'ecimo', - 'vig\\\'esimo', - 'trig\\\'esimo', - 'cuadrag\\\'esimo', - 'quincuag\\\'esimo', - 'sexag\\\'esimo', - 'septuag\\\'esimo', - 'octog\\\'esimo', +@tenthstringspanish = ('', + 'd\\\'ecimo', + 'vig\\\'esimo', + 'trig\\\'esimo', + 'cuadrag\\\'esimo', + 'quincuag\\\'esimo', + 'sexag\\\'esimo', + 'septuag\\\'esimo', + 'octog\\\'esimo', 'nonag\\\'esimo'); -@teenthstringspanish = ('d\\\'ecimo', - 'und\\\'ecimo', - 'duod\\\'ecimo', - 'decimotercero', - 'decimocuarto', - 'decimoquinto', - 'decimosexto', - 'decimos\\\'eptimo', - 'decimoctavo', +@teenthstringspanish = ('d\\\'ecimo', + 'und\\\'ecimo', + 'duod\\\'ecimo', + 'decimotercero', + 'decimocuarto', + 'decimoquinto', + 'decimosexto', + 'decimos\\\'eptimo', + 'decimoctavo', 'decimonoveno'); @hundredthstringspanish = ('', @@ -528,26 +528,26 @@ $hundredthnamespanish = "centi\\`eme"; $thousandnamespanish = "mil"; $thousandthnamespanish = "mil\\'esimo"; -@unitthstringportuges = ('zero', - 'primeiro', - 'segundo', - 'terceiro', - 'quatro', - 'quinto', - 'sexto', - 's\\\'etimo', - 'oitavo', +@unitthstringportuges = ('zero', + 'primeiro', + 'segundo', + 'terceiro', + 'quatro', + 'quinto', + 'sexto', + 's\\\'etimo', + 'oitavo', 'nono'); -@tenthstringportuges = ('', - 'd\\\'ecimo', - 'vig\\\'esimo', - 'trig\\\'esimo', - 'quadrag\\\'esimo', - 'q\"uinquag\\\'esimo', - 'sexag\\\'esimo', - 'setuag\\\'esimo', - 'octog\\\'esimo', +@tenthstringportuges = ('', + 'd\\\'ecimo', + 'vig\\\'esimo', + 'trig\\\'esimo', + 'quadrag\\\'esimo', + 'q\"uinquag\\\'esimo', + 'sexag\\\'esimo', + 'setuag\\\'esimo', + 'octog\\\'esimo', 'nonag\\\'esimo'); @hundredthstringportuges = ('', @@ -615,11 +615,11 @@ sub get_numberstringfrench{ if ($gender eq 'f') { - $unitstringfrench[1] = 'une'; + $unitstringfrench[1] = 'une'; } else { - $unitstringfrench[1] = 'un'; + $unitstringfrench[1] = 'un'; } unless (($num >= 1000000) || ($num < 0)) @@ -688,7 +688,7 @@ sub get_numberstringfrench{ } } } - elsif ($frenchdialect eq 'belgian' + elsif ($frenchdialect eq 'belgian' && ($num >= 80) && ($num < 90)) { $name .= 'quatre-vingt' . ($num==80?'s':'-'); @@ -710,7 +710,7 @@ sub get_numberstringfrench{ { $name .= $unitstringfrench[$num%10]; } - } + } $name; } @@ -721,11 +721,11 @@ sub get_numberstringspanish{ if ($gender eq 'f') { - $unitstringspanish[1] = 'una'; + $unitstringspanish[1] = 'una'; } else { - $unitstringspanish[1] = 'uno'; + $unitstringspanish[1] = 'uno'; } unless (($num >= 1000000) || ($num < 0)) @@ -764,7 +764,6 @@ sub get_numberstringspanish{ if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " y "; } - if ($num >= 30) { $name .= $tenstringspanish[$num/10]; @@ -784,7 +783,7 @@ sub get_numberstringspanish{ { $name .= $unitstringspanish[$num%10]; } - } + } $name; } @@ -863,108 +862,108 @@ sub get_numberstringportuges{ { $name .= $unitstringportuges[$num%10]; } - } + } $name; } -@unitthstringMgerman = ('nullter', - 'erster', - 'zweiter', - 'dritter', - 'vierter', - 'f\\"unter', - 'sechster', - 'siebter', - 'achter', +@unitthstringMgerman = ('nullter', + 'erster', + 'zweiter', + 'dritter', + 'vierter', + 'f\\"unter', + 'sechster', + 'siebter', + 'achter', 'neunter'); -@tenthstringMgerman = ('', - 'zehnter', - 'zwanzigster', - 'drei\\ss igster', - 'vierzigster', - 'f\\"unfzigster', - 'sechzigster', - 'siebzigster', - 'achtzigster', +@tenthstringMgerman = ('', + 'zehnter', + 'zwanzigster', + 'drei\\ss igster', + 'vierzigster', + 'f\\"unfzigster', + 'sechzigster', + 'siebzigster', + 'achtzigster', 'neunzigster'); -@teenthstringMgerman = ('zehnter', - 'elfter', - 'zw\\"olfter', - 'dreizehnter', - 'vierzehnter', - 'f\\"unfzehnter', - 'sechzehnter', - 'siebzehnter', - 'achtzehnter', +@teenthstringMgerman = ('zehnter', + 'elfter', + 'zw\\"olfter', + 'dreizehnter', + 'vierzehnter', + 'f\\"unfzehnter', + 'sechzehnter', + 'siebzehnter', + 'achtzehnter', 'neunzehnter'); -@unitthstringFgerman = ('nullte', - 'erste', - 'zweite', - 'dritte', - 'vierte', - 'f\\"unfte', - 'sechste', - 'siebte', - 'achte', +@unitthstringFgerman = ('nullte', + 'erste', + 'zweite', + 'dritte', + 'vierte', + 'f\\"unfte', + 'sechste', + 'siebte', + 'achte', 'neunte'); -@tenthstringFgerman = ('', - 'zehnte', - 'zwanzigste', - 'drei\\ss igste', - 'vierzigste', - 'f\\"unfzigste', - 'sechzigste', - 'siebzigste', - 'achtzigste', +@tenthstringFgerman = ('', + 'zehnte', + 'zwanzigste', + 'drei\\ss igste', + 'vierzigste', + 'f\\"unfzigste', + 'sechzigste', + 'siebzigste', + 'achtzigste', 'neunzigste'); -@teenthstringFgerman = ('zehnte', - 'elfte', - 'zw\\"olfte', - 'dreizehnte', - 'vierzehnte', - 'f\\"unfzehnte', - 'sechzehnte', - 'siebzehnte', - 'achtzehnte', +@teenthstringFgerman = ('zehnte', + 'elfte', + 'zw\\"olfte', + 'dreizehnte', + 'vierzehnte', + 'f\\"unfzehnte', + 'sechzehnte', + 'siebzehnte', + 'achtzehnte', 'neunzehnte'); -@unitthstringNgerman = ('nulltes', - 'erstes', - 'zweites', - 'drittes', - 'viertes', - 'f\\"unte', - 'sechstes', - 'siebtes', - 'achtes', +@unitthstringNgerman = ('nulltes', + 'erstes', + 'zweites', + 'drittes', + 'viertes', + 'f\\"unte', + 'sechstes', + 'siebtes', + 'achtes', 'neuntes'); -@tenthstringNgerman = ('', - 'zehntes', - 'zwanzigstes', - 'drei\\ss igstes', - 'vierzigstes', - 'f\\"unfzigstes', - 'sechzigstes', - 'siebzigstes', - 'achtzigstes', +@tenthstringNgerman = ('', + 'zehntes', + 'zwanzigstes', + 'drei\\ss igstes', + 'vierzigstes', + 'f\\"unfzigstes', + 'sechzigstes', + 'siebzigstes', + 'achtzigstes', 'neunzigstes'); -@teenthstringNgerman = ('zehntes', - 'elftes', - 'zw\\"olftes', - 'dreizehntes', - 'vierzehntes', - 'f\\"unfzehntes', - 'sechzehntes', - 'siebzehntes', - 'achtzehntes', +@teenthstringNgerman = ('zehntes', + 'elftes', + 'zw\\"olftes', + 'dreizehntes', + 'vierzehntes', + 'f\\"unfzehntes', + 'sechzehntes', + 'siebzehntes', + 'achtzehntes', 'neunzehntes'); @unitstringgerman = ('null', @@ -1083,7 +1082,7 @@ sub get_numberstringgerman{ { $name .= &get_numberunderhundredgerman($num); } - } + } $name; } @@ -1103,7 +1102,7 @@ sub get_numberstring{ { &get_numberstringportuges($val,$gender); } - elsif ($default_language eq 'german' + elsif ($default_language eq 'german' or $default_language eq 'ngerman') { &get_numberstringgerman($val,$gender); @@ -1117,7 +1116,7 @@ sub get_numberstring{ sub do_cmd_numberstringnum{ local($_) = @_; local($num,$gender); - $num = &missing_braces unless + $num = &missing_braces unless s/$next_pair_pr_rx/$num=$2;''/eo; if (s/\[(m|f|n)\]//) @@ -1158,7 +1157,7 @@ sub do_cmd_storenumberstring{ local($_) = @_; local($key); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); local($ctr, $val, $id, $_) = &read_counter_value($_); @@ -1188,10 +1187,10 @@ sub do_cmd_storenumberstringnum{ local($_) = @_; local($key, $val); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); - $val = &missing_braces + $val = &missing_braces unless (s/$next_pair_pr_rx/$val=$2;''/eo); my($gender)='m'; @@ -1242,7 +1241,7 @@ sub get_Numberstring{ sub do_cmd_Numberstringnum{ local($_) = @_; local($num,$gender); - $num = &missing_braces + $num = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); if (s/\[(m|f|n)\]//) @@ -1283,7 +1282,7 @@ sub do_cmd_storeNumberstring{ local($_) = @_; local($key); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); local($ctr, $val, $id, $_) = &read_counter_value($_); @@ -1313,10 +1312,10 @@ sub do_cmd_storeNumberstringnum{ local($_) = @_; local($key, $val); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); - $val = &missing_braces + $val = &missing_braces unless (s/$next_pair_pr_rx/$val=$2;''/eo); my($gender)='m'; @@ -1334,7 +1333,7 @@ sub do_cmd_storeNumberstringnum{ sub do_cmd_NUMBERstringnum{ local($_) = @_; local($num,$gender); - $num = &missing_braces + $num = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); if (s/\[(m|f|n)\]//) @@ -1375,7 +1374,7 @@ sub do_cmd_storeNUMBERstring{ local($_) = @_; local($key); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); local($ctr, $val, $id, $_) = &read_counter_value($_); @@ -1405,10 +1404,10 @@ sub do_cmd_storeNUMBERstringnum{ local($_) = @_; local($key, $val); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); - $val = &missing_braces + $val = &missing_braces unless (s/$next_pair_pr_rx/$val=$2;''/eo); my($gender)='m'; @@ -1487,7 +1486,7 @@ sub get_ordinalstringenglish{ { $name .= $unitthstring[$num%10]; } - } + } $name; } @@ -1617,7 +1616,7 @@ sub get_ordinalstringfrench{ { $name .= $unitthstringfrench[$num%10]; } - } + } $name; } @@ -1639,7 +1638,7 @@ sub get_ordinalstringspanish{ { $thousands =~s/o(s?)$/a\1/; } - + $name .= $thousands. " "; } else @@ -1653,7 +1652,7 @@ sub get_ordinalstringspanish{ { $name =~s/o$/a/; } - + $num = $num%1000; } @@ -1667,7 +1666,7 @@ sub get_ordinalstringspanish{ { $hundreds =~s/o$/a/; } - + $name .= $hundreds; $num = $num%100; @@ -1711,7 +1710,7 @@ sub get_ordinalstringspanish{ } $name .= $lastbit; - } + } $name; } @@ -1733,7 +1732,7 @@ sub get_ordinalstringportuges{ { $thousands =~s/o(s?)$/a\1/; } - + $name .= $thousands. " "; } else @@ -1747,7 +1746,7 @@ sub get_ordinalstringportuges{ { $name =~s/o$/a/; } - + $num = $num%1000; } @@ -1761,7 +1760,7 @@ sub get_ordinalstringportuges{ { $hundreds =~s/o$/a/; } - + $name .= $hundreds; $num = $num%100; @@ -1801,7 +1800,7 @@ sub get_ordinalstringportuges{ } $name .= $lastbit; - } + } $name; } @@ -1950,7 +1949,7 @@ sub get_ordinalstringgerman{ { $name .= &get_numberunderhundredthgerman($num,$gender); } - } + } $name; } @@ -1984,7 +1983,7 @@ sub get_ordinalstring{ sub do_cmd_ordinalstringnum{ local($_) = @_; local($num,$gender); - $num = &missing_braces + $num = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); if (s/\[(m|f|n)\]//) @@ -2027,7 +2026,7 @@ sub do_cmd_FMCuse{ local($_) = @_; local($key); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); $fmtcntvar{$key}.$_; @@ -2037,7 +2036,7 @@ sub do_cmd_storeordinalstring{ local($_) = @_; local($key); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); local($ctr, $val, $id, $_) = &read_counter_value($_); @@ -2067,10 +2066,10 @@ sub do_cmd_storeordinalstringnum{ local($_) = @_; local($key, $val); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); - $val = &missing_braces + $val = &missing_braces unless (s/$next_pair_pr_rx/$val=$2;''/eo); my($gender)='m'; @@ -2113,7 +2112,7 @@ sub get_Ordinalstring{ sub do_cmd_Ordinalstringnum{ local($_) = @_; local($num,$gender); - $num = &missing_braces + $num = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); if (s/\[(m|f|n)\]//) @@ -2154,7 +2153,7 @@ sub do_cmd_storeOrdinalstring{ local($_) = @_; local($key); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); local($ctr, $val, $id, $_) = &read_counter_value($_); @@ -2184,10 +2183,10 @@ sub do_cmd_storeOrdinalstringnum{ local($_) = @_; local($key, $val); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); - $val = &missing_braces + $val = &missing_braces unless (s/$next_pair_pr_rx/$val=$2;''/eo); my($gender)='m'; @@ -2205,7 +2204,7 @@ sub do_cmd_storeOrdinalstringnum{ sub do_cmd_ORDINALstringnum{ local($_) = @_; local($num,$gender); - $num = &missing_braces + $num = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); if (s/\[(m|f|n)\]//) @@ -2246,7 +2245,7 @@ sub do_cmd_storeORDINALstring{ local($_) = @_; local($key); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); local($ctr, $val, $id, $_) = &read_counter_value($_); @@ -2276,10 +2275,10 @@ sub do_cmd_storeORDINALstringnum{ local($_) = @_; local($key, $val); - $key = &missing_braces + $key = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($key=$2)); - $val = &missing_braces + $val = &missing_braces unless (s/$next_pair_pr_rx/$val=$2;''/eo); my($gender)='m'; @@ -2410,7 +2409,7 @@ sub do_cmd_binarynum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', &get_binary($num), $_); } @@ -2430,7 +2429,7 @@ sub do_cmd_decimalnum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', &get_decimal($num), $_); } @@ -2450,7 +2449,7 @@ sub do_cmd_hexadecimalnum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', &get_hexadecimal($num), $_); } @@ -2470,7 +2469,7 @@ sub do_cmd_Hexadecimalnum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', &get_Hexadecimal($num), $_); } @@ -2490,7 +2489,7 @@ sub do_cmd_octalnum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', &get_octal($num), $_); } @@ -2526,7 +2525,7 @@ sub do_cmd_aaalphnum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', (sprintf "%${padzeroes}s", &get_aaalph($num)), $_); } @@ -2534,7 +2533,7 @@ sub do_cmd_AAAlphnum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', uc(sprintf "%${padzeroes}s", &get_aaalph($num)), $_); } @@ -2560,7 +2559,7 @@ sub get_abalph{ sub do_cmd_abalph{ local($ctr, $val, $id, $_) = &read_counter_value($_[0]); - + join('', (sprintf "%${padzeroes}s", &get_abalph($val)), $_); } @@ -2568,13 +2567,13 @@ sub do_cmd_abalphnum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', (sprintf "%${padzeroes}s", &get_abalph($num)), $_); } sub do_cmd_ABAlph{ local($ctr, $val, $id, $_) = &read_counter_value($_[0]); - + join('', uc(sprintf "%${padzeroes}s", &get_abalph($val)), $_); } @@ -2582,7 +2581,7 @@ sub do_cmd_ABAlphnum{ local($_) = @_; local($num) = &missing_braces unless (s/$next_pair_pr_rx/$num=$2;''/eo); - + join('', uc(sprintf "%${padzeroes}s", &get_abalph($num)), $_); } @@ -2630,7 +2629,7 @@ sub do_cmd_romannumeral{ # Note: The configuration file should be loaded before # the package options are executed. -# why doesn't this work? If I call this subroutine it +# why doesn't this work? If I call this subroutine it # causes an infinite loop. sub load_fmtcount_cfg{ diff --git a/Master/texmf-dist/doc/latex/fmtcount/source/fmtcount.dtx b/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx index 1ed4d0f8161..2bb59106fea 100644 --- a/Master/texmf-dist/doc/latex/fmtcount/source/fmtcount.dtx +++ b/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx @@ -1,13 +1,17 @@ %\iffalse -% fmtcount.dtx generated using makedtx version 0.91b (c) Nicola Talbot +% fmtcount.dtx generated using makedtx version 0.94b (c) Nicola Talbot % Command line args: +% -macrocode "fmtcount.perl" +% -setambles "fmtcount.perl=>\nopreamble\nopostamble" +% -comment "fmtcount.perl" % -src "(.+)\.(def)=>\1.\2" % -src "(.+)\.(sty)=>\1.\2" +% -src "(fmtcount\.perl)=>\1" % -doc "manual.tex" % -author "Nicola Talbot" % -dir "source" % fmtcount -% Created on 2007/6/14 21:12 +% Created on 2007/8/20 12:28 %\fi %\iffalse %<*package> @@ -36,41 +40,62 @@ %<*driver> \documentclass{ltxdoc} +\usepackage{color} \usepackage[colorlinks, bookmarks, bookmarksopen, - pdfauthor={N.L.C. Talbot}, + pdfauthor={Nicola L.C. Talbot}, pdftitle={fmtcount.sty: Displaying the Values of LaTeX Counters}, pdfkeywords={LaTeX,counter}]{hyperref} +\definecolor{defbackground}{rgb}{1,1,0.75} +\newsavebox\defsbox +\newlength\defwidth +\newenvironment{definition}{% +\setlength{\fboxsep}{4pt}\setlength{\fboxrule}{1.25pt}% +\begin{lrbox}{\defsbox}% +\setlength\defwidth\linewidth +\addtolength\defwidth{-2\fboxrule}% +\addtolength\defwidth{-2\fboxsep}% +\begin{minipage}{\defwidth}\flushleft +}{% +\end{minipage} +\end{lrbox}% +\vskip10pt +\noindent +\fcolorbox{black}{defbackground}{\usebox\defsbox}% +\vskip10pt +} +\OnlyDescription -\newcommand{\styname}[1]{\textsf{#1}}\newcommand{\clsname}[1]{\textsf{#1}}\newcommand{\cmdname}[1]{\texttt{\symbol{92}#1}} - +\newcommand{\sty}[1]{\textsf{#1}}\newcommand{\cls}[1]{\textsf{#1}} \begin{document} \DocInput{fmtcount.dtx} \end{document} %</driver> %\fi -% %\RecordChanges -%\CheckSum{7743} -%\def\filedate{14 June 2007} -%\def\fileversion{1.1} -%\def\filename{fmtcount.dtx} -%\def\docdate{26th May 2007} +%\CheckSum{7745} % -% \title{fmtcount.sty v\fileversion: Displaying the Values of +% \title{fmtcount.sty v1.3: Displaying the Values of %\LaTeX\ Counters} -% \author{Nicola L.C. Talbot} -% \date{\docdate} +% \author{Nicola L.C. Talbot\\[10pt] +% School of Computing Sciences\\ +% University of East Anglia\\ +% Norwich. NR4 7TJ.\\ +% United Kingdom.\\ +% \url{http://theoval.cmp.uea.ac.uk/~nlct/}} +% \date{20 Aug 2007} % \maketitle % \tableofcontents % \section{Introduction} -%The \styname{fmtcount} package provides commands to display +%The \sty{fmtcount} package provides commands to display %the values of \LaTeX\ counters in a variety of formats. It also %provides equivalent commands for actual numbers rather than -%counter names. Limited multilingual support is available. +%counter names. Limited multilingual support is available. +%Currently, there is only support for English, French (including +%Belgian and Swiss variations), Spanish, Portuguese and German. % %\section{Installation} % @@ -82,9 +107,12 @@ %This will create the files \texttt{fmtcount.sty} and %\texttt{fmtcount.perl}, along with several \texttt{.def} files. %Place \texttt{fmtcount.sty} and the \texttt{.def} files somewhere -%where \LaTeX\ will find them (e.g.\ \texttt{texmf/tex/latex/fmtcount/}) and place \texttt{fmtcount.perl} somewhere where \LaTeX2HTML -%will find it (e.g.\ latex2html/styles). Remember to refresh -%the \TeX\ database (using \texttt{texhash} under Linux, for +%where \LaTeX\ will find them (e.g.\ +%\texttt{texmf/tex/latex/fmtcount/}) and place \texttt{fmtcount.perl} +%somewhere where \LaTeX2HTML +%will find it (e.g.\ \texttt{latex2html/styles}). Remember to refresh +%the \TeX\ database (using \texttt{texhash} or \texttt{mktexlsr} +%under Linux, for %other operating systems check the manual.) % %\section{Available Commands} @@ -94,187 +122,285 @@ %that take a number as the argument. % % \DescribeMacro{\ordinal} -% The macro \verb"\ordinal{"\meta{counter}\verb!}! will -% print the value of a \LaTeX\ counter \meta{counter} as an ordinal, -% \DescribeMacro{\fmtord} -% where the macro \verb"\fmtord{"\meta{text}\verb!}! is used to format the st,nd,rd,th bit. -% By default the ordinal is formatted as a superscript, if the package option \texttt{level} -% is used, it is level with the text. -% For example, if the current section is 3, then \verb"\ordinal{section}" will produce -% the output: 3\textsuperscript{rd}. +%\begin{definition} +%\cs{ordinal}\marg{counter}\oarg{gender} +%\end{definition} +% This will print the value of a \LaTeX\ counter \meta{counter} as an +%ordinal, where the macro +%\DescribeMacro{\fmtord} +%\begin{definition} +%\cs{fmtord}\marg{text} +%\end{definition} +%is used to format the st, nd, rd, th bit. By default the ordinal is +%formatted as a superscript, if the package option \texttt{level} is +%used, it is level with the text. For example, if the current section +%is 3, then \verb"\ordinal{section}" will produce the output: +%3\textsuperscript{rd}. Note that the optional argument \meta{gender} +%occurs \emph{at the end}. This argument may only take one of +%the following values: \texttt{m} (masculine), \texttt{f} +%(feminine) or \texttt{n} (neuter.) If \meta{gender} is omitted, +%or if the given gender has no meaning in the current language, +%\texttt{m} is assumed. % -%\textbf{Note:} the \clsname{memoir} class also defines a command called -%\verb"\ordinal" which takes a number as an argument instead of a +%\textbf{Notes:} +%\begin{enumerate} +%\item the \cls{memoir} class also defines a command called +%\cs{ordinal} which takes a number as an argument instead of a %counter. In order to overcome this incompatiblity, if you want -%to use the \styname{fmtcount} package with the \clsname{memoir} class -%you should use \verb"\FCordinal" to access \styname{fmtcount}'s -%version of \verb"\ordinal", and use \verb"\ordinal" to use -%\clsname{memoir}'s version of that command. +%to use the \sty{fmtcount} package with the \cls{memoir} class +%you should use \DescribeMacro{\FCordinal}\cs{FCordinal} to access +%\sty{fmtcount}'s version of \cs{ordinal}, and use +%\cs{ordinal} to use \cls{memoir}'s version of that command. +% +%\item As with all commands which have an optional argument as the +%last argument, if the optional argument is omitted, any spaces +%following the final argument will be ignored. Whereas, if the +%optional argument is present, any spaces following the optional +%argument won't be ignored. so \verb"\ordinal{section} !" +%will produce: 3\textsuperscript{rd}! whereas +% \verb"\ordinal{section}[m] !" will produce: +%3\textsuperscript{rd} ! +%\end{enumerate} % %\DescribeMacro{\ordinalnum} -%The macro \verb"\ordinalnum" is like \verb!\ordinal! -%but takes an actual number rather than a counter as the -%argument. For example: \verb"\ordinalnum{3}" will +%\begin{definition} +%\cs{ordinalnum}\marg{n}\oarg{gender} +%\end{definition} +%This is like \cs{ordinal} but takes an actual number rather than a +%counter as the argument. For example: \verb"\ordinalnum{3}" will %produce: 3\textsuperscript{rd}. % % \DescribeMacro{\numberstring} -% The macro \verb"\numberstring{"\meta{counter}\verb!}! will print the value -% of \meta{counter} as text. E.g.\ \verb"\numberstring{section}" will produce: -% three. +%\begin{definition} +%\cs{numberstring}\marg{counter}\oarg{gender} +%\end{definition} +%This will print the value of \meta{counter} as text. E.g.\ +%\verb"\numberstring{section}" will produce: three. The optional +%argument is the same as that for \cs{ordinal}. +% % \DescribeMacro{\Numberstring} -% The macro \verb"\Numberstring{"\meta{counter}\verb!}! does the same as -% \verb"\numberstring", but with initial letters in uppercase. For -% example, \verb"\Numberstring{section}" will produce: Three. +%\begin{definition} +%\cs{Numberstring}\marg{counter}\oarg{gender} +%\end{definition} +%This does the same as \cs{numberstring}, but with initial letters in +%uppercase. For example, \verb"\Numberstring{section}" will produce: +%Three. +% %\DescribeMacro{\NUMBERstring} -%The macro \verb"\NUMBERstring{"\meta{counter}\verb'}' does the same -%as \verb"\numberstring", but converted to upper case. Note that +%\begin{definition} +%\cs{NUMBERstring}\marg{counter}\oarg{gender} +%\end{definition} +%This does the same as \cs{numberstring}, but converts the string to +%upper case. Note that %\verb"\MakeUppercase{\NUMBERstring{"\meta{counter}\verb'}}' doesn't -%work, due to the way that \verb"\MakeUppercase" expands its -%argument\footnote{See all the various postings to -%\texttt{comp.text.tex} about \cmdname{MakeUppercase}}. +%work, due to the way that \cs{MakeUppercase} expands its +%argument\footnote{See all the various postings to +%\texttt{comp.text.tex} about \cs{MakeUppercase}}. % %\DescribeMacro{\numberstringnum} +%\begin{definition} +%\cs{numberstringnum}\marg{n}\oarg{gender} +%\end{definition} %\DescribeMacro{\Numberstringnum} +%\begin{definition} +%\cs{Numberstringnum}\marg{n}\oarg{gender} +%\end{definition} %\DescribeMacro{\NUMBERstringnum} -%The macros \verb!\numberstringnum!, -%\verb!\Numberstringnum! and -%\verb"\NUMBERstringnum" work like -%\verb!\numberstring!, -%\verb!\Numberstring! and -%\verb"\NUMBERstring", respectively, but take an actual number +%\begin{definition} +%\cs{NUMBERstringnum}\marg{n}\oarg{gender} +%\end{definition} +%Theses macros work like +%\cs{numberstring}, \cs{Numberstring} and \cs{NUMBERstring}, +%respectively, but take an actual number %rather than a counter as the argument. For example: %\verb'\Numberstringnum{105}' will produce: One Hundred and Five. % -% % \DescribeMacro{\ordinalstring} -% The macro \verb"\ordinalstring{"\meta{counter}\verb!}! will print the -% value of \meta{counter} as a textual ordinal. E.g.\ -% \verb"\ordinalstring{section}" will produce: third. +%\begin{definition} +%\cs{ordinalstring}\marg{counter}\oarg{gender} +%\end{definition} +%This will print the value of \meta{counter} as a textual ordinal. +%E.g.\ \verb"\ordinalstring{section}" will produce: third. The +%optional argument is the same as that for \cs{ordinal}. +% % \DescribeMacro{\Ordinalstring} -% The macro \verb"\Ordinalstring{"\meta{counter}\verb!}! does the same as -% \verb"\ordinalstring", but with initial letters in uppercase. For example, -% \verb"\Ordinalstring{section}" will produce: Third. -% \DescribeMacro{\ORDINALstring} -% The macro \verb"\ORDINALstring{"\meta{counter}\verb!}! does the same as -%\verb"\ordinalstring", but with all words in upper case (see previous -%note about \cmdname{MakeUppercase}). +%\begin{definition} +%\cs{Ordinalstring}\marg{counter}\oarg{gender} +%\end{definition} +%This does the same as \cs{ordinalstring}, but with initial letters in +%uppercase. For example, \verb"\Ordinalstring{section}" will produce: +%Third. +% +%\DescribeMacro{\ORDINALstring} +%\begin{definition} +%\cs{ORDINALstring}\marg{counter}\oarg{gender} +%\end{definition} +%This does the same as \cs{ordinalstring}, but with all words in upper +%case (see previous note about \cs{MakeUppercase}). % %\DescribeMacro{\ordinalstringnum} +%\begin{definition} +%\cs{ordinalstringnum}\marg{n}\oarg{gender} +%\end{definition} %\DescribeMacro{\Ordinalstringnum} +%\begin{definition} +%\cs{Ordinalstringnum}\marg{n}\oarg{gender} +%\end{definition} %\DescribeMacro{\ORDINALstringnum} -%The macros \verb!\ordinalstringnum!, -%\verb!\Ordinalstringnum! and \cmdname{ORDINALstringnum} work like -%\verb!\ordinalstring!, -%\verb!\Ordinalstring! and \cmdname{ORDINALstring}, respectively, but take an actual number -%rather than a counter as the argument. For example, +%\begin{definition} +%\cs{ORDINALstringnum}\marg{n}\oarg{gender} +%\end{definition} +%These macros work like \cs{ordinalstring}, \cs{Ordinalstring} and +%\cs{ORDINALstring}, respectively, but take an actual number rather +%than a counter as the argument. For example, %\verb"\ordinalstringnum{3}" will produce: third. % %\changes{v.1.09}{21 Apr 2007}{store facility added} %As from version 1.09, textual representations can be stored for %later use. This overcomes the problems encountered when you -%attempt to use one of the above commands in \cmdname{edef}. +%attempt to use one of the above commands in \cs{edef}. % %Each of the following commands takes a label as the first argument, %the other arguments are as the analogous commands above. These %commands do not display anything, but store the textual %representation. This can later be retrieved using -%\DescribeMacro{\FMCuse}\cmdname{FMCuse}\{\meta{label}\}. -%Note: with \cmdname{storeordinal} and \cmdname{storeordinalnum}, the -%only bit that doesn't get expanded is \cmdname{fmtord}. So, for +%\DescribeMacro{\FMCuse} +%\begin{definition} +%\cs{FMCuse}\marg{label} +%\end{definition} +%Note: with \cs{storeordinal} and \cs{storeordinalnum}, the +%only bit that doesn't get expanded is \cs{fmtord}. So, for %example, \verb"\storeordinalnum{mylabel}{3}" will be stored as %\verb"3\relax \fmtord{rd}". % %\DescribeMacro{\storeordinal} -%\cmdname{storeordinal}\{\meta{label}\}\{\meta{counter}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeordinal}\marg{label}\marg{counter}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeordinalstring} -%\cmdname{storeordinalstring}\{\meta{label}\}\{\meta{counter}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeordinalstring}\marg{label}\marg{counter}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeOrdinalstring} -%\cmdname{storeOrdinalstring}\{\meta{label}\}\{\meta{counter}\}[\meta{gender}] +%\begin{definition} +%\cs{storeOrdinalstring}\marg{label}\marg{counter}\oarg{gender} +%\end{definition} %\par %\DescribeMacro{\storeORDINALstring} -%\cmdname{storeORDINALstring}\{\meta{label}\}\{\meta{counter}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeORDINALstring}\marg{label}\marg{counter}\oarg{gender} +%\end{definition} %\DescribeMacro{\storenumberstring} -%\cmdname{storenumberstring}\{\meta{label}\}\{\meta{counter}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storenumberstring}\marg{label}\marg{counter}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeNumberstring} -%\cmdname{storeNumberstring}\{\meta{label}\}\{\meta{counter}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeNumberstring}\marg{label}\marg{counter}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeNUMBERstring} -%\cmdname{storeNUMBERstring}\{\meta{label}\}\{\meta{counter}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeNUMBERstring}\marg{label}\marg{counter}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeordinalnum} -%\cmdname{storeordinalnum}\{\meta{label}\}\{\meta{number}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeordinalnum}\marg{label}\marg{number}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeordinalstringnum} -%\cmdname{storeordinalstring}\{\meta{label}\}\{\meta{number}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeordinalstring}\marg{label}\marg{number}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeOrdinalstringnum} -%\cmdname{storeOrdinalstringnum}\{\meta{label}\}\{\meta{number}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeOrdinalstringnum}\marg{label}\marg{number}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeORDINALstringnum} -%\cmdname{storeORDINALstringnum}\{\meta{label}\}\{\meta{number}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeORDINALstringnum}\marg{label}\marg{number}\oarg{gender} +%\end{definition} %\DescribeMacro{\storenumberstringnum} -%\cmdname{storenumberstring}\{\meta{label}\}\{\meta{number}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storenumberstring}\marg{label}\marg{number}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeNumberstringnum} -%\cmdname{storeNumberstring}\{\meta{label}\}\{\meta{number}\}[\meta{gender}] -%\par +%\begin{definition} +%\cs{storeNumberstring}\marg{label}\marg{number}\oarg{gender} +%\end{definition} %\DescribeMacro{\storeNUMBERstringnum} -%\cmdname{storeNUMBERstring}\{\meta{label}\}\{\meta{number}\}[\meta{gender}] +%\begin{definition} +%\cs{storeNUMBERstring}\marg{label}\marg{number}\oarg{gender} +%\end{definition} % % \DescribeMacro{\binary} %\changes{v2.4}{25 Sept 2004}{'binary added} -% The macro \verb"\binary{"\meta{counter}\verb!}! will print the +%\begin{definition} +%\cs{binary}\marg{counter} +%\end{definition} +%This will print the %value of \meta{counter} as a binary number. %E.g.\ \verb"\binary{section}" will produce: 11. The declaration -%\DescribeMacro{\padzeroes}\verb"\padzeroes["\meta{n}\verb!]! +%\DescribeMacro{\padzeroes} +%\begin{definition} +%\cs{padzeroes}\oarg{n} +%\end{definition}\noindent %will ensure numbers are written to \meta{n} digits, padding with %zeroes if necessary. E.g.\ \verb"\padzeroes[8]\binary{section}" -%will produce: 00000011. -% The default value for \meta{n} is 17. +%will produce: 00000011. The default value for \meta{n} is 17. % %\DescribeMacro{\binarynum} -%The macro \verb"\binarynum" is like \verb!\binary! -%but takes an actual number rather than a counter as the -%argument. For example: \verb"\binarynum{5}" will +%\begin{definition} +%\cs{binary}\marg{n} +%\end{definition} +%This is like \cs{binary} but takes an actual number rather than a +%counter as the argument. For example: \verb"\binarynum{5}" will %produce: 101. % -% \DescribeMacro{\octal} +%\DescribeMacro{\octal} %\changes{v2.4}{25 Sept 2004}{'octal added} -% The macro \verb"\octal{"\meta{counter}\verb!}! will print the -%value of \meta{counter} as an octal number. For example, if you -%have a counter called, say \texttt{mycounter}, and you set the -%value to 125, then \verb"\octal{mycounter}" will produce: 177. -% Again, the number will be padded with zeroes if necessary, -%depending on whether \verb"\padzeroes" has been used. +%\begin{definition} +%\cs{octal}\marg{counter} +%\end{definition} +%This will print the value of \meta{counter} as an octal number. For +%example, if you have a counter called, say \texttt{mycounter}, and +%you set the value to 125, then \verb"\octal{mycounter}" will produce: +%177. Again, the number will be padded with zeroes if necessary, +%depending on whether \cs{padzeroes} has been used. % %\DescribeMacro{\octalnum} -%The macro \verb"\octalnum" is like \verb!\octal! -%but takes an actual number rather than a counter as the -%argument. For example: \verb"\octalnum{125}" will +%\begin{definition} +%\cs{octalnum}\marg{n} +%\end{definition} +%This is like \cs{octal} but takes an actual number rather than a +%counter as the argument. For example: \verb"\octalnum{125}" will %produce: 177. % % \DescribeMacro{\hexadecimal} %\changes{v2.4}{25 Sept 2004}{'hexadecimal added} -% The macro \verb"\hexadecimal{"\meta{counter}\verb!}! will print -%the value of \meta{counter} as a hexadecimal number. Going back -%to the previous example, \verb"\hexadecimal{mycounter}" will -% produce: 7d. Again, the number will be padded with zeroes if -%necessary, depending on whether \verb"\padzeroes" has been used. -% \DescribeMacro{\Hexadecimal} -% \verb"\Hexadecimal{"\meta{counter}\verb!}! does the same thing, -%but uses uppercase characters, e.g.\ -% \verb"\Hexadecimal{mycounter}" will produce: 7D. +%\begin{definition} +%\cs{hexadecimal}\marg{counter} +%\end{definition} +%This will print the value of \meta{counter} as a hexadecimal number. +%Going back to the counter used in the previous example, +%\verb"\hexadecimal{mycounter}" will produce: 7d. Again, the number +%will be padded with zeroes if necessary, depending on whether +%\cs{padzeroes} has been used. +% +%\DescribeMacro{\Hexadecimal} +%\begin{definition} +%\cs{Hexadecimal}\marg{counter} +%\end{definition} +%This does the same thing, but uses uppercase characters, e.g.\ +%\verb"\Hexadecimal{mycounter}" will produce: 7D. % %\DescribeMacro{\hexadecimalnum} +%\begin{definition} +%\cs{hexadecimalnum}\marg{n} +%\end{definition} %\DescribeMacro{\Hexadecimalnum} -%The macros \verb"\hexadecimalnum" and -%\verb"\Hexadecimalnum" are like -%\verb!\hexadecimal! and \verb"\Hexadecimal" +%\begin{definition} +%\cs{Hexadecimalnum}\marg{n} +%\end{definition} +%These are like \cs{hexadecimal} and \cs{Hexadecimal} %but take an actual number rather than a counter as the %argument. For example: \verb"\hexadecimalnum{125}" will %produce: 7d, and \verb"\Hexadecimalnum{125}" will @@ -282,34 +408,47 @@ % %\DescribeMacro{\decimal} %\changes{v2.41}{22 Oct 2004}{'decimal added} -%The macro \verb"\decimal{"\meta{counter}\verb!}! is similar to -%\verb"\arabic" but the number can be padded with zeroes -% depending on whether \verb"\padzeroes" has been used. -%For example: \verb"\padzeroes[8]\decimal{section}" will -% produce: 00000005. +%\begin{definition} +%\cs{decimal}\marg{counter} +%\end{definition} +%This is similar to \cs{arabic} but the number can be padded with +%zeroes depending on whether \cs{padzeroes} has been used. For +%example: \verb"\padzeroes[8]\decimal{section}" will produce: +%00000005. % %\DescribeMacro{\decimalnum} -%The macro \verb"\decimalnum" is like \verb!\decimal! -%but takes an actual number rather than a counter as the -%argument. For example: \verb"\padzeroes[8]\decimalnum{5}" will -%produce: 00000005. +%\begin{definition} +%\cs{decimalnum}\marg{n} +%\end{definition} +%This is like \cs{decimal} but takes an actual number rather than a +%counter as the argument. For example: +%\verb"\padzeroes[8]\decimalnum{5}" will produce: 00000005. % % \DescribeMacro{\aaalph} %\changes{v2.4}{25 Sept 2004}{'aaalph added} -% The macro \verb"\aaalph{"\meta{counter}\verb!}! will print the -%value of \meta{counter} as: a b \ldots\ z aa bb \ldots\ zz etc. -% For example, \verb"\aaalpha{mycounter}" will produce: uuuuu if -%\texttt{mycounter} is set to 125. -% \DescribeMacro{\AAAlph} -% \verb"\AAAlph{"\meta{counter}\verb!}! does the same thing, but -%uses uppercase characters, e.g.\ -% \verb"\AAAlph{mycounter}" will produce: UUUUU. +%\begin{definition} +%\cs{aaalph}\marg{counter} +%\end{definition} +%This will print the value of \meta{counter} as: a b \ldots\ z aa bb +%\ldots\ zz etc. For example, \verb"\aaalpha{mycounter}" will +%produce: uuuuu if \texttt{mycounter} is set to 125. +% +%\DescribeMacro{\AAAlph} +%\begin{definition} +%\cs{AAAlph}\marg{counter} +%\end{definition} +%This does the same thing, but uses uppercase characters, e.g.\ +%\verb"\AAAlph{mycounter}" will produce: UUUUU. % %\DescribeMacro{\aaalphnum} +%\begin{definition} +%\cs{aaalphnum}\marg{n} +%\end{definition} %\DescribeMacro{\AAAlphnum} -%The macros \verb"\aaalphnum" and -%\verb"\AAAlphnum" are like -%\verb!\aaalph! and \verb"\AAAlph" +%\begin{definition} +%\cs{AAAlphnum}\marg{n} +%\end{definition} +%These macros are like \cs{aaalph} and \cs{AAAlph} %but take an actual number rather than a counter as the %argument. For example: \verb"\aaalphnum{125}" will %produce: uuuuu, and \verb"\AAAlphnum{125}" will @@ -317,20 +456,29 @@ % % \DescribeMacro{\abalph} %\changes{v2.4}{25 Sept 2004}{'abalph added} -% The macro \verb"\abalph{"\meta{counter}\verb!}! will print the -%value of \meta{counter} as: a b \ldots\ z aa ab \ldots\ az etc. -% For example, \verb"\abalpha{mycounter}" will produce: du if -%\texttt{mycounter} is set to 125. +%\begin{definition} +%\cs{abalph}\marg{counter} +%\end{definition} +%This will print the value of \meta{counter} as: a b \ldots\ z aa ab +%\ldots\ az etc. For example, \verb"\abalpha{mycounter}" will +%produce: du if \texttt{mycounter} is set to 125. +% % \DescribeMacro{\ABAlph} -% \verb"\ABAlph{"\meta{counter}\verb!}! does the same thing, but -%uses uppercase characters, e.g.\ -% \verb"\ABAlph{mycounter}" will produce: DU. +%\begin{definition} +%\cs{ABAlph}\marg{counter} +%\end{definition} +%This does the same thing, but uses uppercase characters, e.g.\ +%\verb"\ABAlph{mycounter}" will produce: DU. % %\DescribeMacro{\abalphnum} +%\begin{definition} +%\cs{abalphnum}\marg{n} +%\end{definition} %\DescribeMacro{\ABAlphnum} -%The macros \verb"\abalphnum" and -%\verb"\ABAlphnum" are like -%\verb!\abalph! and \verb"\ABAlph" +%\begin{definition} +%\cs{ABAlphnum}\marg{n} +%\end{definition} +%These macros are like \cs{abalph} and \cs{ABAlph} %but take an actual number rather than a counter as the %argument. For example: \verb"\abalphnum{125}" will %produce: du, and \verb"\ABAlphnum{125}" will @@ -349,26 +497,25 @@ %\noindent These can also be set using the command: % %\DescribeMacro{\fmtcountsetoptions} -%\verb"\fmtcountsetoptions{fmtord="\meta{type}\verb'}' -% +%\begin{definition} +%\cs{fmtcountsetoptions}\verb"{fmtord="\meta{type}\verb'}' +%\end{definition} %\noindent where \meta{type} is either \texttt{level} or %\texttt{raise}. % %\section{Multilingual Support} % -%Version 1.02 of the \styname{fmtcount} package now has +%Version 1.02 of the \sty{fmtcount} package now has %limited multilingual support. The following languages are %implemented: English, Spanish, Portuguese, French, French (Swiss) %and French (Belgian). German support was added in version %1.1\footnote{Thanks to K. H. Fricke for supplying the information}. % -% The package checks to see if the -%command \verb"\date"\meta{language} is defined\footnote{this -%will be true if you have loaded \styname{babel}}, and will -%load the code for those languages. The commands \verb"\ordinal", -%\verb"\ordinalstring" and \verb'\numberstring' (and their -%variants) will then be formatted in the currently -%selected language. +%The package checks to see if the command \cs{l@}\meta{language} is +%defined\footnote{this will be true if you have loaded \sty{babel}}, +%and will load the code for those languages. The commands +%\cs{ordinal}, \cs{ordinalstring} and \cs{numberstring} (and their +%variants) will then be formatted in the currently selected language. % %If the French language is selected, the French (France) version %will be used by default (e.g.\ soxiante-dix for 70). To @@ -376,7 +523,7 @@ %\verb"\fmtcountsetoptions{french="\meta{dialect}\verb'}' %where \meta{dialect} is either \texttt{swiss} or \texttt{belgian}. %You can also use this command to change the action of -%\verb"\ordinal". +%\cs{ordinal}. %\verb"\fmtcountsetoptions{abbrv=true}" to produce ordinals %of the form 2\textsuperscript{e} or %\verb"\fmtcountsetoptions{abbrv=false}" to produce ordinals @@ -387,27 +534,27 @@ % %The male gender for all languages is used by default, however the %feminine or neuter forms can be obtained by passing \texttt{f} or -%\texttt{n} as an optional argument to \verb"\ordinal", -%\verb!\ordinalnum! etc. For example: +%\texttt{n} as an optional argument to \cs{ordinal}, +%\cs{ordinalnum} etc. For example: %\verb"\numberstring{section}[f]". Note that the optional argument %comes \emph{after} the compulsory argument. If a gender is %not defined in a given language, the masculine version will %be used instead. % %Let me know if you find any spelling mistakes (has been known -%to happen in English, let alone other languages I'm not so -%familiar with.) If you want to add support for another language, +%to happen in English, let alone other languages with which I'm not so +%familiar.) If you want to add support for another language, %you will need to let me know how to form the numbers and ordinals -%from 0 to 99999 in that language for each gender. +%from~0 to~99999 in that language for each gender. % %\section{Configuration File \texttt{fmtcount.cfg}} % %You can save your preferred default settings to a file called %\texttt{fmtcount.cfg}, and place it on the \TeX\ path. These -%settings will then be loaded by the \styname{fmtcount} +%settings will then be loaded by the \sty{fmtcount} %package. % -%Note that if you are using the \styname{datetime} package, +%Note that if you are using the \sty{datetime} package, %the \texttt{datetime.cfg} configuration file will override %the \texttt{fmtcount.cfg} configuration file. %For example, if \texttt{datetime.cfg} has the line: @@ -418,7 +565,7 @@ %\begin{verbatim} %\fmtcountsetoptions{fmtord=level} %\end{verbatim} -%then the former definition of \verb"\fmtord" will take +%then the former definition of \cs{fmtord} will take %precedence. % %\section{LaTeX2HTML style} @@ -427,7 +574,7 @@ %The following limitations apply: % %\begin{itemize} -%\item \verb"\padzeroes" only has an effect in the preamble. +%\item \cs{padzeroes} only has an effect in the preamble. % %\item The configuration file %\texttt{fmtcount.cfg} is currently ignored. (This is because @@ -451,15 +598,9 @@ % %\section{Troubleshooting} % -%There is a FAQ available at: \url{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/}. +%There is a FAQ available at: +%\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/}. % -% \section{Contact Details} -% Dr Nicola Talbot\\ -% School of Computing Sciences\\ -% University of East Anglia\\ -% Norwich. NR4 7TJ.\\ -% United Kingdom.\\ -% \url{http://theoval.cmp.uea.ac.uk/~nlct/} % % %\StopEventually{} @@ -4518,43 +4659,49 @@ this number}% % This section deals with the code for |fmtcount.sty| % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{fmtcount}[2007/06/14 v1.1] +\ProvidesPackage{fmtcount}[2007/07/20 v1.3] \RequirePackage{ifthen} \RequirePackage{keyval} % \end{macrocode} % These commands need to be defined before the -% configuration file is loaded. +% configuration file is loaded.\changes{1.3}{2007/7/19}{no +%longer using xspace package} % % Define the macro to format the |st|, |nd|, |rd| or |th| of an % ordinal. +%\begin{macro}{\fmtord} % \begin{macrocode} -\providecommand{\fmtord}[1]{\textsuperscript{#1}} +\providecommand*{\fmtord}[1]{\textsuperscript{#1}} % \end{macrocode} -% Define |\padzeroes| to specify how many digits should be -% displayed. +%\end{macro} +%\begin{macro}{\padzeros} +%\begin{definition} +%\cs{padzeroes}\oarg{n} +%\end{definition} +% Specifies how many digits should be displayed for commands such as +% \cs{decimal} and \cs{binary}. % \begin{macrocode} \newcount\c@padzeroesN \c@padzeroesN=1\relax -\providecommand{\padzeroes}[1][17]{\c@padzeroesN=#1} +\providecommand*{\padzeroes}[1][17]{\c@padzeroesN=#1} % \end{macrocode} -% Load appropriate language definition files (I don't -% know if there is a standard way of detecting which -% languages are defined, so I'm just going to check -% if \verb"\date"\meta{language} is defined): +%\end{macro} +% Load appropriate language definition files: %\changes{v1.1}{14 June 2007}{added check for UKenglish, % british and USenglish babel settings} % \begin{macrocode} -\@ifundefined{dateenglish}{}{\input{fc-english.def}} +\@ifundefined{l@english}{}{\input{fc-english.def}} \@ifundefined{l@UKenglish}{}{\input{fc-UKenglish.def}} \@ifundefined{l@british}{}{\input{fc-british.def}} \@ifundefined{l@USenglish}{}{\input{fc-USenglish.def}} -\@ifundefined{datespanish}{}{\input{fc-spanish.def}} -\@ifundefined{dateportuges}{}{\input{fc-portuges.def}} -\@ifundefined{datefrench}{}{\input{fc-french.def}} -\@ifundefined{dategerman}{% -\@ifundefined{datengerman}{}{\input{fc-german.def}}}{% +\@ifundefined{l@spanish}{}{\input{fc-spanish.def}} +\@ifundefined{l@portuges}{}{\input{fc-portuges.def}} +\@ifundefined{l@french}{}{\input{fc-french.def}} +\@ifundefined{l@german}{% +\@ifundefined{l@ngerman}{}{\input{fc-german.def}}}{% \input{fc-german.def}} % \end{macrocode} +%\begin{macro}{\fmtcount@french} % Define keys for use with |\fmtcountsetoptions|. % Key to switch French dialects (Does babel store %this kind of information?) @@ -4573,6 +4720,7 @@ to load babel before loading fmtcount}}{ `belgian' or `swiss'}} }} % \end{macrocode} +%\end{macro} % Key to determine how to display the ordinal % \begin{macrocode} \define@key{fmtcount}{fmtord}{% @@ -4584,6 +4732,7 @@ to load babel before loading fmtcount}}{ {Option `fmtord' can only take the values `level', `raise' or `user'}}} % \end{macrocode} +%\begin{macro}{\iffmtord@abbrv} % Key to determine whether the ordinal should be abbreviated % (language dependent, currently only affects French ordinals.) % \begin{macrocode} @@ -4596,9 +4745,11 @@ or `user'}}} {Option `fmtord' can only take the values `true' or `false'}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\fmtcountsetoptions} % Define command to set options. % \begin{macrocode} -\newcommand{\fmtcountsetoptions}[1]{% +\newcommand*{\fmtcountsetoptions}[1]{% \def\fmtcount@fmtord{}% \setkeys{fmtcount}{#1}% \@ifundefined{datefrench}{}{% @@ -4627,6 +4778,7 @@ or `user'}}} }} } % \end{macrocode} +%\end{macro} % Load confguration file if it exists. This needs to be done % before the package options, to allow the user to override % the settings in the configuration file. @@ -4646,7 +4798,12 @@ or `user'}}} % \begin{macrocode} \ProcessOptions % \end{macrocode} -% Define macro that performs modulo arthmetic. This is used for the +%\begin{macro}{\@modulo} +%\begin{definition} +%\cs{@modulo}\marg{count reg}\marg{n} +%\end{definition} +% Sets the count register to be its value modulo \meta{n}. +% This is used for the % date, time, ordinal and numberstring commands. (The fmtcount % package was originally part of the datetime package.) % \begin{macrocode} @@ -4657,6 +4814,7 @@ or `user'}}} \multiply \@DT@modctr by #2\relax \advance #1 by -\@DT@modctr} % \end{macrocode} +%\end{macro} % The following registers are needed by |\@ordinal| etc % \begin{macrocode} \newcount\@ordinalctr @@ -4671,9 +4829,10 @@ or `user'}}} \newcount\@DT@loopN \newcount\@DT@X % \end{macrocode} -% Binary +%\begin{macro}{\binarynum} +% Converts a decimal number to binary, and display. % \begin{macrocode} -\newcommand{\@binary}[1]{% +\newcommand*{\@binary}[1]{% \@DT@padzeroestrue \@DT@loopN=17\relax \@strctr=\@DT@loopN @@ -4695,9 +4854,11 @@ or `user'}}} \let\binarynum=\@binary % \end{macrocode} -% Octal +%\end{macro} +%\begin{macro}{\octalnum} +% Converts a decimal number to octal, and displays. % \begin{macrocode} -\newcommand{\@octal}[1]{% +\newcommand*{\@octal}[1]{% \ifnum#1>32768 \PackageError{fmtcount}{Value of counter too large for \protect\@octal}{Maximum value 32768} \else @@ -4722,11 +4883,15 @@ or `user'}}} \fi} \let\octalnum=\@octal % \end{macrocode} -% Lowercase hexadecimal +%\end{macro} +%\begin{macro}{\hexadecimalnum} +% Converts a decimal number to a lowercase hexadecimal number, +% and displays it. % \begin{macrocode} -\newcommand{\@@hexadecimal}[1]{\ifcase#10\or1\or2\or3\or4\or5\or6\or7\or8\or9\or a\or b\or c\or d\or e\or f\fi} +\newcommand*{\@@hexadecimal}[1]{\ifcase#10\or1\or2\or3\or4\or5\or +6\or7\or8\or9\or a\or b\or c\or d\or e\or f\fi} -\newcommand{\@hexadecimal}[1]{% +\newcommand*{\@hexadecimal}[1]{% \@DT@padzeroestrue \@DT@loopN=5\relax \@strctr=\@DT@loopN @@ -4736,7 +4901,8 @@ or `user'}}} \loop \@DT@modctr=\@DT@X \divide\@DT@modctr by \@strctr -\ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\@@hexadecimal\@DT@modctr}% +\ifthenelse{\boolean{@DT@padzeroes}\and\(\@DT@modctr=0\)\and +\(\@DT@loopN>\c@padzeroesN\)}{}{\@@hexadecimal\@DT@modctr}% \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi \multiply\@DT@modctr by \@strctr \advance\@DT@X by -\@DT@modctr @@ -4748,12 +4914,14 @@ or `user'}}} \let\hexadecimalnum=\@hexadecimal % \end{macrocode} +%\end{macro} +%\begin{macro}{\Hexadecimalnum} % Uppercase hexadecimal % \begin{macrocode} -\newcommand{\@@Hexadecimal}[1]{\ifcase#10\or1\or2\or3\or4\or5\or6\or +\newcommand*{\@@Hexadecimal}[1]{\ifcase#10\or1\or2\or3\or4\or5\or6\or 7\or8\or9\or A\or B\or C\or D\or E\or F\fi} -\newcommand{\@Hexadecimal}[1]{% +\newcommand*{\@Hexadecimal}[1]{% \@DT@padzeroestrue \@DT@loopN=5\relax \@strctr=\@DT@loopN @@ -4775,9 +4943,11 @@ or `user'}}} \let\Hexadecimalnum=\@Hexadecimal % \end{macrocode} -% Uppercase alphabetical representation (a \ldots\ z aa \ldots\ zz) +%\end{macro} +%\begin{macro}{\aaalphnum} +% Lowercase alphabetical representation (a \ldots\ z aa \ldots\ zz) % \begin{macrocode} -\newcommand{\@aaalph}[1]{% +\newcommand*{\@aaalph}[1]{% \@DT@loopN=#1\relax \advance\@DT@loopN by -1\relax \divide\@DT@loopN by 26\relax @@ -4797,9 +4967,11 @@ or `user'}}} \let\aaalphnum=\@aaalph % \end{macrocode} +%\end{macro} +%\begin{macro}{\AAAlphnum} % Uppercase alphabetical representation (a \ldots\ z aa \ldots\ zz) % \begin{macrocode} -\newcommand{\@AAAlph}[1]{% +\newcommand*{\@AAAlph}[1]{% \@DT@loopN=#1\relax \advance\@DT@loopN by -1\relax \divide\@DT@loopN by 26\relax @@ -4819,11 +4991,14 @@ or `user'}}} \let\AAAlphnum=\@AAAlph % \end{macrocode} +%\end{macro} +%\begin{macro}{\abalphnum} % Lowercase alphabetical representation % \begin{macrocode} -\newcommand{\@abalph}[1]{% -\ifnum#1>17576 -\PackageError{fmtcount}{Value of counter too large for \protect\@abalph}{Maximum value 17576} +\newcommand*{\@abalph}[1]{% +\ifnum#1>17576\relax +\PackageError{fmtcount}{Value of counter too large for +\protect\@abalph}{Maximum value 17576}% \else \@DT@padzeroestrue \@strctr=17576\relax @@ -4832,7 +5007,8 @@ or `user'}}} \loop \@DT@modctr=\@DT@X \divide\@DT@modctr by \@strctr -\ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=1\)}{}{\@alph\@DT@modctr}% +\ifthenelse{\boolean{@DT@padzeroes}\and +\(\@DT@modctr=1\)}{}{\@alph\@DT@modctr}% \ifnum\@DT@modctr=1\else\@DT@padzeroesfalse\fi \multiply\@DT@modctr by \@strctr \advance\@DT@X by -\@DT@modctr @@ -4845,11 +5021,14 @@ or `user'}}} \let\abalphnum=\@abalph % \end{macrocode} +%\end{macro} +%\begin{macro}{\ABAlphnum} % Uppercase alphabetical representation % \begin{macrocode} -\newcommand{\@ABAlph}[1]{% -\ifnum#1>17576 -\PackageError{fmtcount}{Value of counter too large for \protect\@ABAlph}{Maximum value 17576} +\newcommand*{\@ABAlph}[1]{% +\ifnum#1>17576\relax +\PackageError{fmtcount}{Value of counter too large for +\protect\@ABAlph}{Maximum value 17576}% \else \@DT@padzeroestrue \@strctr=17576\relax @@ -4858,7 +5037,8 @@ or `user'}}} \loop \@DT@modctr=\@DT@X \divide\@DT@modctr by \@strctr -\ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=1\)}{}{\@Alph\@DT@modctr}% +\ifthenelse{\boolean{@DT@padzeroes}\and +\(\@DT@modctr=1\)}{}{\@Alph\@DT@modctr}% \ifnum\@DT@modctr=1\else\@DT@padzeroesfalse\fi \multiply\@DT@modctr by \@strctr \advance\@DT@X by -\@DT@modctr @@ -4871,6 +5051,8 @@ or `user'}}} \let\ABAlphnum=\@ABAlph % \end{macrocode} +%\end{macro} +%\begin{macro}{\@fmtc@count} % Recursive command to count number of characters in argument. % |\@strctr| should be set to zero before calling it. % \begin{macrocode} @@ -4881,7 +5063,9 @@ or `user'}}} \@fmtc@count#2\relax \fi} % \end{macrocode} -% Internal decimal macro: +%\end{macro} +%\begin{macro}{\@decimal} +% Format number as a decimal, possibly padded with zeroes in front. % \begin{macrocode} \newcommand{\@decimal}[1]{% \@strctr=0\relax @@ -4897,8 +5081,13 @@ or `user'}}} \let\decimalnum=\@decimal % \end{macrocode} -% This is a bit cumbersome. Previously \verb"\@ordinal" -% was defined in a similar way to \verb"\abalph" etc. +%\end{macro} +%\begin{macro}{\FCordinal} +%\begin{definition} +%\cs{FCordinal}\marg{number} +%\end{definition} +% This is a bit cumbersome. Previously \cs{@ordinal} +% was defined in a similar way to \cs{abalph} etc. % This ensured that the actual value of the counter was % written in the new label stuff in the .aux file. However % adding in an optional argument to determine the gender @@ -4907,39 +5096,60 @@ or `user'}}} % the cross-referencing stuff working, which is why % the optional argument comes \emph{after} the compulsory % argument, instead of the usual manner of placing it before. -% Version 1.04 changed \verb"\ordinal" to \verb"\FCordinal" +% Note however, that putting the optional argument means that +% any spaces will be ignored after the command if the optional +% argument is omitted. +% Version 1.04 changed \cs{ordinal} to \cs{FCordinal} % to prevent it clashing with the memoir class. % \begin{macrocode} \newcommand{\FCordinal}[1]{% \expandafter\protect\expandafter\ordinalnum{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} -% If \verb"\ordinal" isn't defined make \verb"\ordinal" a synonym -% for \verb"\FCordinal" to maintain compatibility with previous +%\end{macro} +%\begin{macro}{\ordinal} +% If \cs{ordinal} isn't defined make \cs{ordinal} a synonym +% for \cs{FCordinal} to maintain compatibility with previous % versions. % \begin{macrocode} \@ifundefined{ordinal}{\let\ordinal\FCordinal}{% \PackageWarning{fmtcount}{\string\ordinal \space already defined use \string\FCordinal \space instead.}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ordinalnum} % Display ordinal where value is given as a number or % count register instead of a counter: % \begin{macrocode} -\newcommand{\ordinalnum}[1]{\@ifnextchar[{\@ordinalnum{#1}}{% +\newcommand*{\ordinalnum}[1]{\@ifnextchar[{\@ordinalnum{#1}}{% \@ordinalnum{#1}[m]}} % \end{macrocode} -% Display ordinal according to gender (neuter added in v1.1): +%\end{macro} +%\begin{macro}{\@ordinalnum} +% Display ordinal according to gender (neuter added in v1.1, +% \cs{xspace} added in v1.2, and removed in v1.3\footnote{I +%couldn't get it to work consistently both with and without the +%optional argument}): % \begin{macrocode} \def\@ordinalnum#1[#2]{{% \ifthenelse{\equal{#2}{f}}{% -\protect\@ordinalF{#1}{\@fc@ordstr}}{% -\ifthenelse{\equal{#2}{n}}{% -\protect\@ordinalN{#1}{\@fc@ordstr}}{% -\ifthenelse{\equal{#2}{m}}{}{% -\PackageError{fmtcount}{Invalid gender option `#2'}{% -Available options are m, f or n}}% -\protect\@ordinalM{#1}{\@fc@ordstr}}}\@fc@ordstr}} + \protect\@ordinalF{#1}{\@fc@ordstr}% + }{% + \ifthenelse{\equal{#2}{n}}{% + \protect\@ordinalN{#1}{\@fc@ordstr}% + }{% + \ifthenelse{\equal{#2}{m}}{}{% + \PackageError{fmtcount}{Invalid gender option `#2'}{% + Available options are m, f or n}% + }% + \protect\@ordinalM{#1}{\@fc@ordstr}% + }% + }% +\@fc@ordstr +}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeordinal} % Store the ordinal (first argument % is identifying name, second argument is a counter.) % \begin{macrocode} @@ -4947,6 +5157,8 @@ Available options are m, f or n}}% \expandafter\protect\expandafter\storeordinalnum{#1}{% \expandafter\the\csname c@#2\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeordinalnum} % Store ordinal (first argument % is identifying name, second argument is a number or % count register.) @@ -4955,6 +5167,8 @@ Available options are m, f or n}}% \@ifnextchar[{\@storeordinalnum{#1}{#2}}{% \@storeordinalnum{#1}{#2}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@storeordinalnum} % Store ordinal according to gender: % \begin{macrocode} \def\@storeordinalnum#1#2[#3]{% @@ -4968,22 +5182,30 @@ Available options are m or f}}% \protect\@ordinalM{#2}{\@fc@ord}}}% \expandafter\let\csname @fcs@#1\endcsname\@fc@ord} % \end{macrocode} +%\end{macro} +%\begin{macro}{\FMCuse} % Get stored information: % \begin{macrocode} \newcommand*{\FMCuse}[1]{\csname @fcs@#1\endcsname} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ordinalstring} % Display ordinal as a string (argument is a counter) % \begin{macrocode} -\newcommand{\ordinalstring}[1]{% +\newcommand*{\ordinalstring}[1]{% \expandafter\protect\expandafter\ordinalstringnum{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ordinalstringnum} % Display ordinal as a string (argument is a count register or % number.) % \begin{macrocode} \newcommand{\ordinalstringnum}[1]{% \@ifnextchar[{\@ordinal@string{#1}}{\@ordinal@string{#1}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@ordinal@string} % Display ordinal as a string according to gender. % \begin{macrocode} \def\@ordinal@string#1[#2]{{% @@ -4996,21 +5218,27 @@ Available options are m or f}}% \string\ordinalstring}{Available options are m, f or f}}% \protect\@ordinalstringM{#1}{\@fc@ordstr}}}\@fc@ordstr}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeordinalstring} % Store textual representation of number. First argument is % identifying name, second argument is the counter set to the % required number. % \begin{macrocode} -\newcommand{\storeordinalstring}[2]{% +\newcommand*{\storeordinalstring}[2]{% \expandafter\protect\expandafter\storeordinalstringnum{#1}{% \expandafter\the\csname c@#2\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeordinalstringnum} % Store textual representation of number. First argument is % identifying name, second argument is a count register or number. % \begin{macrocode} -\newcommand{\storeordinalstringnum}[2]{% +\newcommand*{\storeordinalstringnum}[2]{% \@ifnextchar[{\@store@ordinal@string{#1}{#2}}{% \@store@ordinal@string{#1}{#2}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@store@ordinal@string} % Store textual representation of number according to gender. % \begin{macrocode} \def\@store@ordinal@string#1#2[#3]{% @@ -5024,19 +5252,25 @@ Available options are m or f}}% \protect\@ordinalstringM{#2}{\@fc@ordstr}}}% \expandafter\let\csname @fcs@#1\endcsname\@fc@ordstr} % \end{macrocode} +%\end{macro} +%\begin{macro}{\Ordinalstring} % Display ordinal as a string with initial letters in upper case % (argument is a counter) % \begin{macrocode} -\newcommand{\Ordinalstring}[1]{% +\newcommand*{\Ordinalstring}[1]{% \expandafter\protect\expandafter\Ordinalstringnum{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\Ordinalstringnum} % Display ordinal as a string with initial letters in upper case % (argument is a number or count register) % \begin{macrocode} -\newcommand{\Ordinalstringnum}[1]{% +\newcommand*{\Ordinalstringnum}[1]{% \@ifnextchar[{\@Ordinal@string{#1}}{\@Ordinal@string{#1}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@Ordinal@string} % Display ordinal as a string with initial letters in upper case % according to gender % \begin{macrocode} @@ -5050,23 +5284,29 @@ Available options are m or f}}% Available options are m, f or n}}% \protect\@OrdinalstringM{#1}{\@fc@ordstr}}}\@fc@ordstr}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeOrdinalstring} % Store textual representation of number, with initial letters in % upper case. First argument is identifying name, second argument % is the counter set to the % required number. % \begin{macrocode} -\newcommand{\storeOrdinalstring}[2]{% +\newcommand*{\storeOrdinalstring}[2]{% \expandafter\protect\expandafter\storeOrdinalstringnum{#1}{% \expandafter\the\csname c@#2\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeOrdinalstringnum} % Store textual representation of number, with initial letters in % upper case. First argument is identifying name, second argument % is a count register or number. % \begin{macrocode} -\newcommand{\storeOrdinalstringnum}[2]{% +\newcommand*{\storeOrdinalstringnum}[2]{% \@ifnextchar[{\@store@Ordinal@string{#1}{#2}}{% \@store@Ordinal@string{#1}{#2}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@store@Ordinal@string} % Store textual representation of number according to gender, % with initial letters in upper case. % \begin{macrocode} @@ -5081,20 +5321,27 @@ Available options are m or f}}% \protect\@OrdinalstringM{#2}{\@fc@ordstr}}}% \expandafter\let\csname @fcs@#1\endcsname\@fc@ordstr} % \end{macrocode} +%\end{macro} +% +%\begin{macro}{\storeORDINALstring} % Store upper case textual representation of ordinal. The first % argument is identifying name, the second argument is a counter. % \begin{macrocode} -\newcommand{\storeORDINALstring}[2]{% +\newcommand*{\storeORDINALstring}[2]{% \expandafter\protect\expandafter\storeORDINALstringnum{#1}{% \expandafter\the\csname c@#2\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeORDINALstringnum} % As above, but the second argument is a count register or a % number. % \begin{macrocode} -\newcommand{\storeORDINALstringnum}[2]{% +\newcommand*{\storeORDINALstringnum}[2]{% \@ifnextchar[{\@store@ORDINAL@string{#1}{#2}}{% \@store@ORDINAL@string{#1}{#2}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@store@ORDINAL@string} % Gender is specified as an optional argument at the end. % \begin{macrocode} \def\@store@ORDINAL@string#1#2[#3]{% @@ -5109,18 +5356,24 @@ Available options are m or f}}% \expandafter\edef\csname @fcs@#1\endcsname{% \noexpand\MakeUppercase{\@fc@ordstr}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ORDINALstring} % Display upper case textual representation of an ordinal. The % argument must be a counter. % \begin{macrocode} -\newcommand{\ORDINALstring}[1]{% +\newcommand*{\ORDINALstring}[1]{% \expandafter\protect\expandafter\ORDINALstringnum{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ORDINALstringnum} % As above, but the argument is a count register or a number. % \begin{macrocode} -\newcommand{\ORDINALstringnum}[1]{% +\newcommand*{\ORDINALstringnum}[1]{% \@ifnextchar[{\@ORDINAL@string{#1}}{\@ORDINAL@string{#1}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@ORDINAL@string} % Gender is specified as an optional argument at the end. % \begin{macrocode} \def\@ORDINAL@string#1[#2]{{% @@ -5134,20 +5387,26 @@ Available options are m, f or n}}% \protect\@ordinalstringM{#1}{\@fc@ordstr}}}% \MakeUppercase{\@fc@ordstr}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storenumberstring} % Convert number to textual respresentation, and store. First % argument is the identifying name, second argument is a counter % containing the number. % \begin{macrocode} -\newcommand{\storenumberstring}[2]{% +\newcommand*{\storenumberstring}[2]{% \expandafter\protect\expandafter\storenumberstringnum{#1}{% \expandafter\the\csname c@#2\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storenumberstringnum} % As above, but second argument is a number or count register. % \begin{macrocode} \newcommand{\storenumberstringnum}[2]{% \@ifnextchar[{\@store@number@string{#1}{#2}}{% \@store@number@string{#1}{#2}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@store@number@string} % Gender is given as optional argument, \emph{at the end}. % \begin{macrocode} \def\@store@number@string#1#2[#3]{% @@ -5161,18 +5420,26 @@ Available options are m, f or n}}% \protect\@numberstringM{#2}{\@fc@numstr}}}% \expandafter\let\csname @fcs@#1\endcsname\@fc@numstr} % \end{macrocode} +%\end{macro} +%\begin{macro}{\numberstring} % Display textual representation of a number. The argument % must be a counter. % \begin{macrocode} -\newcommand{\numberstring}[1]{% +\newcommand*{\numberstring}[1]{% \expandafter\protect\expandafter\numberstringnum{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\numberstringnum} % As above, but the argument is a count register or a number. % \begin{macrocode} -\newcommand{\numberstringnum}[1]{% -\@ifnextchar[{\@number@string{#1}}{\@number@string{#1}[m]}} +\newcommand*{\numberstringnum}[1]{% +\@ifnextchar[{\@number@string{#1}}{\@number@string{#1}[m]}% +} % \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@number@string} % Gender is specified as an optional argument \emph{at the end}. % \begin{macrocode} \def\@number@string#1[#2]{{% @@ -5185,19 +5452,25 @@ Available options are m, f or n}}% Available options are m, f or n}}% \protect\@numberstringM{#1}{\@fc@numstr}}}\@fc@numstr}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeNumberstring} % Store textual representation of number. First argument is % identifying name, second argument is a counter. % \begin{macrocode} -\newcommand{\storeNumberstring}[2]{% +\newcommand*{\storeNumberstring}[2]{% \expandafter\protect\expandafter\storeNumberstringnum{#1}{% \expandafter\the\csname c@#2\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeNumberstringnum} % As above, but second argument is a count register or number. % \begin{macrocode} \newcommand{\storeNumberstringnum}[2]{% \@ifnextchar[{\@store@Number@string{#1}{#2}}{% \@store@Number@string{#1}{#2}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@store@Number@string} % Gender is specified as an optional argument \emph{at the end}: % \begin{macrocode} \def\@store@Number@string#1#2[#3]{% @@ -5211,18 +5484,24 @@ Available options are m, f or n}}% \protect\@NumberstringM{#2}{\@fc@numstr}}}% \expandafter\let\csname @fcs@#1\endcsname\@fc@numstr} % \end{macrocode} +%\end{macro} +%\begin{macro}{\Numberstring} % Display textual representation of number. The argument must be % a counter. % \begin{macrocode} -\newcommand{\Numberstring}[1]{% +\newcommand*{\Numberstring}[1]{% \expandafter\protect\expandafter\Numberstringnum{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\Numberstringnum} % As above, but the argument is a count register or number. % \begin{macrocode} -\newcommand{\Numberstringnum}[1]{% +\newcommand*{\Numberstringnum}[1]{% \@ifnextchar[{\@Number@string{#1}}{\@Number@string{#1}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@Number@string} % Gender is specified as an optional argument at the end. % \begin{macrocode} \def\@Number@string#1[#2]{{% @@ -5235,6 +5514,8 @@ Available options are m, f or n}}% Available options are m, f or n}}% \protect\@NumberstringM{#1}{\@fc@numstr}}}\@fc@numstr}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeNUMBERstring} % Store upper case textual representation of number. The first % argument is identifying name, the second argument is a counter. % \begin{macrocode} @@ -5242,6 +5523,8 @@ Available options are m, f or n}}% \expandafter\protect\expandafter\storeNUMBERstringnum{#1}{% \expandafter\the\csname c@#2\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\storeNUMBERstringnum} % As above, but the second argument is a count register or a % number. % \begin{macrocode} @@ -5249,6 +5532,8 @@ Available options are m, f or n}}% \@ifnextchar[{\@store@NUMBER@string{#1}{#2}}{% \@store@NUMBER@string{#1}{#2}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@store@NUMBER@string} % Gender is specified as an optional argument at the end. % \begin{macrocode} \def\@store@NUMBER@string#1#2[#3]{% @@ -5263,18 +5548,24 @@ Available options are m or f}}% \expandafter\edef\csname @fcs@#1\endcsname{% \noexpand\MakeUppercase{\@fc@numstr}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\NUMBERstring} % Display upper case textual representation of a number. The % argument must be a counter. % \begin{macrocode} -\newcommand{\NUMBERstring}[1]{% +\newcommand*{\NUMBERstring}[1]{% \expandafter\protect\expandafter\NUMBERstringnum{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\NUMBERstringnum} % As above, but the argument is a count register or a number. % \begin{macrocode} -\newcommand{\NUMBERstringnum}[1]{% +\newcommand*{\NUMBERstringnum}[1]{% \@ifnextchar[{\@NUMBER@string{#1}}{\@NUMBER@string{#1}[m]}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@NUMBER@string} % Gender is specified as an optional argument at the end. % \begin{macrocode} \def\@NUMBER@string#1[#2]{{% @@ -5288,61 +5579,84 @@ Available options are m, f or n}}% \protect\@numberstringM{#1}{\@fc@numstr}}}% \MakeUppercase{\@fc@numstr}}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\binary} % Number representations in other bases. Binary: % \begin{macrocode} -\providecommand{\binary}[1]{% +\providecommand*{\binary}[1]{% \expandafter\protect\expandafter\@binary{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} -% Like \verb"\alph", but goes beyond 26. (a \ldots\ z aa \ldots zz \ldots) +%\end{macro} +%\begin{macro}{\aaalph} +% Like \verb"\alph", but goes beyond 26. +% (a \ldots\ z aa \ldots zz \ldots) % \begin{macrocode} -\providecommand{\aaalph}[1]{% +\providecommand*{\aaalph}[1]{% \expandafter\protect\expandafter\@aaalph{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\AAAlph} % As before, but upper case. % \begin{macrocode} -\providecommand{\AAAlph}[1]{% +\providecommand*{\AAAlph}[1]{% \expandafter\protect\expandafter\@AAAlph{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} -% Like \verb"\alph", but goes beyond 26. (a \ldots\ z ab \ldots az \ldots) +%\end{macro} +%\begin{macro}{\abalph} +% Like \verb"\alph", but goes beyond 26. +% (a \ldots\ z ab \ldots az \ldots) % \begin{macrocode} -\providecommand{\abalph}[1]{% +\providecommand*{\abalph}[1]{% \expandafter\protect\expandafter\@abalph{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\ABAlph} % As above, but upper case. % \begin{macrocode} -\providecommand{\ABAlph}[1]{% +\providecommand*{\ABAlph}[1]{% \expandafter\protect\expandafter\@ABAlph{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\hexadecimal} % Hexadecimal: % \begin{macrocode} -\providecommand{\hexadecimal}[1]{% +\providecommand*{\hexadecimal}[1]{% \expandafter\protect\expandafter\@hexadecimal{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\Hexadecimal} % As above, but in upper case. % \begin{macrocode} -\providecommand{\Hexadecimal}[1]{% +\providecommand*{\Hexadecimal}[1]{% \expandafter\protect\expandafter\@Hexadecimal{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\octal} % Octal: % \begin{macrocode} -\providecommand{\octal}[1]{% +\providecommand*{\octal}[1]{% \expandafter\protect\expandafter\@octal{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\decimal} % Decimal: % \begin{macrocode} -\providecommand{\decimal}[1]{% +\providecommand*{\decimal}[1]{% \expandafter\protect\expandafter\@decimal{% \expandafter\the\csname c@#1\endcsname}} % \end{macrocode} +%\end{macro} +% %\subsubsection{Multilinguage Definitions} +%\begin{macro}{\@setdef@ultfmtcount} % If multilingual support is provided, make \verb"\@numberstring" % etc use the correct language (if defined). % Otherwise use English definitions. "\@setdef@ultfmtcount" @@ -5367,94 +5681,127 @@ Available options are m, f or n}}% \let\@ordinalN=\@ordinalM } % \end{macrocode} -% Define a command to set macros to use "languagename": +%\end{macro} +%\begin{macro}{\@set@mulitling@fmtcount} +% This defines the number and ordinal string macros to use +% \cs{languagename}: % \begin{macrocode} \def\@set@mulitling@fmtcount{% -% +% \end{macrocode} +% The masculine version of \cs{numberstring}: +% \begin{macrocode} \def\@numberstringM{\@ifundefined{@numberstringM\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@numberstringM}}{% \csname @numberstringM\languagename\endcsname}}% -% +% \end{macrocode} +% The feminine version of \cs{numberstring}: +% \begin{macrocode} \def\@numberstringF{\@ifundefined{@numberstringF\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@numberstringF}}{% \csname @numberstringF\languagename\endcsname}}% -% +% \end{macrocode} +% The neuter version of \cs{numberstring}: +% \begin{macrocode} \def\@numberstringN{\@ifundefined{@numberstringN\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@numberstringN}}{% \csname @numberstringN\languagename\endcsname}}% -% +% \end{macrocode} +% The masculine version of \cs{Numberstring}: +% \begin{macrocode} \def\@NumberstringM{\@ifundefined{@NumberstringM\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@NumberstringM}}{% \csname @NumberstringM\languagename\endcsname}}% -% +% \end{macrocode} +% The feminine version of \cs{Numberstring}: +% \begin{macrocode} \def\@NumberstringF{\@ifundefined{@NumberstringF\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@NumberstringF}}{% \csname @NumberstringF\languagename\endcsname}}% -% +% \end{macrocode} +% The neuter version of \cs{Numberstring}: +% \begin{macrocode} \def\@NumberstringN{\@ifundefined{@NumberstringN\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@NumberstringN}}{% \csname @NumberstringN\languagename\endcsname}}% -% +% \end{macrocode} +% The masculine version of \cs{ordinal}: +% \begin{macrocode} \def\@ordinalM{\@ifundefined{@ordinalM\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@ordinalM}}{% \csname @ordinalM\languagename\endcsname}}% -% +% \end{macrocode} +% The feminine version of \cs{ordinal}: +% \begin{macrocode} \def\@ordinalF{\@ifundefined{@ordinalF\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@ordinalF}}{% \csname @ordinalF\languagename\endcsname}}% -% +% \end{macrocode} +% The neuter version of \cs{ordinal}: +% \begin{macrocode} \def\@ordinalN{\@ifundefined{@ordinalN\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@ordinalN}}{% \csname @ordinalN\languagename\endcsname}}% -% +% \end{macrocode} +% The masculine version of \cs{ordinalstring}: +% \begin{macrocode} \def\@ordinalstringM{\@ifundefined{@ordinalstringM\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@ordinalstringM}}{% \csname @ordinalstringM\languagename\endcsname}}% -% +% \end{macrocode} +% The feminine version of \cs{ordinalstring}: +% \begin{macrocode} \def\@ordinalstringF{\@ifundefined{@ordinalstringF\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@ordinalstringF}}{% \csname @ordinalstringF\languagename\endcsname}}% -% +% \end{macrocode} +% The neuter version of \cs{ordinalstring}: +% \begin{macrocode} \def\@ordinalstringN{\@ifundefined{@ordinalstringN\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@ordinalstringN}}{% \csname @ordinalstringN\languagename\endcsname}}% -% +% \end{macrocode} +% The masculine version of \cs{Ordinalstring}: +% \begin{macrocode} \def\@OrdinalstringM{\@ifundefined{@OrdinalstringM\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@OrdinalstringM}}{% \csname @OrdinalstringM\languagename\endcsname}}% -% +% \end{macrocode} +% The feminine version of \cs{Ordinalstring}: +% \begin{macrocode} \def\@OrdinalstringF{\@ifundefined{@OrdinalstringF\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language '\languagename' for command \string\@OrdinalstringF}}{% \csname @OrdinalstringF\languagename\endcsname}}% -% +% \end{macrocode} +% The neuter version of \cs{Ordinalstring}: +% \begin{macrocode} \def\@OrdinalstringN{\@ifundefined{@OrdinalstringN\languagename}{% \PackageError{fmtcount}{No support for language '\languagename'}{% The fmtcount package currently does not support language @@ -5462,6 +5809,7 @@ The fmtcount package currently does not support language \csname @OrdinalstringN\languagename\endcsname}} } % \end{macrocode} +%\end{macro} % Check to see if babel or ngerman packages have been loaded. % \begin{macrocode} \@ifpackageloaded{babel}{% @@ -5487,5 +5835,2690 @@ The fmtcount package currently does not support language %</fmtcount.sty> % \end{macrocode} %\fi +%\iffalse +% \begin{macrocode} +%<*fmtcount.perl> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +# File : fmtcount.perl +# Author : Nicola Talbot +# Date : 26 May 2007 +# Version : 1.05 +# Description : LaTeX2HTML implementation of fmtcount package + +package main; + +sub do_fmtcount_raise{ + local($tmp)=""; + + $tmp .= 'sub do_cmd_fmtord{'; + $tmp .= 'local($_) = @_;'; + $tmp .= 'local($suffix) = &missing_braces unless (s/$next_pair_pr_rx/$suffix=$2;\'\'/eo);'; + $tmp .= 'join("", "<SUP>",$suffix,"</SUP>",$_);'; + $tmp .='}'; + + eval($tmp); +} + +sub do_fmtcount_level{ + local($tmp)=""; + + $tmp .= 'sub do_cmd_fmtord{'; + $tmp .= 'local($_) = @_;'; + $tmp .= 'local($suffix) = &missing_braces unless (s/$next_pair_pr_rx/$suffix=$2;\'\'/eo);'; + $tmp .= 'join("", $suffix,$_);'; + $tmp .='}'; + + eval($tmp); +} + +if (not defined &do_cmd_fmtord) +{ + &do_fmtcount_raise(@_); +} + +$frenchdialect = 'france'; +$ordinalabbrv = 0; + +sub get_ordinal_suffix_english{ + local($num,$gender) = @_; + local($suffix); + + if ((($num % 10) == 1) && ($num%100 != 11)) + { + $suffix = 'st'; + } + elsif ((($num % 10) == 2) && ($num%100 != 12)) + { + $suffix = 'nd'; + } + elsif ((($num % 10) == 3) && ($num%100 != 13)) + { + $suffix = 'rd'; + } + else + { + $suffix = 'th'; + } + + $suffix; +} + +sub get_ordinal_suffix_french{ + local($num,$gender) = @_; + local($_); + + if ($ordinalabbrv > 0) + { + $_ = 'e'; + } + else + { + if ($num == 1) + { + $_ = ($gender eq 'f' ? 'ere' : 'er'); + } + else + { + $_ = 'eme'; + } + } +} + +sub get_ordinal_suffix_spanish{ + local($num,$gender) = @_; + + ($gender eq 'f' ? 'a' : 'o'); +} + +sub get_ordinal_suffix_portuges{ + local($num,$gender) = @_; + + ($gender eq 'f' ? 'a' : 'o'); +} + +sub get_ordinal_suffix_german{ + local($num,$gender) = @_; + + ''; +} + +sub get_ordinal_suffix_ngerman{ + local($num,$gender) = @_; + + ''; +} + +sub get_ordinal_suffix{ + local($num,$gender) = @_; + local($suffix,$suffixsub); + + $suffixsub = "get_ordinal_suffix_$default_language"; + + if (defined ($suffixsub)) + { + $suffix = &$suffixsub($num,$gender); + } + else + { + $suffix = &get_ordinal_suffix_english($num,$gender); + } + + $suffix; +} + +sub getordinal{ + local($num,$gender) = @_; + local($suffix) = &get_ordinal_suffix($num,$gender); + local($text)=''; + + if ($suffix eq '') + { + $text = $num; + } + else + { + local($br_id) = ++$global{'max_id'}; + $text = $num . "\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}"; + } + + $text; +} + +sub do_cmd_ordinalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + my($gender)='m'; + local($suffix)=''; + + if (s/\[([mfn])\]//) + { + $gender = $1; + } + + $suffix = &get_ordinal_suffix($num,$gender); + + local($br_id) = ++$global{'max_id'}; + join('', $num, "\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}", $_); +} + +sub do_cmd_FCordinal{ + &do_cmd_ordinal; +} + +sub do_cmd_ordinal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $str eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{ORDINAL{', $ctr, '}}', $_[0]); + } + else + { + join('', &getordinal($val, $gender), $_[0]); + } +} + +sub do_cmd_storeordinal{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{ORDINAL{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = &getordinal($val, $gender); + } + + $_; +} + +sub do_cmd_storeordinalnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = &getordinal($val, $gender); + + $_; +} + +@unitthstring = ('zeroth', + 'first', + 'second', + 'third', + 'fourth', + 'fifth', + 'sixth', + 'seventh', + 'eighth', + 'ninth'); + +@tenthstring = ('', + 'tenth', + 'twentieth', + 'thirtieth', + 'fortieth', + 'fiftieth', + 'sixtieth', + 'seventieth', + 'eightieth', + 'ninetieth'); + +@teenthstring = ('tenth', + 'eleventh', + 'twelfth', + 'thirteenth', + 'fourteenth', + 'fifteenth', + 'sixteenth', + 'seventeenth', + 'eighteenth', + 'nineteenth'); + +@unitstring = ('zero', + 'one', + 'two', + 'three', + 'four', + 'five', + 'six', + 'seven', + 'eight', + 'nine'); + +@teenstring = ('ten', + 'eleven', + 'twelve', + 'thirteen', + 'fourteen', + 'fifteen', + 'sixteen', + 'seventeen', + 'eighteen', + 'nineteen'); +@tenstring = ('', + 'ten', + 'twenty', + 'thirty', + 'forty', + 'fifty', + 'sixty', + 'seventy', + 'eighty', + 'ninety'); + +$hundredname = "hundred"; +$hundredthname = "hundredth"; +$thousandname = "thousand"; +$thousandthname = "thousandth"; + +sub get_numberstringenglish{ + local($num) = @_; + local($name)=""; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = &get_numberstringenglish($num/1000); + $name .= $thousands . " $thousandname"; + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = &get_numberstringenglish($num/100); + $name .= $hundreds . " $hundredname"; + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " and "; } + + if ($num >= 20) + { + $name .= $tenstring[$num/10]; + + if ($num%10 > 0) { $name .= '-'; } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenstring[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitstring[$num%10]; + } + } + + $name; +} + +@unitthstringfrench = ('zeroi\`eme', + 'uni\`eme', + 'deuxi\`eme', + 'troisi\`eme', + 'quatri\`eme', + 'cinqui\`eme', + 'sixi\`eme', + 'septi\`eme', + 'huiti\`eme', + 'neuvi\`eme'); + +@tenthstringfrench = ('', + 'dixi\`eme', + 'vingti\`eme', + 'trentri\`eme', + 'quaranti\`eme', + 'cinquanti\`eme', + 'soixanti\`eme', + 'septenti\`eme', + 'huitanti\`eme', + 'nonenti\`eme'); + +@teenthstringfrench = ('dixi\`eme', + 'onzi\`eme', + 'douzi\`eme', + 'treizi\`eme', + 'quatorzi\`eme', + 'quinzi\`eme', + 'seizi\`eme', + 'dix-septi\`eme', + 'dix-huiti\`eme', + 'dix-neuvi\`eme'); + +@unitstringfrench = ('zero', + 'un', + 'deux', + 'trois', + 'quatre', + 'cinq', + 'six', + 'sept', + 'huit', + 'neuf'); + +@teenstringfrench = ('dix', + 'onze', + 'douze', + 'treize', + 'quatorze', + 'quinze', + 'seize', + 'dix-sept', + 'dix-huit', + 'dix-neuf'); + +@tenstringfrench = ('', + 'dix', + 'vingt', + 'trente', + 'quarante', + 'cinquante', + 'soixante', + 'septente', + 'huitante', + 'nonente'); + +$hundrednamefrench = "cent"; +$hundredthnamefrench = "centi\\`eme"; +$thousandnamefrench = "mille"; +$thousandthnamefrench = "mili\\`eme"; + +@unitthstringspanish = ('cero', + 'primero', + 'segundo', + 'tercero', + 'cuarto', + 'quinto', + 'sexto', + 's\\\'eptimo', + 'octavo', + 'noveno'); + +@tenthstringspanish = ('', + 'd\\\'ecimo', + 'vig\\\'esimo', + 'trig\\\'esimo', + 'cuadrag\\\'esimo', + 'quincuag\\\'esimo', + 'sexag\\\'esimo', + 'septuag\\\'esimo', + 'octog\\\'esimo', + 'nonag\\\'esimo'); + +@teenthstringspanish = ('d\\\'ecimo', + 'und\\\'ecimo', + 'duod\\\'ecimo', + 'decimotercero', + 'decimocuarto', + 'decimoquinto', + 'decimosexto', + 'decimos\\\'eptimo', + 'decimoctavo', + 'decimonoveno'); + +@hundredthstringspanish = ('', + 'cent\\\'esimo', + 'ducent\\\'esimo', + 'tricent\\\'esimo', + 'cuadringent\\\'esimo', + 'quingent\\\'esimo', + 'sexcent\\\'esimo', + 'septing\\\'esimo', + 'octingent\\\'esimo', + 'noningent\\\'esimo'); + +@unitstringspanish = ('cero', + 'uno', + 'dos', + 'tres', + 'cuatro', + 'cinco', + 'seis', + 'siete', + 'ocho', + 'nueve'); + +@teenstringspanish = ('diez', + 'once', + 'doce', + 'trece', + 'catorce', + 'quince', + 'diecis\\\'eis', + 'diecisiete', + 'dieciocho', + 'diecinueve'); + +@twentystringspanish = ('viente', + 'vientiuno', + 'vientid\\\'os', + 'vientitr\\\'es', + 'vienticuatro', + 'vienticinco', + 'vientis\\\'eis', + 'vientisiete', + 'vientiocho', + 'vientinueve'); + +@tenstringspanish = ('', + 'diez', + 'viente', + 'treinta', + 'cuarenta', + 'cincuenta', + 'sesenta', + 'setenta', + 'ochenta', + 'noventa'); + +@hundredstringspanish = ('', + 'ciento', + 'doscientos', + 'trescientos', + 'cuatrocientos', + 'quinientos', + 'seiscientos', + 'setecientos', + 'ochocientos', + 'novecientos'); + +$hundrednamespanish = "cien"; +$hundredthnamespanish = "centi\\`eme"; +$thousandnamespanish = "mil"; +$thousandthnamespanish = "mil\\'esimo"; + +@unitthstringportuges = ('zero', + 'primeiro', + 'segundo', + 'terceiro', + 'quatro', + 'quinto', + 'sexto', + 's\\\'etimo', + 'oitavo', + 'nono'); + +@tenthstringportuges = ('', + 'd\\\'ecimo', + 'vig\\\'esimo', + 'trig\\\'esimo', + 'quadrag\\\'esimo', + 'q\"uinquag\\\'esimo', + 'sexag\\\'esimo', + 'setuag\\\'esimo', + 'octog\\\'esimo', + 'nonag\\\'esimo'); + +@hundredthstringportuges = ('', + 'cent\\\'esimo', + 'ducent\\\'esimo', + 'trecent\\\'esimo', + 'quadringent\\\'esimo', + 'q\"uingent\\\'esimo', + 'seiscent\\\'esimo', + 'setingent\\\'esimo', + 'octingent\\\'esimo', + 'nongent\\\'esimo'); + +@unitstringportuges = ('zero', + 'um', + 'dois', + 'tr\^es', + 'quatro', + 'cinco', + 'seis', + 'sete', + 'oito', + 'nove'); + +@teenstringportuges = ('dez', + 'onze', + 'doze', + 'treze', + 'quatorze', + 'quinze', + 'dezesseis', + 'dezessete', + 'dezoito', + 'dezenove'); + +@tenstringportuges = ('', + 'dez', + 'vinte', + 'trinta', + 'quaranta', + 'cinq\"uenta', + 'sessenta', + 'setenta', + 'oitenta', + 'noventa'); + +@hundredstringportuges = ('', + 'cento', + 'duzentos', + 'trezentos', + 'quatrocentos', + 'quinhentos', + 'seiscentos', + 'setecentos', + 'oitocentos', + 'novecentos'); + +$hundrednameportuges = "cem"; +$thousandnameportuges = "mil"; +$thousandthnameportuges = "mil\\'esimo"; + +sub get_numberstringfrench{ + local($num,$gender) = @_; + local($name)=""; + + if ($gender eq 'f') + { + $unitstringfrench[1] = 'une'; + } + else + { + $unitstringfrench[1] = 'un'; + } + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = ''; + + if ($num >= 2000) + { + $thousands = &get_numberstringfrench($num/1000,$gender).' '; + } + + $name .= $thousands . $thousandnamefrench; + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = ''; + + if ($num >= 200) + { + $hundreds = &get_numberstringfrench($num/100,$gender).' '; + } + + $name .= $hundreds . $hundrednamefrench; + $num = $num%100; + + if (($_[0]%100 == 0) && ($_[0]/100 > 1)) + { + $name .= 's'; + } + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " "; } + + if ($num >= 20) + { + if ($frenchdialect eq 'france' and $num >= 70) + { + if ($num < 80) + { + $name .= $tenstringfrench[6]; + + if ($num%10 == 1) + { + $name .= ' et '; + } + else + { + $name .= '-'; + } + + $num = 10+($num%10); + } + else + { + $name .= 'quatre-vingt' . ($num==80?'s':'-'); + + if ($num >= 90) + { + $num = 10+($num%10); + } + } + } + elsif ($frenchdialect eq 'belgian' + && ($num >= 80) && ($num < 90)) + { + $name .= 'quatre-vingt' . ($num==80?'s':'-'); + } + else + { + $name .= $tenstringfrench[$num/10]; + + if ($num%10 == 1) { $name .= ' et ';} + elsif ($num%10 > 0) { $name .= '-'; } + } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenstringfrench[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitstringfrench[$num%10]; + } + } + + $name; +} + +sub get_numberstringspanish{ + local($num,$gender) = @_; + local($name)=""; + + if ($gender eq 'f') + { + $unitstringspanish[1] = 'una'; + } + else + { + $unitstringspanish[1] = 'uno'; + } + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = ''; + + if ($num >= 2000) + { + $thousands = &get_numberstringspanish($num/1000,$gender).' '; + } + + $name .= $thousands . $thousandnamespanish; + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = ''; + + if ($num > 100) + { + $hundreds = $hundredstringspanish[$num/100]; + } + else + { + $hundreds = 'cien'; + } + + $name .= $hundreds; + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " y "; } + + + if ($num >= 30) + { + $name .= $tenstringspanish[$num/10]; + + if ($num%10 > 0) { $name .= ' y '; } + } + + if (($num >=20) && ($num < 30)) + { + $name .= $twentystringspanish[$num%10]; + } + elsif (($num >= 10) && ($num < 20)) + { + $name .= $teenstringspanish[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitstringspanish[$num%10]; + } + } + + $name; +} + +sub get_numberstringportuges{ + local($num,$gender) = @_; + local($name)=""; + + if ($gender eq 'f') + { + $unitstringportuges[0] = 'zera'; + $unitstringportuges[1] = 'uma'; + $unitstringportuges[2] = 'duas'; + } + else + { + $unitstringportuges[0] = 'zero'; + $unitstringportuges[1] = 'um'; + $unitstringportuges[2] = 'dois'; + } + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = ''; + + if ($num >= 2000) + { + $thousands = &get_numberstringportuges($num/1000,$gender).' '; + } + + $name .= $thousands . $thousandnameportuges; + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = ''; + + if ($num > 100) + { + $hundreds = $hundredstringportuges[$num/100]; + + if ($gender eq 'f' and $num >= 200) + { + $hundreds =~s/o(s?)$/a\1/; + } + } + else + { + $hundreds = $hundrednameportuges; + } + + $name .= $hundreds; + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " e "; } + + if ($num >= 20) + { + $name .= $tenstringportuges[$num/10]; + + if ($num%10 == 1) { $name .= ' e ';} + elsif ($num%10 > 0) { $name .= ' '; } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenstringportuges[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitstringportuges[$num%10]; + } + } + + $name; +} + +@unitthstringMgerman = ('nullter', + 'erster', + 'zweiter', + 'dritter', + 'vierter', + 'f\\"unter', + 'sechster', + 'siebter', + 'achter', + 'neunter'); + +@tenthstringMgerman = ('', + 'zehnter', + 'zwanzigster', + 'drei\\ss igster', + 'vierzigster', + 'f\\"unfzigster', + 'sechzigster', + 'siebzigster', + 'achtzigster', + 'neunzigster'); + +@teenthstringMgerman = ('zehnter', + 'elfter', + 'zw\\"olfter', + 'dreizehnter', + 'vierzehnter', + 'f\\"unfzehnter', + 'sechzehnter', + 'siebzehnter', + 'achtzehnter', + 'neunzehnter'); + +@unitthstringFgerman = ('nullte', + 'erste', + 'zweite', + 'dritte', + 'vierte', + 'f\\"unfte', + 'sechste', + 'siebte', + 'achte', + 'neunte'); + +@tenthstringFgerman = ('', + 'zehnte', + 'zwanzigste', + 'drei\\ss igste', + 'vierzigste', + 'f\\"unfzigste', + 'sechzigste', + 'siebzigste', + 'achtzigste', + 'neunzigste'); + +@teenthstringFgerman = ('zehnte', + 'elfte', + 'zw\\"olfte', + 'dreizehnte', + 'vierzehnte', + 'f\\"unfzehnte', + 'sechzehnte', + 'siebzehnte', + 'achtzehnte', + 'neunzehnte'); + +@unitthstringNgerman = ('nulltes', + 'erstes', + 'zweites', + 'drittes', + 'viertes', + 'f\\"unte', + 'sechstes', + 'siebtes', + 'achtes', + 'neuntes'); + +@tenthstringNgerman = ('', + 'zehntes', + 'zwanzigstes', + 'drei\\ss igstes', + 'vierzigstes', + 'f\\"unfzigstes', + 'sechzigstes', + 'siebzigstes', + 'achtzigstes', + 'neunzigstes'); + +@teenthstringNgerman = ('zehntes', + 'elftes', + 'zw\\"olftes', + 'dreizehntes', + 'vierzehntes', + 'f\\"unfzehntes', + 'sechzehntes', + 'siebzehntes', + 'achtzehntes', + 'neunzehntes'); + +@unitstringgerman = ('null', + 'ein', # eins dealt with separately (this is for prefixes) + 'zwei', + 'drei', + 'vier', + 'f\\"unf', + 'sechs', + 'sieben', + 'acht', + 'neun'); + +@teenstringgerman = ('zehn', + 'elf', + 'zw\\"olf', + 'dreizehn', + 'vierzehn', + 'f\\"unfzehn', + 'sechzehn', + 'siebzehn', + 'achtzehn', + 'neunzehn'); + +@tenstringgerman = ('', + 'zehn', + 'zwanzig', + 'drei\\ss ig', + 'vierzig', + 'f\\"unfzig', + 'sechzig', + 'siebzig', + 'achtzig', + 'neunzig'); + +sub do_cmd_einhundert{ + local($_) = @_; + + "einhundert$_"; +} + +sub do_cmd_eintausend{ + local($_) = @_; + + "eintausend$_"; +} + +sub get_numberunderhundredgerman{ + local($num)=@_; + local($name)=''; + + if ($num == 1) + { + $name = 'eins'; + } + elsif ($num < 10) + { + $name = $unitstringgerman[$num]; + } + elsif ($num%10 == 0) + { + $name = $tenstringgerman[$num/10]; + } + else + { + $name = join('und', $unitstringgerman[$num%10], + $tenstringgerman[$num/10]); + } + + $name; +} + +sub get_numberstringgerman{ + local($orgnum,$gender) = @_; + local($name)=""; + + local($num) = $orgnum; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000 and $num < 2000) + { + $name = &translate_commands("\\eintausend "); + } + elsif ($num >= 2000) + { + $name = &get_numberunderhundredgerman($num/1000) + . "tausend"; + } + + $num = $orgnum%1000; + + if ($num >= 100 and $num < 200) + { + if ($orgnum > 1000) + { + $name .= "einhundert"; + } + else + { + $name = &translate_commands("\\einhundert "); + } + } + elsif ($num >= 200) + { + $name .= $unitstringgerman[$num/100]."hundert"; + } + + $num = $num%100; + + if ($orgnum == 0) + { + $name = 'null'; + } + elsif ($num > 0) + { + $name .= &get_numberunderhundredgerman($num); + } + } + + $name; +} + +sub get_numberstring{ + local($val,$gender) = @_; + + if ($default_language eq 'french') + { + &get_numberstringfrench($val,$gender); + } + elsif ($default_language eq 'spanish') + { + &get_numberstringspanish($val,$gender); + } + elsif ($default_language eq 'portuges') + { + &get_numberstringportuges($val,$gender); + } + elsif ($default_language eq 'german' + or $default_language eq 'ngerman') + { + &get_numberstringgerman($val,$gender); + } + else + { + &get_numberstringenglish($val); + } +} + +sub do_cmd_numberstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces unless + s/$next_pair_pr_rx/$num=$2;''/eo; + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', &get_numberstring($num,$gender), $_); +} + +sub do_cmd_numberstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{NUMBERSTRING{', $ctr, '}}', $_[0]); + } + else + { + join('', &get_numberstring($val, $gender), $_[0]); + } +} + +sub do_cmd_storenumberstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{NUMBERSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = join('', &get_numberstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storenumberstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = join('', &get_numberstring($val, $gender)); + + $_; +} + +sub get_Numberstring{ + local($val,$gender) = @_; + local($string) = &get_numberstring($val,$gender); + + if ($default_language=~m/german/) + { + $string =~ s/([a-z])([^\s\-]+)/\u\1\2/; + } + else + { + $string =~ s/([a-z])([^\s\-]+)/\u\1\2/g; + + if ($default_language eq 'french') + { + $string =~ s/ Et / et /g; + } + elsif ($default_language eq 'spanish') + { + $string =~ s/ Y / y /g; + } + elsif ($default_language eq 'portuges') + { + $string =~ s/ E / e /g; + } + else + { + $string =~ s/ And / and /g; + } + } + + $string; +} + +sub do_cmd_Numberstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', &get_Numberstring($num,$gender), $_); +} + +sub do_cmd_Numberstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{NNUMBERSTRING{', $ctr, '}}', $_[0]); + } + else + { + join('', &get_Numberstring($val, $gender), $_[0]); + } +} + +sub do_cmd_storeNumberstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{NNUMBERSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = join('', &get_Numberstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeNumberstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = join('', &get_Numberstring($val, $gender)); + + $_; +} + +sub do_cmd_NUMBERstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', uc(&get_numberstring($num,$gender)), $_); +} + +sub do_cmd_NUMBERstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{CAPNUMBERSTRING{', $ctr, '}}', $_); + } + else + { + join('', uc(&get_numberstring($val, $gender)), $_); + } +} + +sub do_cmd_storeNUMBERstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{CAPNUMBERSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = uc(&get_numberstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeNUMBERstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[([mfn])\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = uc(&get_numberstring($val, $gender)); + + $_; +} + +sub get_ordinalstringenglish{ + local($num) = @_; + local($name)=""; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = &get_numberstring($num/1000); + $name .= $thousands; + + if ($num%1000 > 0) + { + $name .= " $thousandname"; + } + else + { + $name .= " $thousandthname"; + } + + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = &get_numberstring($num/100); + $name .= $hundreds; + + if ($num%100 > 0) + { + $name .= " $hundredname"; + } + else + { + $name .= " $hundredthname"; + } + + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " and "; } + + if ($num >= 20) + { + if ($num%10 > 0) + { + $name .= $tenstring[$num/10] . '-'; + } + else + { + $name .= $tenthstring[$num/10]; + } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenthstring[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitthstring[$num%10]; + } + } + + $name; +} + +sub get_ordinalstringfrench{ + local($num,$gender) = @_; + local($name)=""; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + local($thousands) = ''; + + if ($num >= 2000) + { + $thousands = &get_numberstringfrench($num/1000,$gender).' '; + } + + $num = $num%1000; + + if ($num > 0) + { + $name .= $thousands . $thousandnamefrench; + } + else + { + $name .= $thousands . $thousandthnamefrench; + } + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = ''; + + if ($num >= 200) + { + $hundreds = &get_numberstringfrench($num/100,$gender).' '; + } + + $num = $num%100; + + if ($num > 0) + { + $name .= $hundreds . $hundrednamefrench; + } + else + { + $name .= $hundreds . $hundredthnamefrench; + } + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " "; } + + if ($num >= 20) + { + if ($frenchdialect eq 'france' and $num >= 70) + { + if ($num < 80) + { + if ($num%10 > 0) + { + $name .= $tenstringfrench[6]; + } + else + { + $name .= $tenthstringfrench[6]; + } + + if ($num%10 == 1) + { + $name .= ' et '; + } + else + { + $name .= '-'; + } + + $num = 10+($num%10); + } + else + { + $name .= 'quatre-vingt' . ($num==80?'i\`eme':'-'); + + if ($num >= 90) + { + $num = 10+($num%10); + } + } + } + elsif ($frenchdialect eq 'belgian' and $num >= 80) + { + $name .= 'quatre-vingt' . ($num==80?'i\`eme':'-'); + + if ($num >= 90) + { + $num = 10+($num%10); + } + } + else + { + if ($num%10 > 0) + { + $name .= $tenstringfrench[$num/10]; + } + else + { + $name .= $tenthstringfrench[$num/10]; + } + + if ($num%10 == 1) { $name .= ' et ';} + elsif ($num%10 > 0) { $name .= '-'; } + } + } + + if (($num >= 10) && ($num < 20)) + { + $name .= $teenthstringfrench[$num%10]; + } + elsif ($_[0] == 1) + { + $name = 'premi\`ere'; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $name .= $unitthstringfrench[$num%10]; + } + } + + $name; +} + +sub get_ordinalstringspanish{ + local($num,$gender) = @_; + local($name)=""; + local($str); + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + if ($num >= 2000) + { + local($thousands) = &get_ordinalstringspanish($num/1000); + + if ($gender eq 'f') + { + $thousands =~s/o(s?)$/a\1/; + } + + $name .= $thousands. " "; + } + else + { + $name = ""; + } + + $name .= "$thousandthnamespanish"; + + if ($gender eq 'f') + { + $name =~s/o$/a/; + } + + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = $hundredthstringspanish[$num/100]; + + if ($gender eq 'f') + { + $hundreds =~s/o$/a/; + } + + $name .= $hundreds; + + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= " "; } + + local($lastbit)=""; + + if ($num >= 20) + { + $lastbit = $tenthstringspanish[$num/10]; + + if ($num%10 > 0) + { + $lastbit .= ' '; + } + + if ($gender eq 'f') + { + $lastbit =~s/o([ s]*)$/a\1/; + } + + $name .= $lastbit; + + $lastbit = ""; + } + + if (($num >= 10) && ($num < 20)) + { + $lastbit = $teenthstringspanish[$num%10]; + } + elsif (($num%10 > 0) || ($_[0] == 0)) + { + $lastbit = $unitthstringspanish[$num%10]; + } + + if ($gender eq 'f') + { + $lastbit =~s/o([ s]*)$/a\1/; + } + + $name .= $lastbit; + } + + $name; +} + +sub get_ordinalstringportuges{ + local($num,$gender) = @_; + local($name)=""; + local($str); + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000) + { + if ($num >= 2000) + { + local($thousands) = &get_ordinalstringportuges($num/1000); + + if ($gender eq 'f') + { + $thousands =~s/o(s?)$/a\1/; + } + + $name .= $thousands. " "; + } + else + { + $name = ""; + } + + $name .= "$thousandthnameportuges"; + + if ($gender eq 'f') + { + $name =~s/o$/a/; + } + + $num = $num%1000; + } + + if ($num >= 100) + { + if ($_[0] >= 1000) { $name .= " "; } + + local($hundreds) = $hundredthstringportuges[$num/100]; + + if ($gender eq 'f') + { + $hundreds =~s/o$/a/; + } + + $name .= $hundreds; + + $num = $num%100; + } + + if (($_[0] > 100) && ($_[0]%100 > 0)) { $name .= "-"; } + + local($lastbit)=""; + + if ($num >= 10) + { + $lastbit = $tenthstringportuges[$num/10]; + + if ($num%10 > 0) + { + $lastbit .= '-'; + } + + if ($gender eq 'f') + { + $lastbit =~s/o([ s]*)$/a\1/; + } + + $name .= $lastbit; + + $lastbit = ""; + } + + if (($num%10 > 0) || ($_[0] == 0)) + { + $lastbit = $unitthstringportuges[$num%10]; + } + + if ($gender eq 'f') + { + $lastbit =~s/o([ s]*)$/a\1/; + } + + $name .= $lastbit; + } + + $name; +} + +sub get_numberunderhundredthgerman{ + local($num,$gender)=@_; + local($name)=''; + + if ($num < 10) + { + if ($gender eq 'F') + { + $name = $unitthstringFgerman[$num]; + } + elsif ($gender eq 'N') + { + $name = $unitthstringNgerman[$num]; + } + else + { + $name = $unitthstringMgerman[$num]; + } + } + elsif ($num%10 == 0) + { + if ($gender eq 'F') + { + $name = $tenthstringFgerman[$num/10]; + } + elsif ($gender eq 'N') + { + $name = $tenthstringNgerman[$num/10]; + } + else + { + $name = $tenthstringMgerman[$num/10]; + } + } + else + { + local($tenth); + if ($gender eq 'F') + { + $tenth = $tenthstringFgerman[$num/10]; + } + elsif ($gender eq 'N') + { + $tenth = $tenthstringNgerman[$num/10]; + } + else + { + $tenth = $tenthstringMgerman[$num/10]; + } + + $name = join('und', $unitstringgerman[$num%10], $tenth); + } + + $name; +} + +sub get_ordinalstringgerman{ + local($orgnum,$gender) = @_; + local($name)=""; + local($suffix)=''; + + $gender = uc($gender); + + if ($gender eq 'F') + { + $suffix = 'ste'; + } + elsif ($gender eq 'N') + { + $suffix = 'stes'; + } + else + { + $suffix = 'ster'; + $gender = 'M'; + } + + local($num) = $orgnum; + + unless (($num >= 1000000) || ($num < 0)) + { + if ($num >= 1000 and $num < 2000) + { + $name = &translate_commands("\\eintausend "); + } + elsif ($num >= 2000) + { + $name = &get_numberunderhundredgerman($num/1000) + . "tausend"; + } + + $num = $orgnum%1000; + + # is that it or is there more? + if ($orgnum >= 1000 and $num == 0) + { + $name .= $suffix; + return $name; + } + + if ($num >= 100 and $num < 200) + { + if ($orgnum > 1000) + { + $name .= "einhundert"; + } + else + { + $name = &translate_commands("\\einhundert "); + } + } + elsif ($num >= 200) + { + $name .= $unitstringgerman[$num/100]."hundert"; + } + + $num = $num%100; + + # is that it or is there more? + if ($orgnum >= 100 and $num == 0) + { + $name .= $suffix; + return $name; + } + + if ($orgnum == 0) + { + if ($gender eq 'F') + { + $name = $unitthstringFgerman[0]; + } + elsif ($gender eq 'N') + { + $name = $unitthstringNgerman[0]; + } + else + { + $name = $unitthstringMgerman[0]; + } + } + elsif ($num > 0) + { + $name .= &get_numberunderhundredthgerman($num,$gender); + } + } + + $name; +} + +sub get_ordinalstring{ + local($val,$gender) = @_; + + if ($default_language eq 'french') + { + &get_ordinalstringfrench($val,$gender); + } + elsif ($default_language eq 'spanish') + { + &get_ordinalstringspanish($val,$gender); + } + elsif ($default_language eq 'portuges') + { + &get_ordinalstringportuges($val,$gender); + } + elsif ($default_language eq 'german' + or $default_language eq 'ngerman') + { + &get_ordinalstringgerman($val,$gender); + } + else + { + &get_ordinalstringenglish($val); + } +} + +sub do_cmd_ordinalstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', &get_ordinalstring($num,$gender), $_); +} + +sub do_cmd_ordinalstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{ORDINALSTRING{', $ctr, '}}', $_); + } + else + { + join('', &get_ordinalstring($val, $gender), $_); + } +} + + %fmtcntvar = (); + +sub do_cmd_FMCuse{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $fmtcntvar{$key}.$_; +} + +sub do_cmd_storeordinalstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{ORDINALSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = join('', &get_ordinalstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeordinalstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = join('', &get_ordinalstring($val, $gender)); + + $_; +} + +sub get_Ordinalstring{ + local($val,$gender) = @_; + local($string) = &get_ordinalstring($val,$gender); + + if ($default_language=~m/german/) + { + $string =~ s/\b([a-z])([^\s\-]+)/\u\1\2/; + } + else + { + $string =~ s/\b([a-z])([^\s\-]+)/\u\1\2/g; + + if ($default_language eq 'french') + { + $string =~ s/ Et / et /g; + } + else + { + $string =~ s/ And / and /g; + } + } + + $string; +} + +sub do_cmd_Ordinalstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', &get_Ordinalstring($num,$gender), $_); +} + +sub do_cmd_Ordinalstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{OORDINALSTRING{', $ctr, '}}', $_[0]); + } + else + { + join('', &get_Ordinalstring($val, $gender), $_[0]); + } +} + +sub do_cmd_storeOrdinalstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{OORDINALSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = join('', &get_Ordinalstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeOrdinalstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = join('', &get_Ordinalstring($val, $gender)); + + $_; +} + +sub do_cmd_ORDINALstringnum{ + local($_) = @_; + local($num,$gender); + $num = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + if (s/\[(m|f|n)\]//) + { + $gender = $1; + } + else + { + $gender = 'm'; + } + + join('', uc(&get_ordinalstring($num,$gender)), $_); +} + +sub do_cmd_ORDINALstring{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + my($gender)='m'; + + $_[0] =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_[0]=~s/\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + join('', '{CAPORDINALSTRING{', $ctr, '}}', $_); + } + else + { + join('', uc(&get_ordinalstring($val, $gender)), $_); + } +} + +sub do_cmd_storeORDINALstring{ + local($_) = @_; + local($key); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + local($ctr, $val, $id, $_) = &read_counter_value($_); + my($gender)='m'; + + $_ =~ s/${OP}$id${CP}$ctr${OP}$id${CP}//; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + if ($ctr eq 'DAY' or $ctr eq 'MONTH' or $ctr eq 'YEAR') + { + # this is a cludge to make it work with newdateformat + $fmtcntvar{$key} = join('', '{CAPORDINALSTRING{', $ctr, '}}'); + } + else + { + $fmtcntvar{$key} = uc(&get_ordinalstring($val, $gender)); + } + + $_; +} + +sub do_cmd_storeORDINALstringnum{ + local($_) = @_; + local($key, $val); + + $key = &missing_braces + unless ((s/$next_pair_pr_rx//o)&&($key=$2)); + + $val = &missing_braces + unless (s/$next_pair_pr_rx/$val=$2;''/eo); + + my($gender)='m'; + + if ($_ =~s/\s*\[(.)\]//) + { + $gender = $1; + } + + $fmtcntvar{$key} = uc(&get_ordinalstring($val, $gender)); + + $_; +} + +sub do_cmd_fmtcountsetoptions{ + local($_) = @_; + local($options) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($options=$2)); + + if ($options =~ m/french=?(\w*)(,|$)/) + { + if ($1 eq 'france' or $1 eq 'swiss' or $1 eq 'belgian') + { + $frenchdialect = $1; + + print "Using French dialect: $1" if ($VERBOSITY > 0) ; + } + elsif ($1 eq '') + { + $frenchdialect = 'france'; + + print "Using French dialect: france" if ($VERBOSITY > 0); + } + else + { + &write_warnings("unknown french dialect '$1'"); + } + } + + if ($options =~ m/abbrv=?(\w*)(,|$)/) + { + if ($1 eq 'true' or $1 eq '') + { + $ordinalabbrv = 1; + + print "Setting abbrv=true" if ($VERBOSITY > 0); + } + elsif ($1 eq 'false') + { + $ordinalabbrv = 0; + + print "Setting abbrv=false" if ($VERBOSITY > 0); + } + else + { + &write_warnings("fmtcountsetoptions key abbrv: unknown value '$1'."); + } + } + + if ($options =~ m/fmtord=(\w*)(,|$)/) + { + if ($1 eq 'raise') + { + &do_fmtcount_raise(); + + print "Using raised ordinals" if ($VERBOSITY > 0); + } + elsif ($1 eq 'level') + { + &do_fmtcount_level(); + + print "Using level ordinals" if ($VERBOSITY > 0); + } + elsif ($1 eq 'user') + { + # do nothing + + print "Using user defined fmtord" if ($VERBOSITY > 0); + } + else + { + &write_warnings("unknown fmtcount option fmtord=$1"); + } + } + + $_[0]; +} + +$padzeroes = 0; + +sub do_cmd_padzeroes{ + local($_) = @_; + local($val,$pat) = &get_next_optional_argument; + + if ($val eq '') + { + $padzeroes = 17; + } + else + { + $padzeroes = $val; + } + + $_; +} + +sub get_binary{ + local($num) = @_; + local($val) = ""; + + for (my $i=17; $i>=0; $i--) + { + if (($i < $padzeroes) || ($num & (1 << $i)) || !($val eq "")) + { + $val .= ($num & (1 << $i) ? 1 : 0); + } + } + + $val; +} + +sub do_cmd_binary{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_binary($val), $_); +} + +sub do_cmd_binarynum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_binary($num), $_); +} + +sub get_decimal{ + local($num) = @_; + + sprintf "%0${padzeroes}d", $num; +} + +sub do_cmd_decimal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_decimal($val), $_); +} + +sub do_cmd_decimalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_decimal($num), $_); +} + +sub get_hexadecimal{ + local($num) = @_; + + sprintf "%0${padzeroes}lx", $num; +} + +sub do_cmd_hexadecimal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_hexadecimal($val), $_); +} + +sub do_cmd_hexadecimalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_hexadecimal($num), $_); +} + +sub get_Hexadecimal{ + local($num) = @_; + + sprintf "%0${padzeroes}lX", $num; +} + +sub do_cmd_Hexadecimal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_Hexadecimal($val), $_); +} + +sub do_cmd_Hexadecimalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_Hexadecimal($num), $_); +} + +sub get_octal{ + local($num) = @_; + + sprintf "%0${padzeroes}lo", $num; +} + +sub do_cmd_octal{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_octal($val), $_); +} + +sub do_cmd_octalnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', &get_octal($num), $_); +} + +sub get_aaalph{ + local($num) = @_; + local($rep) = int($num/26) + 1; + local($c) = chr(ord('a')-1+$num%26); + + local($_) = $c x $rep; +} + +sub do_cmd_aaalph{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_aaalph($val), $_); +} + +sub get_AAAlph{ + local($num) = @_; + local($rep) = int($num/26) + 1; + local($c) = chr(ord('A')-1+$num%26); + + local($_) = $c x $rep; +} + +sub do_cmd_AAAlph{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', &get_AAAlph($val), $_); +} + +sub do_cmd_aaalphnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', (sprintf "%${padzeroes}s", &get_aaalph($num)), $_); +} + +sub do_cmd_AAAlphnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', uc(sprintf "%${padzeroes}s", &get_aaalph($num)), $_); +} + +sub get_abalph{ + local($num) = @_; + local($str); + + if ($num == 0) + { + $str = ''; + } + elsif ($num > 0 && $num <= 26) + { + $str = chr(ord('a')-1+$num); + } + else + { + $str = &get_abalph(int($num/26)) . chr(ord('a')-1+($num%26)); + } + + $str; +} + +sub do_cmd_abalph{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', (sprintf "%${padzeroes}s", &get_abalph($val)), $_); +} + +sub do_cmd_abalphnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', (sprintf "%${padzeroes}s", &get_abalph($num)), $_); +} + +sub do_cmd_ABAlph{ + local($ctr, $val, $id, $_) = &read_counter_value($_[0]); + + join('', uc(sprintf "%${padzeroes}s", &get_abalph($val)), $_); +} + +sub do_cmd_ABAlphnum{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + join('', uc(sprintf "%${padzeroes}s", &get_abalph($num)), $_); +} + +sub get_twodigit{ + local($num) = @_; + + sprintf "%02d", $num; +} + +sub do_cmd_twodigit{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + # this is a cludge + if ($num eq "THEDAY" or $num eq "THEYEAR" or $num eq "THEMONTH") + { + join('', 'TWODIGIT{', $num, '}', $_); + } + else + { + join('', &get_twodigit($num), $_); + } +} + +# this was put here to help with the definition of \datelatin + +sub do_cmd_romannumeral{ + local($_) = @_; + local($num) = &missing_braces + unless (s/$next_pair_pr_rx/$num=$2;''/eo); + + # this is a cludge + if ($num eq "THEDAY" or $num eq "THEYEAR" or $num eq "THEMONTH") + { + join('', 'ROMANNUMERAL{', $num, '}', $_); + } + else + { + join('', &froman($num), $_); + } +} + +# load configuration file if it exists +# Note: The configuration file should be loaded before +# the package options are executed. + +# why doesn't this work? If I call this subroutine it +# causes an infinite loop. + +sub load_fmtcount_cfg{ + local($file,$found); + + $file = &fulltexpath('fmtcount.cfg'); + + $found = (-f $file); + + if (!$found) + { + foreach $texpath (split /$envkey/, $TEXINPUTS) + { + $file = "$texpath${dd}fmtcount.cfg"; + + last if ($found = (-f $file)); + } + } + + if ($found) + { + print "\nusing configuration file $file\n"; + + &slurp_input($file); + &pre_process; + &substitute_meta_cmds if (%new_command || %new_environment); + &wrap_shorthand_environments; + $_ = &translate_commands(&translate_environments($_)); + + print "\n processed size: ".length($_)."\n" if ($VERBOSITY>1) + } + else + { + print "\nNo configuation file fmtcount.cfg found\n" if ($VERBOSITY>1) + } +} + +1; +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%</fmtcount.perl> +% \end{macrocode} +%\fi %\Finale \endinput diff --git a/Master/texmf-dist/doc/latex/fmtcount/source/fmtcount.ins b/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins index 5342dd34fbd..ade931c60ae 100644 --- a/Master/texmf-dist/doc/latex/fmtcount/source/fmtcount.ins +++ b/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins @@ -1,35 +1,48 @@ -% fmtcount.ins generated using makedtx version 0.91b 2007/6/14 21:12 +% fmtcount.ins generated using makedtx version 0.94b 2007/8/20 12:28 \input docstrip \preamble -Copyright (C) 2007 Nicola Talbot, all rights reserved. -If you modify this file, you must change its name first. -You are NOT ALLOWED to distribute this file alone. You are NOT -ALLOWED to take money for the distribution or use of either this -file or a changed version, except for a nominal charge for copying -etc. + + fmtcount.dtx + Copyright 2007 Nicola Talbot + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either version 1.3 + of this license of (at your option) any later version. + The latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of LaTeX + version 2005/12/01 or later. + + This work has the LPPL maintenance status `maintained'. + + The Current Maintainer of this work is Nicola Talbot. + + This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. + \endpreamble \askforoverwritefalse -\generate{\file{fc-german.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-german.def,package}} -\file{fc-french.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-french.def,package}} +\generate{\file{fc-british.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-british.def,package}} \file{fc-english.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-english.def,package}} -\file{fc-USenglish.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-USenglish.def,package}} -\file{fmtcount.sty}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{fmtcount.dtx}{fmtcount.sty,package}} -\file{fc-UKenglish.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-UKenglish.def,package}} +\file{fc-french.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-french.def,package}} +\file{fc-german.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-german.def,package}} \file{fc-portuges.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-portuges.def,package}} -\file{fc-british.def}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-british.def,package}} \file{fc-spanish.def}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-spanish.def,package}} +\file{fc-UKenglish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-UKenglish.def,package}} +\file{fc-USenglish.def}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{fmtcount.dtx}{fc-USenglish.def,package}} +\file{fmtcount.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{fmtcount.dtx}{fmtcount.sty,package}} +\file{fmtcount.perl}{\nopreamble\nopostamble\from{fmtcount.dtx}{fmtcount.perl}} } \endbatchfile diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-UKenglish.def b/Master/texmf-dist/tex/latex/fmtcount/fc-UKenglish.def new file mode 100644 index 00000000000..2ae7b5c9d46 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-UKenglish.def @@ -0,0 +1,60 @@ +%% +%% This is file `fc-UKenglish.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fc-UKenglish.def,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{fc-UKenglish}[2007/06/14] +\@ifundefined{@ordinalMenglish}{\input{fc-english.def}}{} +\let\@ordinalMUKenglish\@ordinalMenglish +\let\@ordinalFUKenglish\@ordinalMenglish +\let\@ordinalNUKenglish\@ordinalMenglish +\let\@numberstringMUKenglish\@numberstringMenglish +\let\@numberstringFUKenglish\@numberstringMenglish +\let\@numberstringNUKenglish\@numberstringMenglish +\let\@NumberstringMUKenglish\@NumberstringMenglish +\let\@NumberstringFUKenglish\@NumberstringMenglish +\let\@NumberstringNUKenglish\@NumberstringMenglish +\let\@ordinalstringMUKenglish\@ordinalstringMenglish +\let\@ordinalstringFUKenglish\@ordinalstringMenglish +\let\@ordinalstringNUKenglish\@ordinalstringMenglish +\let\@OrdinalstringMUKenglish\@OrdinalstringMenglish +\let\@OrdinalstringFUKenglish\@OrdinalstringMenglish +\let\@OrdinalstringNUKenglish\@OrdinalstringMenglish +\endinput +%% +%% End of file `fc-UKenglish.def'. diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-USenglish.def b/Master/texmf-dist/tex/latex/fmtcount/fc-USenglish.def new file mode 100644 index 00000000000..ffe14d460f9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-USenglish.def @@ -0,0 +1,60 @@ +%% +%% This is file `fc-USenglish.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fc-USenglish.def,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{fc-USenglish}[2007/06/14] +\@ifundefined{@ordinalMenglish}{\input{fc-english.def}}{} +\let\@ordinalMUSenglish\@ordinalMenglish +\let\@ordinalFUSenglish\@ordinalMenglish +\let\@ordinalNUSenglish\@ordinalMenglish +\let\@numberstringMUSenglish\@numberstringMenglish +\let\@numberstringFUSenglish\@numberstringMenglish +\let\@numberstringNUSenglish\@numberstringMenglish +\let\@NumberstringMUSenglish\@NumberstringMenglish +\let\@NumberstringFUSenglish\@NumberstringMenglish +\let\@NumberstringNUSenglish\@NumberstringMenglish +\let\@ordinalstringMUSenglish\@ordinalstringMenglish +\let\@ordinalstringFUSenglish\@ordinalstringMenglish +\let\@ordinalstringNUSenglish\@ordinalstringMenglish +\let\@OrdinalstringMUSenglish\@OrdinalstringMenglish +\let\@OrdinalstringFUSenglish\@OrdinalstringMenglish +\let\@OrdinalstringNUSenglish\@OrdinalstringMenglish +\endinput +%% +%% End of file `fc-USenglish.def'. diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-british.def b/Master/texmf-dist/tex/latex/fmtcount/fc-british.def new file mode 100644 index 00000000000..ade516c7b12 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-british.def @@ -0,0 +1,60 @@ +%% +%% This is file `fc-british.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fc-british.def,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{fc-british}[2007/06/14] +\@ifundefined{@ordinalMenglish}{\input{fc-english.def}}{} +\let\@ordinalMbritish\@ordinalMenglish +\let\@ordinalFbritish\@ordinalMenglish +\let\@ordinalNbritish\@ordinalMenglish +\let\@numberstringMbritish\@numberstringMenglish +\let\@numberstringFbritish\@numberstringMenglish +\let\@numberstringNbritish\@numberstringMenglish +\let\@NumberstringMbritish\@NumberstringMenglish +\let\@NumberstringFbritish\@NumberstringMenglish +\let\@NumberstringNbritish\@NumberstringMenglish +\let\@ordinalstringMbritish\@ordinalstringMenglish +\let\@ordinalstringFbritish\@ordinalstringMenglish +\let\@ordinalstringNbritish\@ordinalstringMenglish +\let\@OrdinalstringMbritish\@OrdinalstringMenglish +\let\@OrdinalstringFbritish\@OrdinalstringMenglish +\let\@OrdinalstringNbritish\@OrdinalstringMenglish +\endinput +%% +%% End of file `fc-british.def'. diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-english.def b/Master/texmf-dist/tex/latex/fmtcount/fc-english.def new file mode 100644 index 00000000000..57350de33b0 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-english.def @@ -0,0 +1,478 @@ +%% +%% This is file `fc-english.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fc-english.def,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{fc-english}[2007/05/26] +\newcommand*{\@ordinalMenglish}[2]{% +\def\@fc@ord{}% +\@orgargctr=#1\relax +\@ordinalctr=#1% +\@modulo{\@ordinalctr}{100}% +\ifnum\@ordinalctr=11\relax + \def\@fc@ord{th}% +\else + \ifnum\@ordinalctr=12\relax + \def\@fc@ord{th}% + \else + \ifnum\@ordinalctr=13\relax + \def\@fc@ord{th}% + \else + \@modulo{\@ordinalctr}{10}% + \ifcase\@ordinalctr + \def\@fc@ord{th}% case 0 + \or \def\@fc@ord{st}% case 1 + \or \def\@fc@ord{nd}% case 2 + \or \def\@fc@ord{rd}% case 3 + \else + \def\@fc@ord{th}% default case + \fi + \fi + \fi +\fi +\edef#2{\number#1\relax\noexpand\fmtord{\@fc@ord}}% +} +\let\@ordinalFenglish=\@ordinalMenglish +\let\@ordinalNenglish=\@ordinalMenglish +\newcommand*{\@@unitstringenglish}[1]{% +\ifcase#1\relax +zero% +\or one% +\or two% +\or three% +\or four% +\or five% +\or six% +\or seven% +\or eight% +\or nine% +\fi +} +\newcommand*{\@@tenstringenglish}[1]{% +\ifcase#1\relax +\or ten% +\or twenty% +\or thirty% +\or forty% +\or fifty% +\or sixty% +\or seventy% +\or eighty% +\or ninety% +\fi +} +\newcommand*{\@@teenstringenglish}[1]{% +\ifcase#1\relax +ten% +\or eleven% +\or twelve% +\or thirteen% +\or fourteen% +\or fifteen% +\or sixteen% +\or seventeen% +\or eighteen% +\or nineteen% +\fi +} +\newcommand*{\@@Unitstringenglish}[1]{% +\ifcase#1\relax +Zero% +\or One% +\or Two% +\or Three% +\or Four% +\or Five% +\or Six% +\or Seven% +\or Eight% +\or Nine% +\fi +} +\newcommand*{\@@Tenstringenglish}[1]{% +\ifcase#1\relax +\or Ten% +\or Twenty% +\or Thirty% +\or Forty% +\or Fifty% +\or Sixty% +\or Seventy% +\or Eighty% +\or Ninety% +\fi +} +\newcommand*{\@@Teenstringenglish}[1]{% +\ifcase#1\relax +Ten% +\or Eleven% +\or Twelve% +\or Thirteen% +\or Fourteen% +\or Fifteen% +\or Sixteen% +\or Seventeen% +\or Eighteen% +\or Nineteen% +\fi +} +\newcommand*{\@@numberstringenglish}[2]{% +\ifnum#1>99999 +\PackageError{fmtcount}{Out of range}% +{This macro only works for values less than 100000}% +\else +\ifnum#1<0 +\PackageError{fmtcount}{Negative numbers not permitted}% +{This macro does not work for negative numbers, however +you can try typing "minus" first, and then pass the modulus of +this number}% +\fi +\fi +\def#2{}% +\@strctr=#1\relax \divide\@strctr by 1000\relax +\ifnum\@strctr>9 + \divide\@strctr by 10 + \ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1 \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr-\@unitstring{\@strctr}}% + \fi + \else + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@thousand}% +\else + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ \@thousand}% + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{1000}% +\divide\@strctr by 100 +\ifnum\@strctr>0\relax + \ifnum#1>1000\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ }% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ \@hundred}% +\fi +\@strctr=#1\relax \@modulo{\@strctr}{100}% +\ifnum#1>100\relax + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname\ }% + \fi +\fi +\ifnum\@strctr>19\relax + \divide\@strctr by 10\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr-\@unitstring{\@strctr}}% + \fi +\else + \ifnum\@strctr<10\relax + \ifnum\@strctr=0\relax + \ifnum#1<100\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi +\fi +} +\DeclareRobustCommand{\@numberstringMenglish}[2]{% +\let\@unitstring=\@@unitstringenglish +\let\@teenstring=\@@teenstringenglish +\let\@tenstring=\@@tenstringenglish +\def\@hundred{hundred}\def\@thousand{thousand}% +\def\@andname{and}% +\@@numberstringenglish{#1}{#2}% +} +\let\@numberstringFenglish=\@numberstringMenglish +\let\@numberstringNenglish=\@numberstringMenglish +\newcommand*{\@NumberstringMenglish}[2]{% +\let\@unitstring=\@@Unitstringenglish +\let\@teenstring=\@@Teenstringenglish +\let\@tenstring=\@@Tenstringenglish +\def\@hundred{Hundred}\def\@thousand{Thousand}% +\def\@andname{and}% +\@@numberstringenglish{#1}{#2}} +\let\@NumberstringFenglish=\@NumberstringMenglish +\let\@NumberstringNenglish=\@NumberstringMenglish +\newcommand*{\@@unitthstringenglish}[1]{% +\ifcase#1\relax +zeroth% +\or first% +\or second% +\or third% +\or fourth% +\or fifth% +\or sixth% +\or seventh% +\or eighth% +\or ninth% +\fi +} +\newcommand*{\@@tenthstringenglish}[1]{% +\ifcase#1\relax +\or tenth% +\or twentieth% +\or thirtieth% +\or fortieth% +\or fiftieth% +\or sixtieth% +\or seventieth% +\or eightieth% +\or ninetieth% +\fi +} +\newcommand*{\@@teenthstringenglish}[1]{% +\ifcase#1\relax +tenth% +\or eleventh% +\or twelfth% +\or thirteenth% +\or fourteenth% +\or fifteenth% +\or sixteenth% +\or seventeenth% +\or eighteenth% +\or nineteenth% +\fi +} +\newcommand*{\@@Unitthstringenglish}[1]{% +\ifcase#1\relax +Zeroth% +\or First% +\or Second% +\or Third% +\or Fourth% +\or Fifth% +\or Sixth% +\or Seventh% +\or Eighth% +\or Ninth% +\fi +} +\newcommand*{\@@Tenthstringenglish}[1]{% +\ifcase#1\relax +\or Tenth% +\or Twentieth% +\or Thirtieth% +\or Fortieth% +\or Fiftieth% +\or Sixtieth% +\or Seventieth% +\or Eightieth% +\or Ninetieth% +\fi +} +\newcommand*{\@@Teenthstringenglish}[1]{% +\ifcase#1\relax +Tenth% +\or Eleventh% +\or Twelfth% +\or Thirteenth% +\or Fourteenth% +\or Fifteenth% +\or Sixteenth% +\or Seventeenth% +\or Eighteenth% +\or Nineteenth% +\fi +} +\newcommand*{\@@ordinalstringenglish}[2]{% +\@strctr=#1\relax +\ifnum#1>99999 +\PackageError{fmtcount}{Out of range}% +{This macro only works for values less than 100000 (value given: \number\@strctr)}% +\else +\ifnum#1<0 +\PackageError{fmtcount}{Negative numbers not permitted}% +{This macro does not work for negative numbers, however +you can try typing "minus" first, and then pass the modulus of +this number}% +\fi +\def#2{}% +\fi +\@strctr=#1\relax \divide\@strctr by 1000\relax +\ifnum\@strctr>9\relax + \divide\@strctr by 10 + \ifnum\@strctr>1\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenstring{\@strctr}}% + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr-\@unitstring{\@strctr}}% + \fi + \else + \@strctr=#1\relax \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenstring{\@strctr}}% + \fi + \@strctr=#1\relax \@modulo{\@strctr}{1000}% + \ifnum\@strctr=0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@thousandth}% + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@thousand}% + \fi +\else + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{1000}% + \let\@@fc@ordstr#2\relax + \ifnum\@strctr=0\relax + \edef#2{\@@fc@ordstr\ \@thousandth}% + \else + \edef#2{\@@fc@ordstr\ \@thousand}% + \fi + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{1000}% +\divide\@strctr by 100 +\ifnum\@strctr>0\relax + \ifnum#1>1000\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ }% + \fi + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{100}% + \let\@@fc@ordstr#2\relax + \ifnum\@strctr=0\relax + \edef#2{\@@fc@ordstr\ \@hundredth}% + \else + \edef#2{\@@fc@ordstr\ \@hundred}% + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{100}% +\ifnum#1>100\relax + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@andname\ }% + \fi +\fi +\ifnum\@strctr>19\relax + \@tmpstrctr=\@strctr + \divide\@strctr by 10\relax + \@modulo{\@tmpstrctr}{10}% + \let\@@fc@ordstr#2\relax + \ifnum\@tmpstrctr=0\relax + \edef#2{\@@fc@ordstr\@tenthstring{\@strctr}}% + \else + \edef#2{\@@fc@ordstr\@tenstring{\@strctr}}% + \fi + \@strctr=#1\relax \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr-\@unitthstring{\@strctr}}% + \fi +\else + \ifnum\@strctr<10\relax + \ifnum\@strctr=0\relax + \ifnum#1<100\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}% + \fi + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}% + \fi + \else + \@modulo{\@strctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenthstring{\@strctr}}% + \fi +\fi +} +\DeclareRobustCommand{\@ordinalstringMenglish}[2]{% +\let\@unitthstring=\@@unitthstringenglish +\let\@teenthstring=\@@teenthstringenglish +\let\@tenthstring=\@@tenthstringenglish +\let\@unitstring=\@@unitstringenglish +\let\@teenstring=\@@teenstringenglish +\let\@tenstring=\@@tenstringenglish +\def\@andname{and}% +\def\@hundred{hundred}\def\@thousand{thousand}% +\def\@hundredth{hundredth}\def\@thousandth{thousandth}% +\@@ordinalstringenglish{#1}{#2}} +\let\@ordinalstringFenglish=\@ordinalstringMenglish +\let\@ordinalstringNenglish=\@ordinalstringMenglish +\DeclareRobustCommand{\@OrdinalstringMenglish}[2]{% +\let\@unitthstring=\@@Unitthstringenglish +\let\@teenthstring=\@@Teenthstringenglish +\let\@tenthstring=\@@Tenthstringenglish +\let\@unitstring=\@@Unitstringenglish +\let\@teenstring=\@@Teenstringenglish +\let\@tenstring=\@@Tenstringenglish +\def\@andname{and}% +\def\@hundred{Hundred}\def\@thousand{Thousand}% +\def\@hundredth{Hundredth}\def\@thousandth{Thousandth}% +\@@ordinalstringenglish{#1}{#2}} +\let\@OrdinalstringFenglish=\@OrdinalstringMenglish +\let\@OrdinalstringNenglish=\@OrdinalstringMenglish +\endinput +%% +%% End of file `fc-english.def'. diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-french.def b/Master/texmf-dist/tex/latex/fmtcount/fc-french.def new file mode 100644 index 00000000000..e517c002408 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-french.def @@ -0,0 +1,1019 @@ +%% +%% This is file `fc-french.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fc-french.def,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{fc-french.def}[2007/05/26] +\newcommand*{\@ordinalMfrench}[2]{% +\iffmtord@abbrv + \edef#2{\number#1\relax\noexpand\fmtord{e}}% +\else + \ifnum#1=1\relax + \edef#2{\number#1\relax\noexpand\fmtord{er}}% + \else + \edef#2{\number#1\relax\noexpand\fmtord{eme}}% + \fi +\fi} +\newcommand*{\@ordinalFfrench}[2]{% +\iffmtord@abbrv + \edef#2{\number#1\relax\noexpand\fmtord{e}}% +\else + \ifnum#1=1\relax + \edef#2{\number#1\relax\noexpand\fmtord{ere}}% + \else + \edef#2{\number#1\relax\noexpand\fmtord{eme}}% + \fi +\fi} +\let\@ordinalNfrench\@ordinalMfrench +\newcommand*{\@@unitstringfrench}[1]{% +\ifcase#1\relax +zero% +\or un% +\or deux% +\or trois% +\or quatre% +\or cinq% +\or six% +\or sept% +\or huit% +\or neuf% +\fi +} +\newcommand*{\@@unitstringFfrench}[1]{% +\ifnum#1=1\relax +une% +\else\@@unitstringfrench{#1}% +\fi +} +\newcommand*{\@@tenstringfrench}[1]{% +\ifcase#1\relax +\or dix% +\or vingt% +\or trente% +\or quarante% +\or cinquante% +\or soixante% +\or septente% +\or huitante% +\or nonente% +\or cent% +\fi +} +\newcommand*{\@@teenstringfrench}[1]{% +\ifcase#1\relax +dix% +\or onze% +\or douze% +\or treize% +\or quatorze% +\or quinze% +\or seize% +\or dix-sept% +\or dix-huit% +\or dix-neuf% +\fi +} +\newcommand*{\@@seventiesfrench}[1]{% +\@tenstring{6}% +\ifnum#1=1\relax +\ \@andname\ +\else +-% +\fi +\@teenstring{#1}% +} +\newcommand*{\@@eightiesfrench}[1]{% +\@unitstring{4}-\@tenstring{2}% +\ifnum#1>0 +-\@unitstring{#1}% +\else +s% +\fi +} +\newcommand*{\@@ninetiesfrench}[1]{% +\@unitstring{4}-\@tenstring{2}-\@teenstring{#1}% +} +\newcommand*{\@@seventiesfrenchswiss}[1]{% +\@tenstring{7}% +\ifnum#1=1\ \@andname\ \fi +\ifnum#1>1-\fi +\ifnum#1>0\@unitstring{#1}\fi +} +\newcommand*{\@@eightiesfrenchswiss}[1]{% +\@tenstring{8}% +\ifnum#1=1\ \@andname\ \fi +\ifnum#1>1-\fi +\ifnum#1>0\@unitstring{#1}\fi +} +\newcommand*{\@@ninetiesfrenchswiss}[1]{% +\@tenstring{9}% +\ifnum#1=1\ \@andname\ \fi +\ifnum#1>1-\fi +\ifnum#1>0\@unitstring{#1}\fi +} +\newcommand*{\@@Unitstringfrench}[1]{% +\ifcase#1\relax +Zero% +\or Un% +\or Deux% +\or Trois% +\or Quatre% +\or Cinq% +\or Six% +\or Sept% +\or Huit% +\or Neuf% +\fi +} +\newcommand*{\@@UnitstringFfrench}[1]{% +\ifnum#1=1\relax +Une% +\else \@@Unitstringfrench{#1}% +\fi +} +\newcommand*{\@@Tenstringfrench}[1]{% +\ifcase#1\relax +\or Dix% +\or Vingt% +\or Trente% +\or Quarante% +\or Cinquante% +\or Soixante% +\or Septente% +\or Huitante% +\or Nonente% +\or Cent% +\fi +} +\newcommand*{\@@Teenstringfrench}[1]{% +\ifcase#1\relax +Dix% +\or Onze% +\or Douze% +\or Treize% +\or Quatorze% +\or Quinze% +\or Seize% +\or Dix-Sept% +\or Dix-Huit% +\or Dix-Neuf% +\fi +} +\DeclareRobustCommand{\@numberstringMfrenchswiss}[2]{% +\let\@unitstring=\@@unitstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrenchswiss +\let\@nineties=\@@ninetiesfrenchswiss +\def\@hundred{cent}\def\@thousand{mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\DeclareRobustCommand{\@numberstringMfrenchfrance}[2]{% +\let\@unitstring=\@@unitstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\def\@hundred{cent}\def\@thousand{mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\DeclareRobustCommand{\@numberstringMfrenchbelgian}[2]{% +\let\@unitstring=\@@unitstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\def\@hundred{cent}\def\@thousand{mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\let\@numberstringMfrench=\@numberstringMfrenchfrance +\DeclareRobustCommand{\@numberstringFfrenchswiss}[2]{% +\let\@unitstring=\@@unitstringFfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrenchswiss +\let\@nineties=\@@ninetiesfrenchswiss +\def\@hundred{cent}\def\@thousand{mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\DeclareRobustCommand{\@numberstringFfrenchfrance}[2]{% +\let\@unitstring=\@@unitstringFfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\def\@hundred{cent}\def\@thousand{mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\DeclareRobustCommand{\@numberstringFfrenchbelgian}[2]{% +\let\@unitstring=\@@unitstringFfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\def\@hundred{cent}\def\@thousand{mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\let\@numberstringFfrench=\@numberstringFfrenchfrance +\let\@ordinalstringNfrench\@ordinalstringMfrench +\DeclareRobustCommand{\@NumberstringMfrenchswiss}[2]{% +\let\@unitstring=\@@Unitstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrenchswiss +\let\@nineties=\@@ninetiesfrenchswiss +\def\@hundred{Cent}\def\@thousand{Mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\DeclareRobustCommand{\@NumberstringMfrenchfrance}[2]{% +\let\@unitstring=\@@Unitstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\def\@hundred{Cent}\def\@thousand{Mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\DeclareRobustCommand{\@NumberstringMfrenchbelgian}[2]{% +\let\@unitstring=\@@Unitstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\def\@hundred{Cent}\def\@thousand{Mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\let\@NumberstringMfrench=\@NumberstringMfrenchfrance +\DeclareRobustCommand{\@NumberstringFfrenchswiss}[2]{% +\let\@unitstring=\@@UnitstringFfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrenchswiss +\let\@nineties=\@@ninetiesfrenchswiss +\def\@hundred{Cent}\def\@thousand{Mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\DeclareRobustCommand{\@NumberstringFfrenchfrance}[2]{% +\let\@unitstring=\@@UnitstringFfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\def\@hundred{Cent}\def\@thousand{Mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\DeclareRobustCommand{\@NumberstringFfrenchbelgian}[2]{% +\let\@unitstring=\@@UnitstringFfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\def\@hundred{Cent}\def\@thousand{Mille}% +\def\@andname{et}% +\@@numberstringfrench{#1}{#2}} +\let\@NumberstringFfrench=\@NumberstringFfrenchfrance +\let\@NumberstringNfrench\@NumberstringMfrench +\DeclareRobustCommand{\@ordinalstringMfrenchswiss}[2]{% +\ifnum#1=1\relax +\def#2{premier}% +\else +\let\@unitthstring=\@@unitthstringfrench +\let\@unitstring=\@@unitstringfrench +\let\@teenthstring=\@@teenthstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenthstring=\@@tenthstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventieths=\@@seventiethsfrenchswiss +\let\@eightieths=\@@eightiethsfrenchswiss +\let\@ninetieths=\@@ninetiethsfrenchswiss +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrenchswiss +\let\@nineties=\@@ninetiesfrenchswiss +\def\@hundredth{centi\`eme}\def\@hundred{cent}% +\def\@thousandth{mili\`eme}\def\@thousand{mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\DeclareRobustCommand{\@ordinalstringMfrenchfrance}[2]{% +\ifnum#1=1\relax +\def#2{premier}% +\else +\let\@unitthstring=\@@unitthstringfrench +\let\@unitstring=\@@unitstringfrench +\let\@teenthstring=\@@teenthstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenthstring=\@@tenthstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventieths=\@@seventiethsfrench +\let\@eightieths=\@@eightiethsfrench +\let\@ninetieths=\@@ninetiethsfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\let\@teenstring=\@@teenstringfrench +\def\@hundredth{centi\`eme}\def\@hundred{cent}% +\def\@thousandth{mili\`eme}\def\@thousand{mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\DeclareRobustCommand{\@ordinalstringMfrenchbelgian}[2]{% +\ifnum#1=1\relax +\def#2{premier}% +\else +\let\@unitthstring=\@@unitthstringfrench +\let\@unitstring=\@@unitstringfrench +\let\@teenthstring=\@@teenthstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenthstring=\@@tenthstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventieths=\@@seventiethsfrenchswiss +\let\@eightieths=\@@eightiethsfrench +\let\@ninetieths=\@@ninetiethsfrenchswiss +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\let\@teenstring=\@@teenstringfrench +\def\@hundredth{centi\`eme}\def\@hundred{cent}% +\def\@thousandth{mili\`eme}\def\@thousand{mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\let\@ordinalstringMfrench=\@ordinalstringMfrenchfrance +\DeclareRobustCommand{\@ordinalstringFfrenchswiss}[2]{% +\ifnum#1=1\relax +\def#2{premi\`ere}% +\else +\let\@unitthstring=\@@unitthstringfrench +\let\@unitstring=\@@unitstringFfrench +\let\@teenthstring=\@@teenthstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenthstring=\@@tenthstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventieths=\@@seventiethsfrenchswiss +\let\@eightieths=\@@eightiethsfrenchswiss +\let\@ninetieths=\@@ninetiethsfrenchswiss +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrenchswiss +\let\@nineties=\@@ninetiesfrenchswiss +\def\@hundredth{centi\`eme}\def\@hundred{cent}% +\def\@thousandth{mili\`eme}\def\@thousand{mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\DeclareRobustCommand{\@ordinalstringFfrenchfrance}[2]{% +\ifnum#1=1\relax +\def#2{premi\`ere}% +\else +\let\@unitthstring=\@@unitthstringfrench +\let\@unitstring=\@@unitstringFfrench +\let\@teenthstring=\@@teenthstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenthstring=\@@tenthstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventieths=\@@seventiethsfrench +\let\@eightieths=\@@eightiethsfrench +\let\@ninetieths=\@@ninetiethsfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\let\@teenstring=\@@teenstringfrench +\def\@hundredth{centi\`eme}\def\@hundred{cent}% +\def\@thousandth{mili\`eme}\def\@thousand{mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\DeclareRobustCommand{\@ordinalstringFfrenchbelgian}[2]{% +\ifnum#1=1\relax +\def#2{premi\`ere}% +\else +\let\@unitthstring=\@@unitthstringfrench +\let\@unitstring=\@@unitstringFfrench +\let\@teenthstring=\@@teenthstringfrench +\let\@teenstring=\@@teenstringfrench +\let\@tenthstring=\@@tenthstringfrench +\let\@tenstring=\@@tenstringfrench +\let\@seventieths=\@@seventiethsfrenchswiss +\let\@eightieths=\@@eightiethsfrench +\let\@ninetieths=\@@ninetiethsfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\let\@teenstring=\@@teenstringfrench +\def\@hundredth{centi\`eme}\def\@hundred{cent}% +\def\@thousandth{mili\`eme}\def\@thousand{mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\let\@ordinalstringFfrench=\@ordinalstringFfrenchfrance +\let\@ordinalstringNfrench\@ordinalstringMfrench +\DeclareRobustCommand{\@OrdinalstringMfrenchswiss}[2]{% +\ifnum#1=1\relax +\def#2{Premi\`ere}% +\else +\let\@unitthstring=\@@Unitthstringfrench +\let\@unitstring=\@@Unitstringfrench +\let\@teenthstring=\@@Teenthstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenthstring=\@@Tenthstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventieths=\@@seventiethsfrenchswiss +\let\@eightieths=\@@eightiethsfrenchswiss +\let\@ninetieths=\@@ninetiethsfrenchswiss +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrenchswiss +\let\@nineties=\@@ninetiesfrenchswiss +\def\@hundredth{Centi\`eme}\def\@hundred{Cent}% +\def\@thousandth{Mili\`eme}\def\@thousand{Mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\DeclareRobustCommand{\@OrdinalstringMfrenchfrance}[2]{% +\ifnum#1=1\relax +\def#2{Premi\`ere}% +\else +\let\@unitthstring=\@@Unitthstringfrench +\let\@unitstring=\@@Unitstringfrench +\let\@teenthstring=\@@Teenthstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenthstring=\@@Tenthstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventieths=\@@seventiethsfrench +\let\@eightieths=\@@eightiethsfrench +\let\@ninetieths=\@@ninetiethsfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\let\@teenstring=\@@Teenstringfrench +\def\@hundredth{Centi\`eme}\def\@hundred{Cent}% +\def\@thousandth{Mili\`eme}\def\@thousand{Mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\DeclareRobustCommand{\@OrdinalstringMfrenchbelgian}[2]{% +\ifnum#1=1\relax +\def#2{Premi\`ere}% +\else +\let\@unitthstring=\@@Unitthstringfrench +\let\@unitstring=\@@Unitstringfrench +\let\@teenthstring=\@@Teenthstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenthstring=\@@Tenthstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventieths=\@@seventiethsfrenchswiss +\let\@eightieths=\@@eightiethsfrench +\let\@ninetieths=\@@ninetiethsfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\let\@teenstring=\@@Teenstringfrench +\def\@hundredth{Centi\`eme}\def\@hundred{Cent}% +\def\@thousandth{Mili\`eme}\def\@thousand{Mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\let\@OrdinalstringMfrench=\@OrdinalstringMfrenchfrance +\DeclareRobustCommand{\@OrdinalstringFfrenchswiss}[2]{% +\ifnum#1=1\relax +\def#2{Premi\`ere}% +\else +\let\@unitthstring=\@@Unitthstringfrench +\let\@unitstring=\@@UnitstringFfrench +\let\@teenthstring=\@@Teenthstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenthstring=\@@Tenthstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventieths=\@@seventiethsfrenchswiss +\let\@eightieths=\@@eightiethsfrenchswiss +\let\@ninetieths=\@@ninetiethsfrenchswiss +\let\@seventies=\@@seventiesfrenchswiss +\let\@eighties=\@@eightiesfrenchswiss +\let\@nineties=\@@ninetiesfrenchswiss +\def\@hundredth{Centi\`eme}\def\@hundred{Cent}% +\def\@thousandth{Mili\`eme}\def\@thousand{Mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\DeclareRobustCommand{\@OrdinalstringFfrenchfrance}[2]{% +\ifnum#1=1\relax +\def#2{Premi\`ere}% +\else +\let\@unitthstring=\@@Unitthstringfrench +\let\@unitstring=\@@UnitstringFfrench +\let\@teenthstring=\@@Teenthstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenthstring=\@@Tenthstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventieths=\@@seventiethsfrench +\let\@eightieths=\@@eightiethsfrench +\let\@ninetieths=\@@ninetiethsfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\let\@teenstring=\@@Teenstringfrench +\def\@hundredth{Centi\`eme}\def\@hundred{Cent}% +\def\@thousandth{Mili\`eme}\def\@thousand{Mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\DeclareRobustCommand{\@OrdinalstringFfrenchbelgian}[2]{% +\ifnum#1=1\relax +\def#2{Premi\`ere}% +\else +\let\@unitthstring=\@@Unitthstringfrench +\let\@unitstring=\@@UnitstringFfrench +\let\@teenthstring=\@@Teenthstringfrench +\let\@teenstring=\@@Teenstringfrench +\let\@tenthstring=\@@Tenthstringfrench +\let\@tenstring=\@@Tenstringfrench +\let\@seventieths=\@@seventiethsfrenchswiss +\let\@eightieths=\@@eightiethsfrench +\let\@ninetieths=\@@ninetiethsfrench +\let\@seventies=\@@seventiesfrench +\let\@eighties=\@@eightiesfrench +\let\@nineties=\@@ninetiesfrench +\let\@teenstring=\@@Teenstringfrench +\def\@hundredth{Centi\`eme}\def\@hundred{Cent}% +\def\@thousandth{Mili\`eme}\def\@thousand{Mille}% +\def\@andname{et}% +\@@ordinalstringfrench{#1}{#2}% +\fi} +\let\@OrdinalstringFfrench=\@OrdinalstringFfrenchfrance +\let\@OrdinalstringNfrench\@OrdinalstringMfrench +\newcommand*{\@@unitthstringfrench}[1]{% +\ifcase#1\relax +zero% +\or uni\`eme% +\or deuxi\`eme% +\or troisi\`eme% +\or quatri\`eme% +\or cinqui\`eme% +\or sixi\`eme% +\or septi\`eme% +\or huiti\`eme% +\or neuvi\`eme% +\fi +} +\newcommand*{\@@tenthstringfrench}[1]{% +\ifcase#1\relax +\or dixi\`eme% +\or vingti\`eme% +\or trentri\`eme% +\or quaranti\`eme% +\or cinquanti\`eme% +\or soixanti\`eme% +\or septenti\`eme% +\or huitanti\`eme% +\or nonenti\`eme% +\fi +} +\newcommand*{\@@teenthstringfrench}[1]{% +\ifcase#1\relax +dixi\`eme% +\or onzi\`eme% +\or douzi\`eme% +\or treizi\`eme% +\or quatorzi\`eme% +\or quinzi\`eme% +\or seizi\`eme% +\or dix-septi\`eme% +\or dix-huiti\`eme% +\or dix-neuvi\`eme% +\fi +} +\newcommand*{\@@seventiethsfrenchswiss}[1]{% +\ifcase#1\relax +\@tenthstring{7}% +\or +\@tenstring{7} \@andname\ \@unitthstring{1}% +\else +\@tenstring{7}-\@unitthstring{#1}% +\fi} +\newcommand*{\@@eightiethsfrenchswiss}[1]{% +\ifcase#1\relax +\@tenthstring{8}% +\or +\@tenstring{8} \@andname\ \@unitthstring{1}% +\else +\@tenstring{8}-\@unitthstring{#1}% +\fi} +\newcommand*{\@@ninetiethsfrenchswiss}[1]{% +\ifcase#1\relax +\@tenthstring{9}% +\or +\@tenstring{9} \@andname\ \@unitthstring{1}% +\else +\@tenstring{9}-\@unitthstring{#1}% +\fi} +\newcommand*{\@@seventiethsfrench}[1]{% +\ifnum#1=0\relax +\@tenstring{6}% +-% +\else +\@tenstring{6}% +\ \@andname\ +\fi +\@teenthstring{#1}% +} +\newcommand*{\@@eightiethsfrench}[1]{% +\ifnum#1>0\relax +\@unitstring{4}-\@tenstring{2}% +-\@unitthstring{#1}% +\else +\@unitstring{4}-\@tenthstring{2}% +\fi +} +\newcommand*{\@@ninetiethsfrench}[1]{% +\@unitstring{4}-\@tenstring{2}-\@teenthstring{#1}% +} +\newcommand*{\@@Unitthstringfrench}[1]{% +\ifcase#1\relax +Zero% +\or Uni\`eme% +\or Deuxi\`eme% +\or Troisi\`eme% +\or Quatri\`eme% +\or Cinqui\`eme% +\or Sixi\`eme% +\or Septi\`eme% +\or Huiti\`eme% +\or Neuvi\`eme% +\fi +} +\newcommand*{\@@Tenthstringfrench}[1]{% +\ifcase#1\relax +\or Dixi\`eme% +\or Vingti\`eme% +\or Trentri\`eme% +\or Quaranti\`eme% +\or Cinquanti\`eme% +\or Soixanti\`eme% +\or Septenti\`eme% +\or Huitanti\`eme% +\or Nonenti\`eme% +\fi +} +\newcommand*{\@@Teenthstringfrench}[1]{% +\ifcase#1\relax +Dixi\`eme% +\or Onzi\`eme% +\or Douzi\`eme% +\or Treizi\`eme% +\or Quatorzi\`eme% +\or Quinzi\`eme% +\or Seizi\`eme% +\or Dix-Septi\`eme% +\or Dix-Huiti\`eme% +\or Dix-Neuvi\`eme% +\fi +} +\newcommand*{\@@numberstringfrench}[2]{% +\ifnum#1>99999 +\PackageError{fmtcount}{Out of range}% +{This macro only works for values less than 100000}% +\else +\ifnum#1<0 +\PackageError{fmtcount}{Negative numbers not permitted}% +{This macro does not work for negative numbers, however +you can try typing "minus" first, and then pass the modulus of +this number}% +\fi +\fi +\def#2{}% +\@strctr=#1\relax \divide\@strctr by 1000\relax +\ifnum\@strctr>9\relax + \@tmpstrctr=\@strctr + \divide\@strctr by 10\relax + \ifnum\@strctr>1\relax + \ifthenelse{\(\@strctr>6\)\and\(\@strctr<10\)}{% + \@modulo{\@tmpstrctr}{10}% + \ifnum\@strctr<8\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@seventies{\@tmpstrctr}}% + \else + \ifnum\@strctr<9\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@eighties{\@tmpstrctr}}% + \else + \ifnum\@strctr<10\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@nineties{\@tmpstrctr}}% + \fi + \fi + \fi + }{% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@unitstring{\@strctr}}% + \fi + }% + \else + \@strctr=#1\relax + \divide\@strctr by 1000 + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@thousand}% +\else + \ifnum\@strctr>0\relax + \ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ }% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@thousand}% + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{1000}% +\divide\@strctr by 100 +\ifnum\@strctr>0\relax + \ifnum#1>1000\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ }% + \fi + \@tmpstrctr=#1\relax + \@modulo{\@tmpstrctr}{1000}\relax + \ifnum\@tmpstrctr=100\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{10}}% + \else + \ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ }% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@hundred}% + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{100}% +\ifnum#1>100\relax + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ }% + \else + \ifnum\@tmpstrctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr s}% + \fi% + \fi +\fi +\ifnum\@strctr>19\relax + \@tmpstrctr=\@strctr + \divide\@strctr by 10\relax + \ifthenelse{\@strctr>6}{% + \@modulo{\@tmpstrctr}{10}% + \ifnum\@strctr<8\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@seventies{\@tmpstrctr}}% + \else + \ifnum\@strctr<9\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@eighties{\@tmpstrctr}}% + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@nineties{\@tmpstrctr}}% + \fi + \fi + }{% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \ifnum\@strctr=1\relax + \edef#2{\@@fc@numstr\ \@andname\ }% + \else + \edef#2{\@@fc@numstr-}% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + }% +\else + \ifnum\@strctr<10\relax + \ifnum\@strctr=0\relax + \ifnum#1<100\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else%(>0,<10) + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else%>10 + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi +\fi +} +\newcommand*{\@@ordinalstringfrench}[2]{% +\ifnum#1>99999 +\PackageError{fmtcount}{Out of range}% +{This macro only works for values less than 100000}% +\else +\ifnum#1<0 +\PackageError{fmtcount}{Negative numbers not permitted}% +{This macro does not work for negative numbers, however +you can try typing "minus" first, and then pass the modulus of +this number}% +\fi +\fi +\def#2{}% +\@strctr=#1\relax \divide\@strctr by 1000\relax +\ifnum\@strctr>9 + \@tmpstrctr=\@strctr + \divide\@strctr by 10\relax + \ifnum\@strctr>1\relax + \ifthenelse{\@strctr>6}{% + \@modulo{\@tmpstrctr}{10}% + \ifnum\@strctr=7\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@seventies{\@tmpstrctr}}% + \else + \ifnum\@strctr=8\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@eighties{\@tmpstrctr}}% + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@nineties{\@tmpstrctr}}% + \fi + \fi + }{% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenstring{\@strctr}}% + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \ifnum\@strctr=1\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@andname}% + \fi + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@unitstring{\@strctr}}% + \fi + }% + \else + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenstring{\@strctr}}% + \fi + \@strctr=#1\relax \@modulo{\@strctr}{1000}% + \ifnum\@strctr=0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@thousandth}% + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@thousand}% + \fi +\else + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{1000}% + \ifnum\@strctr=0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@thousandth}% + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@thousand}% + \fi + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{1000}% +\divide\@strctr by 100\relax +\ifnum\@strctr>0\relax + \ifnum#1>1000\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ }% + \fi + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{100}% + \let\@@fc@ordstr#2\relax + \ifnum\@strctr=0\relax + \edef#2{\@@fc@ordstr\ \@hundredth}% + \else + \edef#2{\@@fc@ordstr\ \@hundred}% + \fi +\fi +\@tmpstrctr=\@strctr +\@strctr=#1\relax \@modulo{\@strctr}{100}% +\ifnum#1>100\relax + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@andname\ }% + \fi +\fi +\ifnum\@strctr>19\relax + \@tmpstrctr=\@strctr + \divide\@strctr by 10\relax + \@modulo{\@tmpstrctr}{10}% + \ifthenelse{\@strctr>6}{% + \ifnum\@strctr=7\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@seventieths{\@tmpstrctr}}% + \else + \ifnum\@strctr=8\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@eightieths{\@tmpstrctr}}% + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@ninetieths{\@tmpstrctr}}% + \fi + \fi + }{% + \ifnum\@tmpstrctr=0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenthstring{\@strctr}}% + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenstring{\@strctr}}% + \fi + \@strctr=#1\relax \@modulo{\@strctr}{10}% + \ifnum\@strctr=1\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@andname}% + \fi + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@unitthstring{\@strctr}}% + \fi + }% +\else + \ifnum\@strctr<10\relax + \ifnum\@strctr=0\relax + \ifnum#1<100\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}% + \fi + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}% + \fi + \else + \@modulo{\@strctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenthstring{\@strctr}}% + \fi +\fi +} +\endinput +%% +%% End of file `fc-french.def'. diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-german.def b/Master/texmf-dist/tex/latex/fmtcount/fc-german.def new file mode 100644 index 00000000000..53c1f488271 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-german.def @@ -0,0 +1,459 @@ +%% +%% This is file `fc-german.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fc-german.def,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{fc-german.def}[2007/06/14] +\newcommand{\@ordinalMgerman}[2]{% +\edef#2{\number#1\relax.}} +\newcommand{\@ordinalFgerman}[2]{% +\edef#2{\number#1\relax.}} +\newcommand{\@ordinalNgerman}[2]{% +\edef#2{\number#1\relax.}} +\newcommand{\@@unitstringgerman}[1]{% +\ifcase#1% +null% +\or ein% +\or zwei% +\or drei% +\or vier% +\or f\"unf% +\or sechs% +\or sieben% +\or acht% +\or neun% +\fi +} +\newcommand{\@@tenstringgerman}[1]{% +\ifcase#1% +\or zehn% +\or zwanzig% +\or drei{\ss}ig% +\or vierzig% +\or f\"unfzig% +\or sechzig% +\or siebzig% +\or achtzig% +\or neunzig% +\or einhundert% +\fi +} +\providecommand*{\einhundert}{einhundert} +\providecommand*{\eintausend}{eintausend} +\newcommand{\@@teenstringgerman}[1]{% +\ifcase#1% +zehn% +\or elf% +\or zw\"olf% +\or dreizehn% +\or vierzehn% +\or f\"unfzehn% +\or sechzehn% +\or siebzehn% +\or achtzehn% +\or neunzehn% +\fi +} +\DeclareRobustCommand{\@numberstringMgerman}[2]{% +\let\@unitstring=\@@unitstringgerman +\let\@teenstring=\@@teenstringgerman +\let\@tenstring=\@@tenstringgerman +\@@numberstringgerman{#1}{#2}} +\let\@numberstringFgerman=\@numberstringMgerman +\let\@numberstringNgerman=\@numberstringMgerman +\DeclareRobustCommand{\@NumberstringMgerman}[2]{% +\@numberstringMgerman{#1}{\@@num@str}% +\edef#2{\noexpand\MakeUppercase\@@num@str}} +\let\@NumberstringFgerman=\@NumberstringMgerman +\let\@NumberstringNgerman=\@NumberstringMgerman +\DeclareRobustCommand{\@ordinalstringMgerman}[2]{% +\let\@unitthstring=\@@unitthstringMgerman +\let\@teenthstring=\@@teenthstringMgerman +\let\@tenthstring=\@@tenthstringMgerman +\let\@unitstring=\@@unitstringgerman +\let\@teenstring=\@@teenstringgerman +\let\@tenstring=\@@tenstringgerman +\def\@thousandth{tausendster}% +\def\@hundredth{hundertster}% +\@@ordinalstringgerman{#1}{#2}} +\DeclareRobustCommand{\@ordinalstringFgerman}[2]{% +\let\@unitthstring=\@@unitthstringFgerman +\let\@teenthstring=\@@teenthstringFgerman +\let\@tenthstring=\@@tenthstringFgerman +\let\@unitstring=\@@unitstringgerman +\let\@teenstring=\@@teenstringgerman +\let\@tenstring=\@@tenstringgerman +\def\@thousandth{tausendste}% +\def\@hundredth{hundertste}% +\@@ordinalstringgerman{#1}{#2}} +\DeclareRobustCommand{\@ordinalstringNgerman}[2]{% +\let\@unitthstring=\@@unitthstringNgerman +\let\@teenthstring=\@@teenthstringNgerman +\let\@tenthstring=\@@tenthstringNgerman +\let\@unitstring=\@@unitstringgerman +\let\@teenstring=\@@teenstringgerman +\let\@tenstring=\@@tenstringgerman +\def\@thousandth{tausendstes}% +\def\@hundredth{hunderstes}% +\@@ordinalstringgerman{#1}{#2}} +\DeclareRobustCommand{\@OrdinalstringMgerman}[2]{% +\@ordinalstringMgerman{#1}{\@@num@str}% +\edef#2{\protect\MakeUppercase\@@num@str}} +\DeclareRobustCommand{\@OrdinalstringFgerman}[2]{% +\@ordinalstringFgerman{#1}{\@@num@str}% +\edef#2{\protect\MakeUppercase\@@num@str}} +\DeclareRobustCommand{\@OrdinalstringNgerman}[2]{% +\@ordinalstringNgerman{#1}{\@@num@str}% +\edef#2{\protect\MakeUppercase\@@num@str}} +\newcommand{\@@unitthstringMgerman}[1]{% +\ifcase#1% +nullter% +\or erster% +\or zweiter% +\or dritter% +\or vierter% +\or f\"unter% +\or sechster% +\or siebter% +\or achter% +\or neunter% +\fi +} +\newcommand{\@@tenthstringMgerman}[1]{% +\ifcase#1% +\or zehnter% +\or zwanzigster% +\or drei{\ss}igster% +\or vierzigster% +\or f\"unfzigster% +\or sechzigster% +\or siebzigster% +\or achtzigster% +\or neunzigster% +\fi +} +\newcommand{\@@teenthstringMgerman}[1]{% +\ifcase#1% +zehnter% +\or elfter% +\or zw\"olfter% +\or dreizehnter% +\or vierzehnter% +\or f\"unfzehnter% +\or sechzehnter% +\or siebzehnter% +\or achtzehnter% +\or neunzehnter% +\fi +} +\newcommand{\@@unitthstringFgerman}[1]{% +\ifcase#1% +nullte% +\or erste% +\or zweite% +\or dritte% +\or vierte% +\or f\"unfte% +\or sechste% +\or siebte% +\or achte% +\or neunte% +\fi +} +\newcommand{\@@tenthstringFgerman}[1]{% +\ifcase#1% +\or zehnte% +\or zwanzigste% +\or drei{\ss}igste% +\or vierzigste% +\or f\"unfzigste% +\or sechzigste% +\or siebzigste% +\or achtzigste% +\or neunzigste% +\fi +} +\newcommand{\@@teenthstringFgerman}[1]{% +\ifcase#1% +zehnte% +\or elfte% +\or zw\"olfte% +\or dreizehnte% +\or vierzehnte% +\or f\"unfzehnte% +\or sechzehnte% +\or siebzehnte% +\or achtzehnte% +\or neunzehnte% +\fi +} +\newcommand{\@@unitthstringNgerman}[1]{% +\ifcase#1% +nulltes% +\or erstes% +\or zweites% +\or drittes% +\or viertes% +\or f\"unte% +\or sechstes% +\or siebtes% +\or achtes% +\or neuntes% +\fi +} +\newcommand{\@@tenthstringNgerman}[1]{% +\ifcase#1% +\or zehntes% +\or zwanzigstes% +\or drei{\ss}igstes% +\or vierzigstes% +\or f\"unfzigstes% +\or sechzigstes% +\or siebzigstes% +\or achtzigstes% +\or neunzigstes% +\fi +} +\newcommand{\@@teenthstringNgerman}[1]{% +\ifcase#1% +zehntes% +\or elftes% +\or zw\"olftes% +\or dreizehntes% +\or vierzehntes% +\or f\"unfzehntes% +\or sechzehntes% +\or siebzehntes% +\or achtzehntes% +\or neunzehntes% +\fi +} +\newcommand{\@@numberunderhundredgerman}[2]{% +\ifnum#1<10\relax + \ifnum#1>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{#1}}% + \fi +\else + \@tmpstrctr=#1\relax + \@modulo{\@tmpstrctr}{10}% + \ifnum#1<20\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@tmpstrctr}}% + \else + \ifnum\@tmpstrctr=0\relax + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@tmpstrctr}und}% + \fi + \@tmpstrctr=#1\relax + \divide\@tmpstrctr by 10\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@tmpstrctr}}% + \fi +\fi +} +\newcommand{\@@numberstringgerman}[2]{% +\ifnum#1>99999\relax + \PackageError{fmtcount}{Out of range}% + {This macro only works for values less than 100000}% +\else + \ifnum#1<0\relax + \PackageError{fmtcount}{Negative numbers not permitted}% + {This macro does not work for negative numbers, however + you can try typing "minus" first, and then pass the modulus of + this number}% + \fi +\fi +\def#2{}% +\@strctr=#1\relax \divide\@strctr by 1000\relax +\ifnum\@strctr>1\relax +\@@numberunderhundredgerman{\@strctr}{#2}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr tausend}% +\else + \ifnum\@strctr=1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\eintausend}% + \fi +\fi +\@strctr=#1\relax +\@modulo{\@strctr}{1000}% +\divide\@strctr by 100\relax +\ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}hundert}% +\else + \ifnum\@strctr=1\relax + \ifnum#1>1000\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr einhundert}% + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\einhundert}% + \fi + \fi +\fi +\@strctr=#1\relax +\@modulo{\@strctr}{100}% +\ifnum#1=0\relax + \def#2{null}% +\else + \ifnum\@strctr=1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr eins}% + \else + \@@numberunderhundredgerman{\@strctr}{#2}% + \fi +\fi +} +\newcommand{\@@numberunderhundredthgerman}[2]{% +\ifnum#1<10\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitthstring{#1}}% +\else + \@tmpstrctr=#1\relax + \@modulo{\@tmpstrctr}{10}% + \ifnum#1<20\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenthstring{\@tmpstrctr}}% + \else + \ifnum\@tmpstrctr=0\relax + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@tmpstrctr}und}% + \fi + \@tmpstrctr=#1\relax + \divide\@tmpstrctr by 10\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenthstring{\@tmpstrctr}}% + \fi +\fi +} +\newcommand{\@@ordinalstringgerman}[2]{% +\ifnum#1>99999\relax + \PackageError{fmtcount}{Out of range}% + {This macro only works for values less than 100000}% +\else + \ifnum#1<0\relax + \PackageError{fmtcount}{Negative numbers not permitted}% + {This macro does not work for negative numbers, however + you can try typing "minus" first, and then pass the modulus of + this number}% + \fi +\fi +\def#2{}% +\@strctr=#1\relax \divide\@strctr by 1000\relax +\ifnum\@strctr>1\relax +\@@numberunderhundredgerman{\@strctr}{#2}% + \let\@@fc@numstr#2\relax + % is that it, or is there more? + \@tmpstrctr=#1\relax \@modulo{\@tmpstrctr}{1000}% + \ifnum\@tmpstrctr=0\relax + \edef#2{\@@fc@numstr\@thousandth}% + \else + \edef#2{\@@fc@numstr tausend}% + \fi +\else + \ifnum\@strctr=1\relax + \ifnum#1=1000\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@thousandth}% + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\eintausend}% + \fi + \fi +\fi +\@strctr=#1\relax +\@modulo{\@strctr}{1000}% +\divide\@strctr by 100\relax +\ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + % is that it, or is there more? + \@tmpstrctr=#1\relax \@modulo{\@tmpstrctr}{100}% + \ifnum\@tmpstrctr=0\relax + \ifnum\@strctr=1\relax + \edef#2{\@@fc@numstr\@hundredth}% + \else + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\@hundredth}% + \fi + \else + \edef#2{\@@fc@numstr\@unitstring{\@strctr}hundert}% + \fi +\else + \ifnum\@strctr=1\relax + \@tmpstrctr=#1\relax \@modulo{\@tmpstrctr}{100}% + \ifnum\@tmpstrctr=0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@hundredth}% + \else + \ifnum#1>1000\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr einhundert}% + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\einhundert}% + \fi + \fi + \fi +\fi +\@strctr=#1\relax +\@modulo{\@strctr}{100}% +\ifthenelse{\@strctr=0 \and #1>0}{}{% +\@@numberunderhundredthgerman{\@strctr}{#2}% +}% +} +\let\@ordinalMngerman=\@ordinalMgerman +\let\@ordinalFngerman=\@ordinalFgerman +\let\@ordinalNngerman=\@ordinalNgerman +\let\@numberstringMngerman=\@numberstringMgerman +\let\@numberstringFngerman=\@numberstringFgerman +\let\@numberstringNngerman=\@numberstringNgerman +\let\@NumberstringMngerman=\@NumberstringMgerman +\let\@NumberstringFngerman=\@NumberstringFgerman +\let\@NumberstringNngerman=\@NumberstringNgerman +\let\@ordinalstringMngerman=\@ordinalstringMgerman +\let\@ordinalstringFngerman=\@ordinalstringFgerman +\let\@ordinalstringNngerman=\@ordinalstringNgerman +\let\@OrdinalstringMngerman=\@OrdinalstringMgerman +\let\@OrdinalstringFngerman=\@OrdinalstringFgerman +\let\@OrdinalstringNngerman=\@OrdinalstringNgerman +\endinput +%% +%% End of file `fc-german.def'. diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-portuges.def b/Master/texmf-dist/tex/latex/fmtcount/fc-portuges.def new file mode 100644 index 00000000000..d455f008040 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-portuges.def @@ -0,0 +1,638 @@ +%% +%% This is file `fc-portuges.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fc-portuges.def,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{fc-portuges.def}[2007/05/26] +\newcommand*{\@ordinalMportuges}[2]{% +\ifnum#1=0\relax + \edef#2{\number#1}% +\else + \edef#2{\number#1\relax\noexpand\fmtord{o}}% +\fi} +\newcommand*{\@ordinalFportuges}[2]{% +\ifnum#1=0\relax + \edef#2{\number#1}% +\else + \edef#2{\number#1\relax\noexpand\fmtord{a}}% +\fi} +\let\@ordinalNportuges\@ordinalMportuges +\newcommand*{\@@unitstringportuges}[1]{% +\ifcase#1\relax +zero% +\or um% +\or dois% +\or tr\^es% +\or quatro% +\or cinco% +\or seis% +\or sete% +\or oito% +\or nove% +\fi +} +\newcommand*{\@@unitstringFportuges}[1]{% +\ifcase#1\relax +zero% +\or uma% +\or duas% +\or tr\^es% +\or quatro% +\or cinco% +\or seis% +\or sete% +\or oito% +\or nove% +\fi +} +\newcommand*{\@@tenstringportuges}[1]{% +\ifcase#1\relax +\or dez% +\or vinte% +\or trinta% +\or quarenta% +\or cinq\"uenta% +\or sessenta% +\or setenta% +\or oitenta% +\or noventa% +\or cem% +\fi +} +\newcommand*{\@@teenstringportuges}[1]{% +\ifcase#1\relax +dez% +\or onze% +\or doze% +\or treze% +\or quatorze% +\or quinze% +\or dezesseis% +\or dezessete% +\or dezoito% +\or dezenove% +\fi +} +\newcommand*{\@@hundredstringportuges}[1]{% +\ifcase#1\relax +\or cento% +\or duzentos% +\or trezentos% +\or quatrocentos% +\or quinhentos% +\or seiscentos% +\or setecentos% +\or oitocentos% +\or novecentos% +\fi} +\newcommand*{\@@hundredstringFportuges}[1]{% +\ifcase#1\relax +\or cento% +\or duzentas% +\or trezentas% +\or quatrocentas% +\or quinhentas% +\or seiscentas% +\or setecentas% +\or oitocentas% +\or novecentas% +\fi} +\newcommand*{\@@Unitstringportuges}[1]{% +\ifcase#1\relax +Zero% +\or Um% +\or Dois% +\or Tr\^es% +\or Quatro% +\or Cinco% +\or Seis% +\or Sete% +\or Oito% +\or Nove% +\fi +} +\newcommand*{\@@UnitstringFportuges}[1]{% +\ifcase#1\relax +Zera% +\or Uma% +\or Duas% +\or Tr\^es% +\or Quatro% +\or Cinco% +\or Seis% +\or Sete% +\or Oito% +\or Nove% +\fi +} +\newcommand*{\@@Tenstringportuges}[1]{% +\ifcase#1\relax +\or Dez% +\or Vinte% +\or Trinta% +\or Quarenta% +\or Cinq\"uenta% +\or Sessenta% +\or Setenta% +\or Oitenta% +\or Noventa% +\or Cem% +\fi +} +\newcommand*{\@@Teenstringportuges}[1]{% +\ifcase#1\relax +Dez% +\or Onze% +\or Doze% +\or Treze% +\or Quatorze% +\or Quinze% +\or Dezesseis% +\or Dezessete% +\or Dezoito% +\or Dezenove% +\fi +} +\newcommand*{\@@Hundredstringportuges}[1]{% +\ifcase#1\relax +\or Cento% +\or Duzentos% +\or Trezentos% +\or Quatrocentos% +\or Quinhentos% +\or Seiscentos% +\or Setecentos% +\or Oitocentos% +\or Novecentos% +\fi} +\newcommand*{\@@HundredstringFportuges}[1]{% +\ifcase#1\relax +\or Cento% +\or Duzentas% +\or Trezentas% +\or Quatrocentas% +\or Quinhentas% +\or Seiscentas% +\or Setecentas% +\or Oitocentas% +\or Novecentas% +\fi} +\DeclareRobustCommand{\@numberstringMportuges}[2]{% +\let\@unitstring=\@@unitstringportuges +\let\@teenstring=\@@teenstringportuges +\let\@tenstring=\@@tenstringportuges +\let\@hundredstring=\@@hundredstringportuges +\def\@hundred{cem}\def\@thousand{mil}% +\def\@andname{e}% +\@@numberstringportuges{#1}{#2}} +\DeclareRobustCommand{\@numberstringFportuges}[2]{% +\let\@unitstring=\@@unitstringFportuges +\let\@teenstring=\@@teenstringportuges +\let\@tenstring=\@@tenstringportuges +\let\@hundredstring=\@@hundredstringFportuges +\def\@hundred{cem}\def\@thousand{mil}% +\def\@andname{e}% +\@@numberstringportuges{#1}{#2}} +\let\@numberstringNportuges\@numberstringMportuges +\DeclareRobustCommand{\@NumberstringMportuges}[2]{% +\let\@unitstring=\@@Unitstringportuges +\let\@teenstring=\@@Teenstringportuges +\let\@tenstring=\@@Tenstringportuges +\let\@hundredstring=\@@Hundredstringportuges +\def\@hundred{Cem}\def\@thousand{Mil}% +\def\@andname{e}% +\@@numberstringportuges{#1}{#2}} +\DeclareRobustCommand{\@NumberstringFportuges}[2]{% +\let\@unitstring=\@@UnitstringFportuges +\let\@teenstring=\@@Teenstringportuges +\let\@tenstring=\@@Tenstringportuges +\let\@hundredstring=\@@HundredstringFportuges +\def\@hundred{Cem}\def\@thousand{Mil}% +\def\@andname{e}% +\@@numberstringportuges{#1}{#2}} +\let\@NumberstringNportuges\@NumberstringMportuges +\DeclareRobustCommand{\@ordinalstringMportuges}[2]{% +\let\@unitthstring=\@@unitthstringportuges +\let\@unitstring=\@@unitstringportuges +\let\@teenthstring=\@@teenthstringportuges +\let\@tenthstring=\@@tenthstringportuges +\let\@hundredthstring=\@@hundredthstringportuges +\def\@thousandth{mil\'esimo}% +\@@ordinalstringportuges{#1}{#2}} +\DeclareRobustCommand{\@ordinalstringFportuges}[2]{% +\let\@unitthstring=\@@unitthstringFportuges +\let\@unitstring=\@@unitstringFportuges +\let\@teenthstring=\@@teenthstringportuges +\let\@tenthstring=\@@tenthstringFportuges +\let\@hundredthstring=\@@hundredthstringFportuges +\def\@thousandth{mil\'esima}% +\@@ordinalstringportuges{#1}{#2}} +\let\@ordinalstringNportuges\@ordinalstringMportuges +\DeclareRobustCommand{\@OrdinalstringMportuges}[2]{% +\let\@unitthstring=\@@Unitthstringportuges +\let\@unitstring=\@@Unitstringportuges +\let\@teenthstring=\@@teenthstringportuges +\let\@tenthstring=\@@Tenthstringportuges +\let\@hundredthstring=\@@Hundredthstringportuges +\def\@thousandth{Mil\'esimo}% +\@@ordinalstringportuges{#1}{#2}} +\DeclareRobustCommand{\@OrdinalstringFportuges}[2]{% +\let\@unitthstring=\@@UnitthstringFportuges +\let\@unitstring=\@@UnitstringFportuges +\let\@teenthstring=\@@teenthstringportuges +\let\@tenthstring=\@@TenthstringFportuges +\let\@hundredthstring=\@@HundredthstringFportuges +\def\@thousandth{Mil\'esima}% +\@@ordinalstringportuges{#1}{#2}} +\let\@OrdinalstringNportuges\@OrdinalstringMportuges +\newcommand*{\@@unitthstringportuges}[1]{% +\ifcase#1\relax +zero% +\or primeiro% +\or segundo% +\or terceiro% +\or quarto% +\or quinto% +\or sexto% +\or s\'etimo% +\or oitavo% +\or nono% +\fi +} +\newcommand*{\@@tenthstringportuges}[1]{% +\ifcase#1\relax +\or d\'ecimo% +\or vig\'esimo% +\or trig\'esimo% +\or quadrag\'esimo% +\or q\"uinquag\'esimo% +\or sexag\'esimo% +\or setuag\'esimo% +\or octog\'esimo% +\or nonag\'esimo% +\fi +} +\newcommand*{\@@teenthstringportuges}[1]{% +\@tenthstring{1}% +\ifnum#1>0\relax +-\@unitthstring{#1}% +\fi} +\newcommand*{\@@hundredthstringportuges}[1]{% +\ifcase#1\relax +\or cent\'esimo% +\or ducent\'esimo% +\or trecent\'esimo% +\or quadringent\'esimo% +\or q\"uingent\'esimo% +\or seiscent\'esimo% +\or setingent\'esimo% +\or octingent\'esimo% +\or nongent\'esimo% +\fi} +\newcommand*{\@@unitthstringFportuges}[1]{% +\ifcase#1\relax +zero% +\or primeira% +\or segunda% +\or terceira% +\or quarta% +\or quinta% +\or sexta% +\or s\'etima% +\or oitava% +\or nona% +\fi +} +\newcommand*{\@@tenthstringFportuges}[1]{% +\ifcase#1\relax +\or d\'ecima% +\or vig\'esima% +\or trig\'esima% +\or quadrag\'esima% +\or q\"uinquag\'esima% +\or sexag\'esima% +\or setuag\'esima% +\or octog\'esima% +\or nonag\'esima% +\fi +} +\newcommand*{\@@hundredthstringFportuges}[1]{% +\ifcase#1\relax +\or cent\'esima% +\or ducent\'esima% +\or trecent\'esima% +\or quadringent\'esima% +\or q\"uingent\'esima% +\or seiscent\'esima% +\or setingent\'esima% +\or octingent\'esima% +\or nongent\'esima% +\fi} +\newcommand*{\@@Unitthstringportuges}[1]{% +\ifcase#1\relax +Zero% +\or Primeiro% +\or Segundo% +\or Terceiro% +\or Quarto% +\or Quinto% +\or Sexto% +\or S\'etimo% +\or Oitavo% +\or Nono% +\fi +} +\newcommand*{\@@Tenthstringportuges}[1]{% +\ifcase#1\relax +\or D\'ecimo% +\or Vig\'esimo% +\or Trig\'esimo% +\or Quadrag\'esimo% +\or Q\"uinquag\'esimo% +\or Sexag\'esimo% +\or Setuag\'esimo% +\or Octog\'esimo% +\or Nonag\'esimo% +\fi +} +\newcommand*{\@@Hundredthstringportuges}[1]{% +\ifcase#1\relax +\or Cent\'esimo% +\or Ducent\'esimo% +\or Trecent\'esimo% +\or Quadringent\'esimo% +\or Q\"uingent\'esimo% +\or Seiscent\'esimo% +\or Setingent\'esimo% +\or Octingent\'esimo% +\or Nongent\'esimo% +\fi} +\newcommand*{\@@UnitthstringFportuges}[1]{% +\ifcase#1\relax +Zera% +\or Primeira% +\or Segunda% +\or Terceira% +\or Quarta% +\or Quinta% +\or Sexta% +\or S\'etima% +\or Oitava% +\or Nona% +\fi +} +\newcommand*{\@@TenthstringFportuges}[1]{% +\ifcase#1\relax +\or D\'ecima% +\or Vig\'esima% +\or Trig\'esima% +\or Quadrag\'esima% +\or Q\"uinquag\'esima% +\or Sexag\'esima% +\or Setuag\'esima% +\or Octog\'esima% +\or Nonag\'esima% +\fi +} +\newcommand*{\@@HundredthstringFportuges}[1]{% +\ifcase#1\relax +\or Cent\'esima% +\or Ducent\'esima% +\or Trecent\'esima% +\or Quadringent\'esima% +\or Q\"uingent\'esima% +\or Seiscent\'esima% +\or Setingent\'esima% +\or Octingent\'esima% +\or Nongent\'esima% +\fi} +\newcommand*{\@@numberstringportuges}[2]{% +\ifnum#1>99999 +\PackageError{fmtcount}{Out of range}% +{This macro only works for values less than 100000}% +\else +\ifnum#1<0 +\PackageError{fmtcount}{Negative numbers not permitted}% +{This macro does not work for negative numbers, however +you can try typing "minus" first, and then pass the modulus of +this number}% +\fi +\fi +\def#2{}% +\@strctr=#1\relax \divide\@strctr by 1000\relax +\ifnum\@strctr>9 + \divide\@strctr by 10 + \ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1 \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \ifnum\@strctr>0 + \ifnum\@strctr=1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname}% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@unitstring{\@strctr}}% + \fi + \else + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@thousand}% +\else + \ifnum\@strctr>0\relax + \ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ }% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@thousand}% + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{1000}% +\divide\@strctr by 100\relax +\ifnum\@strctr>0\relax + \ifnum#1>1000 \relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ }% + \fi + \@tmpstrctr=#1\relax + \@modulo{\@tmpstrctr}{1000}% + \let\@@fc@numstr#2\relax + \ifnum\@tmpstrctr=100\relax + \edef#2{\@@fc@numstr\@tenstring{10}}% + \else + \edef#2{\@@fc@numstr\@hundredstring{\@strctr}}% + \fi% +\fi +\@strctr=#1\relax \@modulo{\@strctr}{100}% +\ifnum#1>100\relax + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname\ }% + \fi +\fi +\ifnum\@strctr>19\relax + \divide\@strctr by 10\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{10}% + \ifnum\@strctr>0 + \ifnum\@strctr=1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname}% + \else + \ifnum#1>100\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname}% + \fi + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@unitstring{\@strctr}}% + \fi +\else + \ifnum\@strctr<10\relax + \ifnum\@strctr=0\relax + \ifnum#1<100\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else%(>0,<10) + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else%>10 + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi +\fi +} +\newcommand*{\@@ordinalstringportuges}[2]{% +\@strctr=#1\relax +\ifnum#1>99999 +\PackageError{fmtcount}{Out of range}% +{This macro only works for values less than 100000}% +\else +\ifnum#1<0 +\PackageError{fmtcount}{Negative numbers not permitted}% +{This macro does not work for negative numbers, however +you can try typing "minus" first, and then pass the modulus of +this number}% +\else +\def#2{}% +\ifnum\@strctr>999\relax + \divide\@strctr by 1000\relax + \ifnum\@strctr>1\relax + \ifnum\@strctr>9\relax + \@tmpstrctr=\@strctr + \ifnum\@strctr<20 + \@modulo{\@tmpstrctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenthstring{\@tmpstrctr}}% + \else + \divide\@tmpstrctr by 10\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenthstring{\@tmpstrctr}}% + \@tmpstrctr=\@strctr + \@modulo{\@tmpstrctr}{10}% + \ifnum\@tmpstrctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@tmpstrctr}}% + \fi + \fi + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}% + \fi + \fi + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@thousandth}% +\fi +\@strctr=#1\relax +\@modulo{\@strctr}{1000}% +\ifnum\@strctr>99\relax + \@tmpstrctr=\@strctr + \divide\@tmpstrctr by 100\relax + \ifnum#1>1000\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr-}% + \fi + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@hundredthstring{\@tmpstrctr}}% +\fi +\@modulo{\@strctr}{100}% +\ifnum#1>99\relax + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr-}% + \fi +\fi +\ifnum\@strctr>9\relax + \@tmpstrctr=\@strctr + \divide\@tmpstrctr by 10\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenthstring{\@tmpstrctr}}% + \@tmpstrctr=\@strctr + \@modulo{\@tmpstrctr}{10}% + \ifnum\@tmpstrctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr-\@unitthstring{\@tmpstrctr}}% + \fi +\else + \ifnum\@strctr=0\relax + \ifnum#1=0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{0}}% + \fi + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}% + \fi +\fi +\fi +\fi +} +\endinput +%% +%% End of file `fc-portuges.def'. diff --git a/Master/texmf-dist/tex/latex/fmtcount/fc-spanish.def b/Master/texmf-dist/tex/latex/fmtcount/fc-spanish.def new file mode 100644 index 00000000000..f96f924b712 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fc-spanish.def @@ -0,0 +1,738 @@ +%% +%% This is file `fc-spanish.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fc-spanish.def,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{fc-spanish.def}[2007/05/26] +\newcommand{\@ordinalMspanish}[2]{% +\edef#2{\number#1\relax\noexpand\fmtord{o}}} +\newcommand{\@ordinalFspanish}[2]{% +\edef#2{\number#1\relax\noexpand\fmtord{a}}} +\let\@ordinalNspanish\@ordinalMspanish +\newcommand{\@@unitstringspanish}[1]{% +\ifcase#1\relax +cero% +\or uno% +\or dos% +\or tres% +\or cuatro% +\or cinco% +\or seis% +\or siete% +\or ocho% +\or nueve% +\fi +} +\newcommand{\@@unitstringFspanish}[1]{% +\ifcase#1\relax +cera% +\or una% +\or dos% +\or tres% +\or cuatro% +\or cinco% +\or seis% +\or siete% +\or ocho% +\or nueve% +\fi +} +\newcommand{\@@tenstringspanish}[1]{% +\ifcase#1\relax +\or diez% +\or viente% +\or treinta% +\or cuarenta% +\or cincuenta% +\or sesenta% +\or setenta% +\or ochenta% +\or noventa% +\or cien% +\fi +} +\newcommand{\@@teenstringspanish}[1]{% +\ifcase#1\relax +diez% +\or once% +\or doce% +\or trece% +\or catorce% +\or quince% +\or diecis\'eis% +\or diecisiete% +\or dieciocho% +\or diecinueve% +\fi +} +\newcommand{\@@twentystringspanish}[1]{% +\ifcase#1\relax +veinte% +\or veintiuno% +\or veintid\'os% +\or veintitr\'es% +\or veinticuatro% +\or veinticinco% +\or veintis\'eis% +\or veintisiete% +\or veintiocho% +\or veintinueve% +\fi} +\newcommand{\@@twentystringFspanish}[1]{% +\ifcase#1\relax +veinte% +\or veintiuna% +\or veintid\'os% +\or veintitr\'es% +\or veinticuatro% +\or veinticinco% +\or veintis\'eis% +\or veintisiete% +\or veintiocho% +\or veintinueve% +\fi} +\newcommand{\@@hundredstringspanish}[1]{% +\ifcase#1\relax +\or ciento% +\or doscientos% +\or trescientos% +\or cuatrocientos% +\or quinientos% +\or seiscientos% +\or setecientos% +\or ochocientos% +\or novecientos% +\fi} +\newcommand{\@@hundredstringFspanish}[1]{% +\ifcase#1\relax +\or cienta% +\or doscientas% +\or trescientas% +\or cuatrocientas% +\or quinientas% +\or seiscientas% +\or setecientas% +\or ochocientas% +\or novecientas% +\fi} +\newcommand{\@@Unitstringspanish}[1]{% +\ifcase#1\relax +Cero% +\or Uno% +\or Dos% +\or Tres% +\or Cuatro% +\or Cinco% +\or Seis% +\or Siete% +\or Ocho% +\or Nueve% +\fi +} +\newcommand{\@@UnitstringFspanish}[1]{% +\ifcase#1\relax +Cera% +\or Una% +\or Dos% +\or Tres% +\or Cuatro% +\or Cinco% +\or Seis% +\or Siete% +\or Ocho% +\or Nueve% +\fi +} +\newcommand{\@@Tenstringspanish}[1]{% +\ifcase#1\relax +\or Diez% +\or Viente% +\or Treinta% +\or Cuarenta% +\or Cincuenta% +\or Sesenta% +\or Setenta% +\or Ochenta% +\or Noventa% +\or Cien% +\fi +} +\newcommand{\@@Teenstringspanish}[1]{% +\ifcase#1\relax +Diez% +\or Once% +\or Doce% +\or Trece% +\or Catorce% +\or Quince% +\or Diecis\'eis% +\or Diecisiete% +\or Dieciocho% +\or Diecinueve% +\fi +} +\newcommand{\@@Twentystringspanish}[1]{% +\ifcase#1\relax +Veinte% +\or Veintiuno% +\or Veintid\'os% +\or Veintitr\'es% +\or Veinticuatro% +\or Veinticinco% +\or Veintis\'eis% +\or Veintisiete% +\or Veintiocho% +\or Veintinueve% +\fi} +\newcommand{\@@TwentystringFspanish}[1]{% +\ifcase#1\relax +Veinte% +\or Veintiuna% +\or Veintid\'os% +\or Veintitr\'es% +\or Veinticuatro% +\or Veinticinco% +\or Veintis\'eis% +\or Veintisiete% +\or Veintiocho% +\or Veintinueve% +\fi} +\newcommand{\@@Hundredstringspanish}[1]{% +\ifcase#1\relax +\or Ciento% +\or Doscientos% +\or Trescientos% +\or Cuatrocientos% +\or Quinientos% +\or Seiscientos% +\or Setecientos% +\or Ochocientos% +\or Novecientos% +\fi} +\newcommand{\@@HundredstringFspanish}[1]{% +\ifcase#1\relax +\or Cienta% +\or Doscientas% +\or Trescientas% +\or Cuatrocientas% +\or Quinientas% +\or Seiscientas% +\or Setecientas% +\or Ochocientas% +\or Novecientas% +\fi} +\DeclareRobustCommand{\@numberstringMspanish}[2]{% +\let\@unitstring=\@@unitstringspanish +\let\@teenstring=\@@teenstringspanish +\let\@tenstring=\@@tenstringspanish +\let\@twentystring=\@@twentystringspanish +\let\@hundredstring=\@@hundredstringspanish +\def\@hundred{cien}\def\@thousand{mil}% +\def\@andname{y}% +\@@numberstringspanish{#1}{#2}} +\DeclareRobustCommand{\@numberstringFspanish}[2]{% +\let\@unitstring=\@@unitstringFspanish +\let\@teenstring=\@@teenstringspanish +\let\@tenstring=\@@tenstringspanish +\let\@twentystring=\@@twentystringFspanish +\let\@hundredstring=\@@hundredstringFspanish +\def\@hundred{cien}\def\@thousand{mil}% +\def\@andname{y}% +\@@numberstringspanish{#1}{#2}} +\let\@numberstringNspanish\@numberstringMspanish +\DeclareRobustCommand{\@NumberstringMspanish}[2]{% +\let\@unitstring=\@@Unitstringspanish +\let\@teenstring=\@@Teenstringspanish +\let\@tenstring=\@@Tenstringspanish +\let\@twentystring=\@@Twentystringspanish +\let\@hundredstring=\@@Hundredstringspanish +\def\@andname{y}% +\def\@hundred{Cien}\def\@thousand{Mil}% +\@@numberstringspanish{#1}{#2}} +\DeclareRobustCommand{\@NumberstringFspanish}[2]{% +\let\@unitstring=\@@UnitstringFspanish +\let\@teenstring=\@@Teenstringspanish +\let\@tenstring=\@@Tenstringspanish +\let\@twentystring=\@@TwentystringFspanish +\let\@hundredstring=\@@HundredstringFspanish +\def\@andname{y}% +\def\@hundred{Cien}\def\@thousand{Mil}% +\@@numberstringspanish{#1}{#2}} +\let\@NumberstringNspanish\@NumberstringMspanish +\DeclareRobustCommand{\@ordinalstringMspanish}[2]{% +\let\@unitthstring=\@@unitthstringspanish +\let\@unitstring=\@@unitstringspanish +\let\@teenthstring=\@@teenthstringspanish +\let\@tenthstring=\@@tenthstringspanish +\let\@hundredthstring=\@@hundredthstringspanish +\def\@thousandth{mil\'esimo}% +\@@ordinalstringspanish{#1}{#2}} +\DeclareRobustCommand{\@ordinalstringFspanish}[2]{% +\let\@unitthstring=\@@unitthstringFspanish +\let\@unitstring=\@@unitstringFspanish +\let\@teenthstring=\@@teenthstringFspanish +\let\@tenthstring=\@@tenthstringFspanish +\let\@hundredthstring=\@@hundredthstringFspanish +\def\@thousandth{mil\'esima}% +\@@ordinalstringspanish{#1}{#2}} +\let\@ordinalstringNspanish\@ordinalstringMspanish +\DeclareRobustCommand{\@OrdinalstringMspanish}[2]{% +\let\@unitthstring=\@@Unitthstringspanish +\let\@unitstring=\@@Unitstringspanish +\let\@teenthstring=\@@Teenthstringspanish +\let\@tenthstring=\@@Tenthstringspanish +\let\@hundredthstring=\@@Hundredthstringspanish +\def\@thousandth{Mil\'esimo}% +\@@ordinalstringspanish{#1}{#2}} +\DeclareRobustCommand{\@OrdinalstringFspanish}[2]{% +\let\@unitthstring=\@@UnitthstringFspanish +\let\@unitstring=\@@UnitstringFspanish +\let\@teenthstring=\@@TeenthstringFspanish +\let\@tenthstring=\@@TenthstringFspanish +\let\@hundredthstring=\@@HundredthstringFspanish +\def\@thousandth{Mil\'esima}% +\@@ordinalstringspanish{#1}{#2}} +\let\@OrdinalstringNspanish\@OrdinalstringMspanish +\newcommand{\@@unitthstringspanish}[1]{% +\ifcase#1\relax +cero% +\or primero% +\or segundo% +\or tercero% +\or cuarto% +\or quinto% +\or sexto% +\or s\'eptimo% +\or octavo% +\or noveno% +\fi +} +\newcommand{\@@tenthstringspanish}[1]{% +\ifcase#1\relax +\or d\'ecimo% +\or vig\'esimo% +\or trig\'esimo% +\or cuadrag\'esimo% +\or quincuag\'esimo% +\or sexag\'esimo% +\or septuag\'esimo% +\or octog\'esimo% +\or nonag\'esimo% +\fi +} +\newcommand{\@@teenthstringspanish}[1]{% +\ifcase#1\relax +d\'ecimo% +\or und\'ecimo% +\or duod\'ecimo% +\or decimotercero% +\or decimocuarto% +\or decimoquinto% +\or decimosexto% +\or decimos\'eptimo% +\or decimoctavo% +\or decimonoveno% +\fi +} +\newcommand{\@@hundredthstringspanish}[1]{% +\ifcase#1\relax +\or cent\'esimo% +\or ducent\'esimo% +\or tricent\'esimo% +\or cuadringent\'esimo% +\or quingent\'esimo% +\or sexcent\'esimo% +\or septing\'esimo% +\or octingent\'esimo% +\or noningent\'esimo% +\fi} +\newcommand{\@@unitthstringFspanish}[1]{% +\ifcase#1\relax +cera% +\or primera% +\or segunda% +\or tercera% +\or cuarta% +\or quinta% +\or sexta% +\or s\'eptima% +\or octava% +\or novena% +\fi +} +\newcommand{\@@tenthstringFspanish}[1]{% +\ifcase#1\relax +\or d\'ecima% +\or vig\'esima% +\or trig\'esima% +\or cuadrag\'esima% +\or quincuag\'esima% +\or sexag\'esima% +\or septuag\'esima% +\or octog\'esima% +\or nonag\'esima% +\fi +} +\newcommand{\@@teenthstringFspanish}[1]{% +\ifcase#1\relax +d\'ecima% +\or und\'ecima% +\or duod\'ecima% +\or decimotercera% +\or decimocuarta% +\or decimoquinta% +\or decimosexta% +\or decimos\'eptima% +\or decimoctava% +\or decimonovena% +\fi +} +\newcommand{\@@hundredthstringFspanish}[1]{% +\ifcase#1\relax +\or cent\'esima% +\or ducent\'esima% +\or tricent\'esima% +\or cuadringent\'esima% +\or quingent\'esima% +\or sexcent\'esima% +\or septing\'esima% +\or octingent\'esima% +\or noningent\'esima% +\fi} +\newcommand{\@@Unitthstringspanish}[1]{% +\ifcase#1\relax +Cero% +\or Primero% +\or Segundo% +\or Tercero% +\or Cuarto% +\or Quinto% +\or Sexto% +\or S\'eptimo% +\or Octavo% +\or Noveno% +\fi +} +\newcommand{\@@Tenthstringspanish}[1]{% +\ifcase#1\relax +\or D\'ecimo% +\or Vig\'esimo% +\or Trig\'esimo% +\or Cuadrag\'esimo% +\or Quincuag\'esimo% +\or Sexag\'esimo% +\or Septuag\'esimo% +\or Octog\'esimo% +\or Nonag\'esimo% +\fi +} +\newcommand{\@@Teenthstringspanish}[1]{% +\ifcase#1\relax +D\'ecimo% +\or Und\'ecimo% +\or Duod\'ecimo% +\or Decimotercero% +\or Decimocuarto% +\or Decimoquinto% +\or Decimosexto% +\or Decimos\'eptimo% +\or Decimoctavo% +\or Decimonoveno% +\fi +} +\newcommand{\@@Hundredthstringspanish}[1]{% +\ifcase#1\relax +\or Cent\'esimo% +\or Ducent\'esimo% +\or Tricent\'esimo% +\or Cuadringent\'esimo% +\or Quingent\'esimo% +\or Sexcent\'esimo% +\or Septing\'esimo% +\or Octingent\'esimo% +\or Noningent\'esimo% +\fi} +\newcommand{\@@UnitthstringFspanish}[1]{% +\ifcase#1\relax +Cera% +\or Primera% +\or Segunda% +\or Tercera% +\or Cuarta% +\or Quinta% +\or Sexta% +\or S\'eptima% +\or Octava% +\or Novena% +\fi +} +\newcommand{\@@TenthstringFspanish}[1]{% +\ifcase#1\relax +\or D\'ecima% +\or Vig\'esima% +\or Trig\'esima% +\or Cuadrag\'esima% +\or Quincuag\'esima% +\or Sexag\'esima% +\or Septuag\'esima% +\or Octog\'esima% +\or Nonag\'esima% +\fi +} +\newcommand{\@@TeenthstringFspanish}[1]{% +\ifcase#1\relax +D\'ecima% +\or Und\'ecima% +\or Duod\'ecima% +\or Decimotercera% +\or Decimocuarta% +\or Decimoquinta% +\or Decimosexta% +\or Decimos\'eptima% +\or Decimoctava% +\or Decimonovena% +\fi +} +\newcommand{\@@HundredthstringFspanish}[1]{% +\ifcase#1\relax +\or Cent\'esima% +\or Ducent\'esima% +\or Tricent\'esima% +\or Cuadringent\'esima% +\or Quingent\'esima% +\or Sexcent\'esima% +\or Septing\'esima% +\or Octingent\'esima% +\or Noningent\'esima% +\fi} + +\newcommand{\@@numberstringspanish}[2]{% +\ifnum#1>99999 +\PackageError{fmtcount}{Out of range}% +{This macro only works for values less than 100000}% +\else +\ifnum#1<0 +\PackageError{fmtcount}{Negative numbers not permitted}% +{This macro does not work for negative numbers, however +you can try typing "minus" first, and then pass the modulus of +this number}% +\fi +\fi +\def#2{}% +\@strctr=#1\relax \divide\@strctr by 1000\relax +\ifnum\@strctr>9 + \divide\@strctr by 10 + \ifnum\@strctr>1 + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1 \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname\ \@unitstring{\@strctr}}% + \fi + \else + \@strctr=#1\relax + \divide\@strctr by 1000\relax + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@thousand}% +\else + \ifnum\@strctr>0\relax + \ifnum\@strctr>1\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}\ }% + \fi + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@thousand}% + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{1000}% +\divide\@strctr by 100\relax +\ifnum\@strctr>0\relax + \ifnum#1>1000\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ }% + \fi + \@tmpstrctr=#1\relax + \@modulo{\@tmpstrctr}{1000}% + \ifnum\@tmpstrctr=100\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{10}}% + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@hundredstring{\@strctr}}% + \fi +\fi +\@strctr=#1\relax \@modulo{\@strctr}{100}% +\ifnum#1>100\relax + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname\ }% + \fi +\fi +\ifnum\@strctr>29\relax + \divide\@strctr by 10\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@tenstring{\@strctr}}% + \@strctr=#1\relax \@modulo{\@strctr}{10}% + \ifnum\@strctr>0\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\ \@andname\ \@unitstring{\@strctr}}% + \fi +\else + \ifnum\@strctr<10\relax + \ifnum\@strctr=0\relax + \ifnum#1<100\relax + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@unitstring{\@strctr}}% + \fi + \else + \ifnum\@strctr>19\relax + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@twentystring{\@strctr}}% + \else + \@modulo{\@strctr}{10}% + \let\@@fc@numstr#2\relax + \edef#2{\@@fc@numstr\@teenstring{\@strctr}}% + \fi + \fi +\fi +} +\newcommand{\@@ordinalstringspanish}[2]{% +\@strctr=#1\relax +\ifnum#1>99999 +\PackageError{fmtcount}{Out of range}% +{This macro only works for values less than 100000}% +\else +\ifnum#1<0 +\PackageError{fmtcount}{Negative numbers not permitted}% +{This macro does not work for negative numbers, however +you can try typing "minus" first, and then pass the modulus of +this number}% +\else +\def#2{}% +\ifnum\@strctr>999\relax + \divide\@strctr by 1000\relax + \ifnum\@strctr>1\relax + \ifnum\@strctr>9\relax + \@tmpstrctr=\@strctr + \ifnum\@strctr<20 + \@modulo{\@tmpstrctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenthstring{\@tmpstrctr}}% + \else + \divide\@tmpstrctr by 10\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenthstring{\@tmpstrctr}}% + \@tmpstrctr=\@strctr + \@modulo{\@tmpstrctr}{10}% + \ifnum\@tmpstrctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@tmpstrctr}}% + \fi + \fi + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{\@strctr}}% + \fi + \fi + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@thousandth}% +\fi +\@strctr=#1\relax +\@modulo{\@strctr}{1000}% +\ifnum\@strctr>99\relax + \@tmpstrctr=\@strctr + \divide\@tmpstrctr by 100\relax + \ifnum#1>1000\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ }% + \fi + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@hundredthstring{\@tmpstrctr}}% +\fi +\@modulo{\@strctr}{100}% +\ifnum#1>99\relax + \ifnum\@strctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ }% + \fi +\fi +\ifnum\@strctr>19\relax + \@tmpstrctr=\@strctr + \divide\@tmpstrctr by 10\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@tenthstring{\@tmpstrctr}}% + \@tmpstrctr=\@strctr + \@modulo{\@tmpstrctr}{10}% + \ifnum\@tmpstrctr>0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\ \@unitthstring{\@tmpstrctr}}% + \fi +\else + \ifnum\@strctr>9\relax + \@modulo{\@strctr}{10}% + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@teenthstring{\@strctr}}% + \else + \ifnum\@strctr=0\relax + \ifnum#1=0\relax + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitstring{0}}% + \fi + \else + \let\@@fc@ordstr#2\relax + \edef#2{\@@fc@ordstr\@unitthstring{\@strctr}}% + \fi + \fi +\fi +\fi +\fi +} +\endinput +%% +%% End of file `fc-spanish.def'. diff --git a/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty b/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty new file mode 100644 index 00000000000..5b4748b6599 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty @@ -0,0 +1,701 @@ +%% +%% This is file `fmtcount.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fmtcount.dtx (with options: `fmtcount.sty,package') +%% +%% fmtcount.dtx +%% Copyright 2007 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license of (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files fmtcount.dtx and fmtcount.ins and the derived files fc-british.def, fc-english.def, fc-french.def, fc-german.def, fc-portuges.def, fc-spanish.def, fc-UKenglish.def, fc-USenglish.def, fmtcount.sty, fmtcount.perl. +%% +%% \CharacterTable +%% {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 +%% 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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{fmtcount}[2007/07/20 v1.3] +\RequirePackage{ifthen} +\RequirePackage{keyval} +\providecommand*{\fmtord}[1]{\textsuperscript{#1}} +\newcount\c@padzeroesN +\c@padzeroesN=1\relax +\providecommand*{\padzeroes}[1][17]{\c@padzeroesN=#1} +\@ifundefined{l@english}{}{\input{fc-english.def}} +\@ifundefined{l@UKenglish}{}{\input{fc-UKenglish.def}} +\@ifundefined{l@british}{}{\input{fc-british.def}} +\@ifundefined{l@USenglish}{}{\input{fc-USenglish.def}} +\@ifundefined{l@spanish}{}{\input{fc-spanish.def}} +\@ifundefined{l@portuges}{}{\input{fc-portuges.def}} +\@ifundefined{l@french}{}{\input{fc-french.def}} +\@ifundefined{l@german}{% +\@ifundefined{l@ngerman}{}{\input{fc-german.def}}}{% +\input{fc-german.def}} +\def\fmtcount@french{france} +\define@key{fmtcount}{french}[france]{% +\@ifundefined{datefrench}{% +\PackageError{fmtcount}{Language `french' not defined}{You need +to load babel before loading fmtcount}}{ +\ifthenelse{\equal{#1}{france} + \or\equal{#1}{swiss} + \or\equal{#1}{belgian}}{% + \def\fmtcount@french{#1}}{% +\PackageError{fmtcount}{Invalid value `#1' to french key} +{Option `french' can only take the values `france', +`belgian' or `swiss'}} +}} +\define@key{fmtcount}{fmtord}{% +\ifthenelse{\equal{#1}{level} + \or\equal{#1}{raise} + \or\equal{#1}{user}}{ + \def\fmtcount@fmtord{#1}}{% +\PackageError{fmtcount}{Invalid value `#1' to fmtord key} +{Option `fmtord' can only take the values `level', `raise' +or `user'}}} +\newif\iffmtord@abbrv +\fmtord@abbrvfalse +\define@key{fmtcount}{abbrv}[true]{% +\ifthenelse{\equal{#1}{true}\or\equal{#1}{false}}{ + \csname fmtord@abbrv#1\endcsname}{% +\PackageError{fmtcount}{Invalid value `#1' to fmtord key} +{Option `fmtord' can only take the values `true' or +`false'}}} +\newcommand*{\fmtcountsetoptions}[1]{% +\def\fmtcount@fmtord{}% +\setkeys{fmtcount}{#1}% +\@ifundefined{datefrench}{}{% +\edef\@ordinalstringMfrench{\noexpand +\csname @ordinalstringMfrench\fmtcount@french\noexpand\endcsname}% +\edef\@ordinalstringFfrench{\noexpand +\csname @ordinalstringFfrench\fmtcount@french\noexpand\endcsname}% +\edef\@OrdinalstringMfrench{\noexpand +\csname @OrdinalstringMfrench\fmtcount@french\noexpand\endcsname}% +\edef\@OrdinalstringFfrench{\noexpand +\csname @OrdinalstringFfrench\fmtcount@french\noexpand\endcsname}% +\edef\@numberstringMfrench{\noexpand +\csname @numberstringMfrench\fmtcount@french\noexpand\endcsname}% +\edef\@numberstringFfrench{\noexpand +\csname @numberstringFfrench\fmtcount@french\noexpand\endcsname}% +\edef\@NumberstringMfrench{\noexpand +\csname @NumberstringMfrench\fmtcount@french\noexpand\endcsname}% +\edef\@NumberstringFfrench{\noexpand +\csname @NumberstringFfrench\fmtcount@french\noexpand\endcsname}% +}% +\ifthenelse{\equal{\fmtcount@fmtord}{level}}{% +\renewcommand{\fmtord}[1]{##1}}{% +\ifthenelse{\equal{\fmtcount@fmtord}{raise}}{% +\renewcommand{\fmtord}[1]{\textsuperscript{##1}}}{% +}} +} +\InputIfFileExists{fmtcount.cfg}{% +\typeout{Using configuration file fmtcount.cfg}}{% +\typeout{No configuration file fmtcount.cfg found.}} +\DeclareOption{level}{\def\fmtcount@fmtord{level}% +\def\fmtord#1{#1}} +\DeclareOption{raise}{\def\fmtcount@fmtord{raise}% +\def\fmtord#1{\textsuperscript{#1}}} +\ProcessOptions +\newcount\@DT@modctr +\def\@modulo#1#2{% +\@DT@modctr=#1\relax +\divide \@DT@modctr by #2\relax +\multiply \@DT@modctr by #2\relax +\advance #1 by -\@DT@modctr} +\newcount\@ordinalctr +\newcount\@orgargctr +\newcount\@strctr +\newcount\@tmpstrctr +\newif\if@DT@padzeroes +\newcount\@DT@loopN +\newcount\@DT@X +\newcommand*{\@binary}[1]{% +\@DT@padzeroestrue +\@DT@loopN=17\relax +\@strctr=\@DT@loopN +\whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by 1}% +\@strctr=65536\relax +\@DT@X=#1\relax +\loop +\@DT@modctr=\@DT@X +\divide\@DT@modctr by \@strctr +\ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\the\@DT@modctr}% +\ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi +\multiply\@DT@modctr by \@strctr +\advance\@DT@X by -\@DT@modctr +\divide\@strctr by 2\relax +\advance\@DT@loopN by -1\relax +\ifnum\@strctr>1 +\repeat +\the\@DT@X} + +\let\binarynum=\@binary +\newcommand*{\@octal}[1]{% +\ifnum#1>32768 +\PackageError{fmtcount}{Value of counter too large for \protect\@octal}{Maximum value 32768} +\else +\@DT@padzeroestrue +\@DT@loopN=6\relax +\@strctr=\@DT@loopN +\whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by 1}% +\@strctr=32768\relax +\@DT@X=#1\relax +\loop +\@DT@modctr=\@DT@X +\divide\@DT@modctr by \@strctr +\ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\the\@DT@modctr}% +\ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi +\multiply\@DT@modctr by \@strctr +\advance\@DT@X by -\@DT@modctr +\divide\@strctr by 8\relax +\advance\@DT@loopN by -1\relax +\ifnum\@strctr>1 +\repeat +\the\@DT@X +\fi} +\let\octalnum=\@octal +\newcommand*{\@@hexadecimal}[1]{\ifcase#10\or1\or2\or3\or4\or5\or +6\or7\or8\or9\or a\or b\or c\or d\or e\or f\fi} + +\newcommand*{\@hexadecimal}[1]{% +\@DT@padzeroestrue +\@DT@loopN=5\relax +\@strctr=\@DT@loopN +\whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by 1}% +\@strctr=65536\relax +\@DT@X=#1\relax +\loop +\@DT@modctr=\@DT@X +\divide\@DT@modctr by \@strctr +\ifthenelse{\boolean{@DT@padzeroes}\and\(\@DT@modctr=0\)\and +\(\@DT@loopN>\c@padzeroesN\)}{}{\@@hexadecimal\@DT@modctr}% +\ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi +\multiply\@DT@modctr by \@strctr +\advance\@DT@X by -\@DT@modctr +\divide\@strctr by 16\relax +\advance\@DT@loopN by -1\relax +\ifnum\@strctr>1 +\repeat +\@@hexadecimal\@DT@X} + +\let\hexadecimalnum=\@hexadecimal +\newcommand*{\@@Hexadecimal}[1]{\ifcase#10\or1\or2\or3\or4\or5\or6\or +7\or8\or9\or A\or B\or C\or D\or E\or F\fi} + +\newcommand*{\@Hexadecimal}[1]{% +\@DT@padzeroestrue +\@DT@loopN=5\relax +\@strctr=\@DT@loopN +\whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by 1}% +\@strctr=65536\relax +\@DT@X=#1\relax +\loop +\@DT@modctr=\@DT@X +\divide\@DT@modctr by \@strctr +\ifthenelse{\boolean{@DT@padzeroes} \and \(\@DT@modctr=0\) \and \(\@DT@loopN>\c@padzeroesN\)}{}{\@@Hexadecimal\@DT@modctr}% +\ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi +\multiply\@DT@modctr by \@strctr +\advance\@DT@X by -\@DT@modctr +\divide\@strctr by 16\relax +\advance\@DT@loopN by -1\relax +\ifnum\@strctr>1 +\repeat +\@@Hexadecimal\@DT@X} + +\let\Hexadecimalnum=\@Hexadecimal +\newcommand*{\@aaalph}[1]{% +\@DT@loopN=#1\relax +\advance\@DT@loopN by -1\relax +\divide\@DT@loopN by 26\relax +\@DT@modctr=\@DT@loopN +\multiply\@DT@modctr by 26\relax +\@DT@X=#1\relax +\advance\@DT@X by -1\relax +\advance\@DT@X by -\@DT@modctr +\advance\@DT@loopN by 1\relax +\advance\@DT@X by 1\relax +\loop +\@alph\@DT@X +\advance\@DT@loopN by -1\relax +\ifnum\@DT@loopN>0 +\repeat +} + +\let\aaalphnum=\@aaalph +\newcommand*{\@AAAlph}[1]{% +\@DT@loopN=#1\relax +\advance\@DT@loopN by -1\relax +\divide\@DT@loopN by 26\relax +\@DT@modctr=\@DT@loopN +\multiply\@DT@modctr by 26\relax +\@DT@X=#1\relax +\advance\@DT@X by -1\relax +\advance\@DT@X by -\@DT@modctr +\advance\@DT@loopN by 1\relax +\advance\@DT@X by 1\relax +\loop +\@Alph\@DT@X +\advance\@DT@loopN by -1\relax +\ifnum\@DT@loopN>0 +\repeat +} + +\let\AAAlphnum=\@AAAlph +\newcommand*{\@abalph}[1]{% +\ifnum#1>17576\relax +\PackageError{fmtcount}{Value of counter too large for +\protect\@abalph}{Maximum value 17576}% +\else +\@DT@padzeroestrue +\@strctr=17576\relax +\@DT@X=#1\relax +\advance\@DT@X by -1\relax +\loop +\@DT@modctr=\@DT@X +\divide\@DT@modctr by \@strctr +\ifthenelse{\boolean{@DT@padzeroes}\and +\(\@DT@modctr=1\)}{}{\@alph\@DT@modctr}% +\ifnum\@DT@modctr=1\else\@DT@padzeroesfalse\fi +\multiply\@DT@modctr by \@strctr +\advance\@DT@X by -\@DT@modctr +\divide\@strctr by 26\relax +\ifnum\@strctr>1 +\repeat +\advance\@DT@X by 1\relax +\@alph\@DT@X +\fi} + +\let\abalphnum=\@abalph +\newcommand*{\@ABAlph}[1]{% +\ifnum#1>17576\relax +\PackageError{fmtcount}{Value of counter too large for +\protect\@ABAlph}{Maximum value 17576}% +\else +\@DT@padzeroestrue +\@strctr=17576\relax +\@DT@X=#1\relax +\advance\@DT@X by -1\relax +\loop +\@DT@modctr=\@DT@X +\divide\@DT@modctr by \@strctr +\ifthenelse{\boolean{@DT@padzeroes}\and +\(\@DT@modctr=1\)}{}{\@Alph\@DT@modctr}% +\ifnum\@DT@modctr=1\else\@DT@padzeroesfalse\fi +\multiply\@DT@modctr by \@strctr +\advance\@DT@X by -\@DT@modctr +\divide\@strctr by 26\relax +\ifnum\@strctr>1 +\repeat +\advance\@DT@X by 1\relax +\@Alph\@DT@X +\fi} + +\let\ABAlphnum=\@ABAlph +\def\@fmtc@count#1#2\relax{% +\if\relax#1 +\else +\advance\@strctr by 1\relax +\@fmtc@count#2\relax +\fi} +\newcommand{\@decimal}[1]{% +\@strctr=0\relax +\expandafter\@fmtc@count\number#1\relax +\@DT@loopN=\c@padzeroesN +\advance\@DT@loopN by -\@strctr +\ifnum\@DT@loopN>0\relax +\@strctr=0\relax +\whiledo{\@strctr < \@DT@loopN}{0\advance\@strctr by 1}% +\fi +\number#1\relax +} + +\let\decimalnum=\@decimal +\newcommand{\FCordinal}[1]{% +\expandafter\protect\expandafter\ordinalnum{% +\expandafter\the\csname c@#1\endcsname}} +\@ifundefined{ordinal}{\let\ordinal\FCordinal}{% +\PackageWarning{fmtcount}{\string\ordinal +\space already defined use \string\FCordinal \space instead.}} +\newcommand*{\ordinalnum}[1]{\@ifnextchar[{\@ordinalnum{#1}}{% +\@ordinalnum{#1}[m]}} +\def\@ordinalnum#1[#2]{{% +\ifthenelse{\equal{#2}{f}}{% + \protect\@ordinalF{#1}{\@fc@ordstr}% + }{% + \ifthenelse{\equal{#2}{n}}{% + \protect\@ordinalN{#1}{\@fc@ordstr}% + }{% + \ifthenelse{\equal{#2}{m}}{}{% + \PackageError{fmtcount}{Invalid gender option `#2'}{% + Available options are m, f or n}% + }% + \protect\@ordinalM{#1}{\@fc@ordstr}% + }% + }% +\@fc@ordstr +}} +\newcommand*{\storeordinal}[2]{% +\expandafter\protect\expandafter\storeordinalnum{#1}{% +\expandafter\the\csname c@#2\endcsname}} +\newcommand*{\storeordinalnum}[2]{% +\@ifnextchar[{\@storeordinalnum{#1}{#2}}{% +\@storeordinalnum{#1}{#2}[m]}} +\def\@storeordinalnum#1#2[#3]{% +\ifthenelse{\equal{#3}{f}}{% +\protect\@ordinalF{#2}{\@fc@ord}}{% +\ifthenelse{\equal{#3}{n}}{% +\protect\@ordinalN{#2}{\@fc@ord}}{% +\ifthenelse{\equal{#3}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#3'}{% +Available options are m or f}}% +\protect\@ordinalM{#2}{\@fc@ord}}}% +\expandafter\let\csname @fcs@#1\endcsname\@fc@ord} +\newcommand*{\FMCuse}[1]{\csname @fcs@#1\endcsname} +\newcommand*{\ordinalstring}[1]{% +\expandafter\protect\expandafter\ordinalstringnum{% +\expandafter\the\csname c@#1\endcsname}} +\newcommand{\ordinalstringnum}[1]{% +\@ifnextchar[{\@ordinal@string{#1}}{\@ordinal@string{#1}[m]}} +\def\@ordinal@string#1[#2]{{% +\ifthenelse{\equal{#2}{f}}{% +\protect\@ordinalstringF{#1}{\@fc@ordstr}}{% +\ifthenelse{\equal{#2}{n}}{% +\protect\@ordinalstringN{#1}{\@fc@ordstr}}{% +\ifthenelse{\equal{#2}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#2' to +\string\ordinalstring}{Available options are m, f or f}}% +\protect\@ordinalstringM{#1}{\@fc@ordstr}}}\@fc@ordstr}} +\newcommand*{\storeordinalstring}[2]{% +\expandafter\protect\expandafter\storeordinalstringnum{#1}{% +\expandafter\the\csname c@#2\endcsname}} +\newcommand*{\storeordinalstringnum}[2]{% +\@ifnextchar[{\@store@ordinal@string{#1}{#2}}{% +\@store@ordinal@string{#1}{#2}[m]}} +\def\@store@ordinal@string#1#2[#3]{% +\ifthenelse{\equal{#3}{f}}{% +\protect\@ordinalstringF{#2}{\@fc@ordstr}}{% +\ifthenelse{\equal{#3}{n}}{% +\protect\@ordinalstringN{#2}{\@fc@ordstr}}{% +\ifthenelse{\equal{#3}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#3' to +\string\ordinalstring}{Available options are m, f or n}}% +\protect\@ordinalstringM{#2}{\@fc@ordstr}}}% +\expandafter\let\csname @fcs@#1\endcsname\@fc@ordstr} +\newcommand*{\Ordinalstring}[1]{% +\expandafter\protect\expandafter\Ordinalstringnum{% +\expandafter\the\csname c@#1\endcsname}} +\newcommand*{\Ordinalstringnum}[1]{% +\@ifnextchar[{\@Ordinal@string{#1}}{\@Ordinal@string{#1}[m]}} +\def\@Ordinal@string#1[#2]{{% +\ifthenelse{\equal{#2}{f}}{% +\protect\@OrdinalstringF{#1}{\@fc@ordstr}}{% +\ifthenelse{\equal{#2}{n}}{% +\protect\@OrdinalstringN{#1}{\@fc@ordstr}}{% +\ifthenelse{\equal{#2}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#2'}{% +Available options are m, f or n}}% +\protect\@OrdinalstringM{#1}{\@fc@ordstr}}}\@fc@ordstr}} +\newcommand*{\storeOrdinalstring}[2]{% +\expandafter\protect\expandafter\storeOrdinalstringnum{#1}{% +\expandafter\the\csname c@#2\endcsname}} +\newcommand*{\storeOrdinalstringnum}[2]{% +\@ifnextchar[{\@store@Ordinal@string{#1}{#2}}{% +\@store@Ordinal@string{#1}{#2}[m]}} +\def\@store@Ordinal@string#1#2[#3]{% +\ifthenelse{\equal{#3}{f}}{% +\protect\@OrdinalstringF{#2}{\@fc@ordstr}}{% +\ifthenelse{\equal{#3}{n}}{% +\protect\@OrdinalstringN{#2}{\@fc@ordstr}}{% +\ifthenelse{\equal{#3}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#3'}{% +Available options are m or f}}% +\protect\@OrdinalstringM{#2}{\@fc@ordstr}}}% +\expandafter\let\csname @fcs@#1\endcsname\@fc@ordstr} +\newcommand*{\storeORDINALstring}[2]{% +\expandafter\protect\expandafter\storeORDINALstringnum{#1}{% +\expandafter\the\csname c@#2\endcsname}} +\newcommand*{\storeORDINALstringnum}[2]{% +\@ifnextchar[{\@store@ORDINAL@string{#1}{#2}}{% +\@store@ORDINAL@string{#1}{#2}[m]}} +\def\@store@ORDINAL@string#1#2[#3]{% +\ifthenelse{\equal{#3}{f}}{% +\protect\@ordinalstringF{#2}{\@fc@ordstr}}{% +\ifthenelse{\equal{#3}{n}}{% +\protect\@ordinalstringN{#2}{\@fc@ordstr}}{% +\ifthenelse{\equal{#3}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#3'}{% +Available options are m or f}}% +\protect\@ordinalstringM{#2}{\@fc@ordstr}}}% +\expandafter\edef\csname @fcs@#1\endcsname{% +\noexpand\MakeUppercase{\@fc@ordstr}}} +\newcommand*{\ORDINALstring}[1]{% +\expandafter\protect\expandafter\ORDINALstringnum{% +\expandafter\the\csname c@#1\endcsname}} +\newcommand*{\ORDINALstringnum}[1]{% +\@ifnextchar[{\@ORDINAL@string{#1}}{\@ORDINAL@string{#1}[m]}} +\def\@ORDINAL@string#1[#2]{{% +\ifthenelse{\equal{#2}{f}}{% +\protect\@ordinalstringF{#1}{\@fc@ordstr}}{% +\ifthenelse{\equal{#2}{n}}{% +\protect\@ordinalstringN{#1}{\@fc@ordstr}}{% +\ifthenelse{\equal{#2}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#2'}{% +Available options are m, f or n}}% +\protect\@ordinalstringM{#1}{\@fc@ordstr}}}% +\MakeUppercase{\@fc@ordstr}}} +\newcommand*{\storenumberstring}[2]{% +\expandafter\protect\expandafter\storenumberstringnum{#1}{% +\expandafter\the\csname c@#2\endcsname}} +\newcommand{\storenumberstringnum}[2]{% +\@ifnextchar[{\@store@number@string{#1}{#2}}{% +\@store@number@string{#1}{#2}[m]}} +\def\@store@number@string#1#2[#3]{% +\ifthenelse{\equal{#3}{f}}{% +\protect\@numberstringF{#2}{\@fc@numstr}}{% +\ifthenelse{\equal{#3}{n}}{% +\protect\@numberstringN{#2}{\@fc@numstr}}{% +\ifthenelse{\equal{#3}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#3'}{% +Available options are m, f or n}}% +\protect\@numberstringM{#2}{\@fc@numstr}}}% +\expandafter\let\csname @fcs@#1\endcsname\@fc@numstr} +\newcommand*{\numberstring}[1]{% +\expandafter\protect\expandafter\numberstringnum{% +\expandafter\the\csname c@#1\endcsname}} +\newcommand*{\numberstringnum}[1]{% +\@ifnextchar[{\@number@string{#1}}{\@number@string{#1}[m]}% +} +\def\@number@string#1[#2]{{% +\ifthenelse{\equal{#2}{f}}{% +\protect\@numberstringF{#1}{\@fc@numstr}}{% +\ifthenelse{\equal{#2}{n}}{% +\protect\@numberstringN{#1}{\@fc@numstr}}{% +\ifthenelse{\equal{#2}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#2'}{% +Available options are m, f or n}}% +\protect\@numberstringM{#1}{\@fc@numstr}}}\@fc@numstr}} +\newcommand*{\storeNumberstring}[2]{% +\expandafter\protect\expandafter\storeNumberstringnum{#1}{% +\expandafter\the\csname c@#2\endcsname}} +\newcommand{\storeNumberstringnum}[2]{% +\@ifnextchar[{\@store@Number@string{#1}{#2}}{% +\@store@Number@string{#1}{#2}[m]}} +\def\@store@Number@string#1#2[#3]{% +\ifthenelse{\equal{#3}{f}}{% +\protect\@NumberstringF{#2}{\@fc@numstr}}{% +\ifthenelse{\equal{#3}{n}}{% +\protect\@NumberstringN{#2}{\@fc@numstr}}{% +\ifthenelse{\equal{#3}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#3'}{% +Available options are m, f or n}}% +\protect\@NumberstringM{#2}{\@fc@numstr}}}% +\expandafter\let\csname @fcs@#1\endcsname\@fc@numstr} +\newcommand*{\Numberstring}[1]{% +\expandafter\protect\expandafter\Numberstringnum{% +\expandafter\the\csname c@#1\endcsname}} +\newcommand*{\Numberstringnum}[1]{% +\@ifnextchar[{\@Number@string{#1}}{\@Number@string{#1}[m]}} +\def\@Number@string#1[#2]{{% +\ifthenelse{\equal{#2}{f}}{% +\protect\@NumberstringF{#1}{\@fc@numstr}}{% +\ifthenelse{\equal{#2}{n}}{% +\protect\@NumberstringN{#1}{\@fc@numstr}}{% +\ifthenelse{\equal{#2}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#2'}{% +Available options are m, f or n}}% +\protect\@NumberstringM{#1}{\@fc@numstr}}}\@fc@numstr}} +\newcommand{\storeNUMBERstring}[2]{% +\expandafter\protect\expandafter\storeNUMBERstringnum{#1}{% +\expandafter\the\csname c@#2\endcsname}} +\newcommand{\storeNUMBERstringnum}[2]{% +\@ifnextchar[{\@store@NUMBER@string{#1}{#2}}{% +\@store@NUMBER@string{#1}{#2}[m]}} +\def\@store@NUMBER@string#1#2[#3]{% +\ifthenelse{\equal{#3}{f}}{% +\protect\@numberstringF{#2}{\@fc@numstr}}{% +\ifthenelse{\equal{#3}{n}}{% +\protect\@numberstringN{#2}{\@fc@numstr}}{% +\ifthenelse{\equal{#3}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#3'}{% +Available options are m or f}}% +\protect\@numberstringM{#2}{\@fc@numstr}}}% +\expandafter\edef\csname @fcs@#1\endcsname{% +\noexpand\MakeUppercase{\@fc@numstr}}} +\newcommand*{\NUMBERstring}[1]{% +\expandafter\protect\expandafter\NUMBERstringnum{% +\expandafter\the\csname c@#1\endcsname}} +\newcommand*{\NUMBERstringnum}[1]{% +\@ifnextchar[{\@NUMBER@string{#1}}{\@NUMBER@string{#1}[m]}} +\def\@NUMBER@string#1[#2]{{% +\ifthenelse{\equal{#2}{f}}{% +\protect\@numberstringF{#1}{\@fc@numstr}}{% +\ifthenelse{\equal{#2}{n}}{% +\protect\@numberstringN{#1}{\@fc@numstr}}{% +\ifthenelse{\equal{#2}{m}}{}{% +\PackageError{fmtcount}{Invalid gender option `#2'}{% +Available options are m, f or n}}% +\protect\@numberstringM{#1}{\@fc@numstr}}}% +\MakeUppercase{\@fc@numstr}}} +\providecommand*{\binary}[1]{% +\expandafter\protect\expandafter\@binary{% +\expandafter\the\csname c@#1\endcsname}} +\providecommand*{\aaalph}[1]{% +\expandafter\protect\expandafter\@aaalph{% +\expandafter\the\csname c@#1\endcsname}} +\providecommand*{\AAAlph}[1]{% +\expandafter\protect\expandafter\@AAAlph{% +\expandafter\the\csname c@#1\endcsname}} +\providecommand*{\abalph}[1]{% +\expandafter\protect\expandafter\@abalph{% +\expandafter\the\csname c@#1\endcsname}} +\providecommand*{\ABAlph}[1]{% +\expandafter\protect\expandafter\@ABAlph{% +\expandafter\the\csname c@#1\endcsname}} +\providecommand*{\hexadecimal}[1]{% +\expandafter\protect\expandafter\@hexadecimal{% +\expandafter\the\csname c@#1\endcsname}} +\providecommand*{\Hexadecimal}[1]{% +\expandafter\protect\expandafter\@Hexadecimal{% +\expandafter\the\csname c@#1\endcsname}} +\providecommand*{\octal}[1]{% +\expandafter\protect\expandafter\@octal{% +\expandafter\the\csname c@#1\endcsname}} +\providecommand*{\decimal}[1]{% +\expandafter\protect\expandafter\@decimal{% +\expandafter\the\csname c@#1\endcsname}} +\def\@setdef@ultfmtcount{ +\@ifundefined{@ordinalMenglish}{\input{fc-english.def}}{} +\def\@ordinalstringM{\@ordinalstringMenglish} +\let\@ordinalstringF=\@ordinalstringMenglish +\let\@ordinalstringN=\@ordinalstringMenglish +\def\@OrdinalstringM{\@OrdinalstringMenglish} +\let\@OrdinalstringF=\@OrdinalstringMenglish +\let\@OrdinalstringN=\@OrdinalstringMenglish +\def\@numberstringM{\@numberstringMenglish} +\let\@numberstringF=\@numberstringMenglish +\let\@numberstringN=\@numberstringMenglish +\def\@NumberstringM{\@NumberstringMenglish} +\let\@NumberstringF=\@NumberstringMenglish +\let\@NumberstringN=\@NumberstringMenglish +\def\@ordinalM{\@ordinalMenglish} +\let\@ordinalF=\@ordinalM +\let\@ordinalN=\@ordinalM +} +\def\@set@mulitling@fmtcount{% +\def\@numberstringM{\@ifundefined{@numberstringM\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@numberstringM}}{% +\csname @numberstringM\languagename\endcsname}}% +\def\@numberstringF{\@ifundefined{@numberstringF\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@numberstringF}}{% +\csname @numberstringF\languagename\endcsname}}% +\def\@numberstringN{\@ifundefined{@numberstringN\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@numberstringN}}{% +\csname @numberstringN\languagename\endcsname}}% +\def\@NumberstringM{\@ifundefined{@NumberstringM\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@NumberstringM}}{% +\csname @NumberstringM\languagename\endcsname}}% +\def\@NumberstringF{\@ifundefined{@NumberstringF\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@NumberstringF}}{% +\csname @NumberstringF\languagename\endcsname}}% +\def\@NumberstringN{\@ifundefined{@NumberstringN\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@NumberstringN}}{% +\csname @NumberstringN\languagename\endcsname}}% +\def\@ordinalM{\@ifundefined{@ordinalM\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@ordinalM}}{% +\csname @ordinalM\languagename\endcsname}}% +\def\@ordinalF{\@ifundefined{@ordinalF\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@ordinalF}}{% +\csname @ordinalF\languagename\endcsname}}% +\def\@ordinalN{\@ifundefined{@ordinalN\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@ordinalN}}{% +\csname @ordinalN\languagename\endcsname}}% +\def\@ordinalstringM{\@ifundefined{@ordinalstringM\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@ordinalstringM}}{% +\csname @ordinalstringM\languagename\endcsname}}% +\def\@ordinalstringF{\@ifundefined{@ordinalstringF\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@ordinalstringF}}{% +\csname @ordinalstringF\languagename\endcsname}}% +\def\@ordinalstringN{\@ifundefined{@ordinalstringN\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@ordinalstringN}}{% +\csname @ordinalstringN\languagename\endcsname}}% +\def\@OrdinalstringM{\@ifundefined{@OrdinalstringM\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@OrdinalstringM}}{% +\csname @OrdinalstringM\languagename\endcsname}}% +\def\@OrdinalstringF{\@ifundefined{@OrdinalstringF\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@OrdinalstringF}}{% +\csname @OrdinalstringF\languagename\endcsname}}% +\def\@OrdinalstringN{\@ifundefined{@OrdinalstringN\languagename}{% +\PackageError{fmtcount}{No support for language '\languagename'}{% +The fmtcount package currently does not support language +'\languagename' for command \string\@OrdinalstringN}}{% +\csname @OrdinalstringN\languagename\endcsname}} +} +\@ifpackageloaded{babel}{% +\ifthenelse{\equal{\languagename}{nohyphenation}\or +\equal{languagename}{english}}{\@setdef@ultfmtcount}{% +\@set@mulitling@fmtcount} +}{% +\@ifpackageloaded{ngerman}{% +\@ifundefined{@numberstringMgerman}{% +\input{fc-german.def}}{}\@set@mulitling@fmtcount}{% +\@setdef@ultfmtcount}} +\let\@ordinal=\@ordinalM +\let\@ordinalstring=\@ordinalstringM +\let\@Ordinalstring=\@OrdinalstringM +\let\@numberstring=\@numberstringM +\let\@Numberstring=\@NumberstringM +\endinput +%% +%% End of file `fmtcount.sty'. |