From daeca2690f349de566c97b23351ce146ed38d27d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 16 Jun 2017 22:08:02 +0000 Subject: fmtcount (16jun17) git-svn-id: svn://tug.org/texlive/trunk@44615 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/fmtcount/fmtcount.dtx | 1009 +++++++++++++------- .../texmf-dist/source/latex/fmtcount/fmtcount.ins | 4 +- 2 files changed, 670 insertions(+), 343 deletions(-) (limited to 'Master/texmf-dist/source/latex/fmtcount') diff --git a/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx b/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx index 9293bdd287d..b4cbc52a536 100644 --- a/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx +++ b/Master/texmf-dist/source/latex/fmtcount/fmtcount.dtx @@ -5,7 +5,7 @@ % -doc "fmtcount-manual.tex" % -author "Nicola Talbot and Vincent Belaïche" % fmtcount -% Created on 2015/5/8 16:50 +% Created on 2017/6/15 19:28 %\fi %\iffalse %<*package> @@ -28,7 +28,7 @@ %\fi % \iffalse % Doc-Source file to use with LaTeX2e -% Copyright (C) 2015 Nicola Talbot and Vincent Belaïche, all rights reserved. +% Copyright (C) 2017 Nicola Talbot and Vincent Belaïche, all rights reserved. % \fi % \iffalse %<*driver> @@ -49,20 +49,19 @@ \newcommand*{\LanguagePackageOptionList}{{% \def\@tempf##1{\texttt{##1}}% how to format each option % we don't use \cs{newtoks} because anyway this is within a group - \toks0{}% - \def\@tempd{\toks0}% token in which we accumulate result - \def\@tempc{\toks1}% token in which we place next dialect + \toks0{}% token in which we accumulate result + % \toks1 token in which we place next dialect \count0 0 % to distinguish first and second iteration, we need to do tricks because we want to insert `and' % before the last item in the list. \def\@tempb##1{% \ifnum\count0=0 % \else\ifnum\count0=1 % - \expandafter\@tempd\expandafter{\the\toks1}% + \toks0\toks1 % \else \edef\@tempa{\the\toks0, \the\toks1}% - \expandafter\@tempd\expandafter{\@tempa}% + \toks0\expandafter{\@tempa}% \fi\fi - \expandafter\@tempc\expandafter{\@tempf{##1}}% + \toks1\expandafter{\@tempf{##1}}% \advance\count0 by 1 % }% \fc@iterate@on@languages\@tempb @@ -78,11 +77,19 @@ pdftitle={fmtcount.sty: Displaying the Values of LaTeX Counters}, pdfkeywords={LaTeX,counter}]{hyperref} -\CheckSum{9930} +\CheckSum{10157} \doxitem{Option}{option}{options} \newlength{\tabcolwidth} +\newlength{\coliwidth} +\newcommand*\cnab{\centering\arraybackslash} +\newcommand*\ColIRI[1]{} +\csname @ifpackageloaded\endcsname{tex4ht}{% +\newcommand*\ColIRII[1]{\parbox{\coliwidth}{\cnab #1}} +}{% +\newcommand*\ColIRII[1]{\multirow{-2}{\coliwidth}{\cnab #1}} +} \begin{document} \DocInput{fmtcount.dtx} @@ -97,7 +104,7 @@ % \url{www.dickimaw-books.com} % \and % Vincent Bela\"iche} -% \date{2015-05-05 (version 3.01)\relax +% \date{2016-01-12 (version 3.02)\relax %} % \maketitle % \tableofcontents @@ -712,24 +719,24 @@ %\setlength{\tabcolwidth}{\linewidth} %\addtolength{\tabcolwidth}{-10\tabcolsep} %\addtolength{\tabcolwidth}{-6\arrayrulewidth} +%\setlength{\coliwidth}{0.398\tabcolwidth} +%\addtolength{\coliwidth}{\arrayrulewidth} +%\addtolength{\coliwidth}{2\tabcolsep} %\noindent\begin{tabular*}{\linewidth}{|% % >{\centering\arraybackslash\ttfamily}p{\dimexpr0.204\tabcolwidth-\arrayrulewidth-\doublerulesep}||% % *{4}{>{\centering\arraybackslash\ttfamily}p{0.199\tabcolwidth}|}}\hline % \textrm{\meta{x} dans ``\meta{x} }plural\textrm{''}&traditional&reformed&traditional o&reformed o\\\hline % \hline -% vingt&\multicolumn{2}{c|}{}&\multicolumn{2}{c|}{}\\\cline{1-1} +% vingt&\multicolumn{2}{c|}{\ColIRI{multiple l-last}}&\multicolumn{2}{c|}{\ColIRI{multiple lng-last}}\\\cline{1-1} % cent&% -% \multicolumn{2}{c|}{\multirow{-2}{\dimexpr0.398\tabcolwidth+\arrayrulewidth+2\tabcolsep}{\centering -% multiple l-last}}&% -% \multicolumn{2}{c|}{\multirow{-2}{\dimexpr0.398\tabcolwidth+\arrayrulewidth+2\tabcolsep}{\centering -% multiple lng-last}}\\\hline +% \multicolumn{2}{c|}{\ColIRII{multiple l-last}}&% +% \multicolumn{2}{c|}{\ColIRII{multiple lng-last}}\\\hline % mil&\multicolumn{4}{c|}{always}\\\hline -% n-illion&\multicolumn{2}{c|}{}&\multicolumn{2}{c|}{}\\\cline{1-1} +% n-illion&\multicolumn{2}{c|}{\ColIRI{multiple}}&% +% \multicolumn{2}{c|}{\ColIRI{multiple ng-last}}\\\cline{1-1} % n-illiard&% -% \multicolumn{2}{c|}{\multirow{-2}{\dimexpr0.398\tabcolwidth+\arrayrulewidth+2\tabcolsep}{\centering -% multiple}}&% -% \multicolumn{2}{c|}{\multirow{-2}{\dimexpr0.398\tabcolwidth+\arrayrulewidth+2\tabcolsep}{\centering -% multiple ng-last}}\\\hline +% \multicolumn{2}{c|}{\ColIRII{multiple}}&% +% \multicolumn{2}{c|}{\ColIRII{multiple ng-last}}\\\hline %\end{tabular*} % %Les configurations qui respectent les règles d'orthographe sont les suivantes~: @@ -889,17 +896,18 @@ %<*fc-american.def> % \end{macrocode} %\fi +% \subsection{Language definition files} % \subsubsection{fc-american.def} % American English definitions % \begin{macrocode} -\ProvidesFCLanguage{american}[2013/08/17]% +\ProvidesFCLanguage{american}[2016/01/12]% % \end{macrocode} % Loaded fc-USenglish.def if not already loaded % \begin{macrocode} \FCloadlang{USenglish}% % \end{macrocode} % These are all just synonyms for the commands provided by -% fc-USenglish.def. +% \styfmt{fc-USenglish.def}. % \begin{macrocode} \global\let\@ordinalMamerican\@ordinalMUSenglish \global\let\@ordinalFamerican\@ordinalMUSenglish @@ -917,6 +925,9 @@ \global\let\@OrdinalstringFamerican\@OrdinalstringMUSenglish \global\let\@OrdinalstringNamerican\@OrdinalstringMUSenglish % \end{macrocode} +\iffalse Local variables: \fi +\iffalse mode: docTeX \fi +\iffalse End: \fi %\iffalse % \begin{macrocode} % @@ -968,7 +979,7 @@ % \subsubsection{fc-english.def} % English definitions % \begin{macrocode} -\ProvidesFCLanguage{english}[2013/08/17]% +\ProvidesFCLanguage{english}[2016/01/12]% % \end{macrocode} % Define macro that converts a number or count register (first % argument) to an ordinal, and stores the result in the @@ -1213,10 +1224,15 @@ this number}% }% \global\let\@@numberstringenglish\@@numberstringenglish % \end{macrocode} -% All lower case version, the second argument must be a -% control sequence. +% All lower case version, the second argument must be a control +% sequence.% +% \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by +% \cs{newcommand*} as robustness is handled now at top level in +% \texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned +% macros are \cs{@numberstringMenglish}, \cs{@ordinalstringMenglish}, +% and \cs{@OrdinalstringMenglish}} % \begin{macrocode} -\DeclareRobustCommand{\@numberstringMenglish}[2]{% +\newcommand*{\@numberstringMenglish}[2]{% \let\@unitstring=\@@unitstringenglish \let\@teenstring=\@@teenstringenglish \let\@tenstring=\@@tenstringenglish @@ -1485,7 +1501,7 @@ this number}% % All lower case version. Again, the second argument must be a % control sequence in which the resulting text is stored. % \begin{macrocode} -\DeclareRobustCommand{\@ordinalstringMenglish}[2]{% +\newcommand*{\@ordinalstringMenglish}[2]{% \let\@unitthstring=\@@unitthstringenglish \let\@teenthstring=\@@teenthstringenglish \let\@tenthstring=\@@tenthstringenglish @@ -1507,7 +1523,7 @@ this number}% % \end{macrocode} % First letter of each word in upper case: % \begin{macrocode} -\DeclareRobustCommand{\@OrdinalstringMenglish}[2]{% +\newcommand*{\@OrdinalstringMenglish}[2]{% \let\@unitthstring=\@@Unitthstringenglish \let\@teenthstring=\@@Teenthstringenglish \let\@tenthstring=\@@Tenthstringenglish @@ -1527,6 +1543,9 @@ this number}% \global\let\@OrdinalstringFenglish=\@OrdinalstringMenglish \global\let\@OrdinalstringNenglish=\@OrdinalstringMenglish % \end{macrocode} +\iffalse Local variables: \fi +\iffalse mode: docTeX \fi +\iffalse End: \fi %\iffalse % \begin{macrocode} % @@ -1574,12 +1593,37 @@ this number}% % \subsubsection{fc-french.def} % Definitions for French. % \begin{macrocode} -\ProvidesFCLanguage{french}[2012/10/24]% +\ProvidesFCLanguage{french}[2017/06/15]% +% \end{macrocode} +% Package \styfmt{fcprefix} is needed to format the prefix \meta{$n$} +% in \meta{$n$}illion or \meta{$n$}illiard. Big numbers were +% developped based on reference: \uref +% {http://www.alain.be/boece/noms\_de\_nombre.html}. Package \styfmt +% {fcprefix} is now loaded by \styfmt{fmtcount}. +% +% First of all we define two macros \cs{fc@gl@let} and \cs{fc@gl@def} +% used in place of \cs{let} and \cs{def} within options setting +% macros. This way we can control from outside these macros whether +% the respective \cs{let} or \cs{def} is group-local or global. By +% default they are defined to be group-local. +% \changes{3.02}{2016/01/12}{First of all, make command definitions, as well as +% options initial setting global. That is mainly a matter of: +% \protect\begin{itemize} +% \protect\item using \cs{gdef} instead of \cs{def}, +% \protect\item using \cs{global}\cs{let} instead of \cs{let}, and +% \protect\item following \cs{newcommand*}\cs{\meta{foo}} by \cs{global}\cs{let}\cs{\meta{foo}}\cs{\meta{foo}}. +% \protect\item using \cs{fc@gl@let} and \cs{fc@gl@def} in place of \cs{let} +% \protect\item and \cs{def} within options setting macros in order to make intial +% \protect\item setting global. +% \protect\end{itemize} +% Second, replace any \cs{DeclareRobustCommand} by \cs{newcommand*} +% } +% \begin{macrocode} +\ifcsundef{fc@gl@let}{\global\let\fc@gl@let\let}{\PackageError{fmtcount}{Command already defined}{Command +\protect\fc@gl@let\space already defined.}} +\ifcsundef{fc@gl@def}{\global\let\fc@gl@def\def}{\PackageError{fmtcount}{Command already defined}{Command +\protect\fc@gl@def\space already defined.}} % \end{macrocode} -% Package \styfmt{fcprefix} is needed to format the prefix \meta{$n$} in \meta{$n$}illion or -% \meta{$n$}illiard. Big numbers were developped based on reference: -% \uref{http://www.alain.be/boece/noms\_de\_nombre.html} -% (Package now loaded by \styfmt{fmtcount}) % % Options for controlling plural mark. First of all we define some temporary macro \cs{fc@french@set@plural} % in order to factorize code that defines an plural mark option:\newline\noindent @@ -1592,45 +1636,45 @@ this number}% % \#6&configuration index for `\texttt{traditional o}'. % \end{tabularx} % \begin{macrocode} -\def\fc@french@set@plural#1#2#3#4#5#6{% +\gdef\fc@french@set@plural#1#2#3#4#5#6{% \ifthenelse{\equal{#2}{reformed}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{#3}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{#3}% }{% \ifthenelse{\equal{#2}{traditional}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{#4}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{#4}% }{% \ifthenelse{\equal{#2}{reformed o}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{#5}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{#5}% }{% \ifthenelse{\equal{#2}{traditional o}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{#6}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{#6}% }{% \ifthenelse{\equal{#2}{always}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{0}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{0}% }{% \ifthenelse{\equal{#2}{never}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{1}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{1}% }{% \ifthenelse{\equal{#2}{multiple}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{2}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{2}% }{% \ifthenelse{\equal{#2}{multiple g-last}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{3}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{3}% }{% \ifthenelse{\equal{#2}{multiple l-last}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{4}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{4}% }{% \ifthenelse{\equal{#2}{multiple lng-last}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{5}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{5}% }{% \ifthenelse{\equal{#2}{multiple ng-last}}{% - \expandafter\def\csname fc@frenchoptions@#1@plural\endcsname{6}% + \expandafter\fc@gl@def\csname fc@frenchoptions@#1@plural\endcsname{6}% }{% \PackageError{fmtcount}{Unexpected argument}{% `#2' was unexpected: french option `#1 plural' expects `reformed', `traditional', `reformed o', `traditional o', `always', `never', `multiple', `multiple g-last', `multiple l-last', `multiple lng-last', or `multiple ng-last'.% - }}}}}}}}}}}}} + }}}}}}}}}}}}}% % \end{macrocode} % Now a shorthand \cs{@tempa} is defined just to define all the options controlling plural mark. This % shorthand takes into account that `\texttt{reformed}' and `\texttt{traditional}' have the same effect, and @@ -1640,7 +1684,17 @@ this number}% \define@key{fcfrench}{#1 plural}[reformed]{% \fc@french@set@plural{#1}{##1}{#2}{#2}{#3}{#3}% }% -} +% \end{macrocode} +% Macro \cs{@tempb} takes a macro as argument, and makes its current +% definition global. Like here it is useful when the macro name +% contains non-letters, and we have to resort to the +% \cs{csname}\ldots\cs{endcsname} construct. +% \begin{macrocode} + \expandafter\@tempb\csname KV@fcfrench@#1 plural\endcsname +}% +\def\@tempb#1{% + \global\let#1#1 +}% \@tempa{vingt}{4}{5} \@tempa{cent}{4}{5} \@tempa{mil}{0}{0} @@ -1656,7 +1710,8 @@ this number}% \csname KV@fcfrench@mil plural\endcsname{#1}% \csname KV@fcfrench@n-illion plural\endcsname{#1}% \csname KV@fcfrench@n-illiard plural\endcsname{#1}% -} +}% +\expandafter\@tempb\csname KV@fcfrench@all plural\endcsname % \end{macrocode} % Now options `\texttt{dash or space}', we have three possible key values:\newline\noindent % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}} @@ -1685,7 +1740,7 @@ this number}% }% }% }% -} +}% % \end{macrocode} % Option `\texttt{scale}', can take 3 possible values:\newline\noindent % \begin{tabularx}{\linewidth}{@{}>{\raggedleft\arraybackslash\ttfamily}rX@{}} @@ -1712,7 +1767,7 @@ this number}% }% }% }% -} +}% % \end{macrocode} % Option `\texttt{n-illiard upto}' is ignored if `\texttt{scale}' is different from `\texttt{long}'. It can % take the following values:\newline\noindent @@ -1737,7 +1792,7 @@ this number}% \fi \def\fc@longscale@nilliard@upto{#1}% }}% -} +}% % \end{macrocode} % Now, the options `\texttt{france}', `\texttt{swiss}' and `\texttt{belgian}' are defined to select the % dialect to use. Macro \cs{@tempa} is just a local shorthand to define each one of this option. @@ -1746,15 +1801,15 @@ this number}% \define@key{fcfrench}{#1}[]{% \PackageError{fmtcount}{Unexpected argument}{French option with key `#1' does not take any value}}% - \expandafter\def\csname KV@fcfrench@#1@default\endcsname{% - \def\fmtcount@french{#1}}% + \csgdef{KV@fcfrench@#1@default}{% + \fc@gl@def\fmtcount@french{#1}}% }% \@tempa{france}\@tempa{swiss}\@tempa{belgian}% % \end{macrocode} % Make `\texttt{france}' the default dialect for `\texttt{french}' language % \changes{3.01}{2014-12-18}{Move French specific stuff from \styfmt{fmtcount.sty} to \styfmt{fc-french.def}.} % \begin{macrocode} -\def\fmtcount@french{france}% +\gdef\fmtcount@french{france}% % \end{macrocode} % Now, option `\texttt{dialect}' is now defined so that `\texttt{france}', `\texttt{swiss}' and % `\texttt{belgian}' can also be used as key values, which is more conventional although less concise. @@ -1766,29 +1821,61 @@ this number}% \def\fmtcount@french{#1}}{% \PackageError{fmtcount}{Invalid value `#1' to french option dialect key} {Option `french' can only take the values `france', - `belgian' or `swiss'}}} + `belgian' or `swiss'}}}% +\expandafter\@tempb\csname KV@fcfrench@dialect\endcsname % \end{macrocode} % The option \texttt{mil plural mark} allows to make the plural of \texttt{mil} to be regular, % i.e. \texttt{mils}, instead of \texttt{mille}. By default it is `\texttt{le}'. % \begin{macrocode} \define@key{fcfrench}{mil plural mark}[le]{% \def\fc@frenchoptions@mil@plural@mark{#1}} +\expandafter\@tempb\csname KV@fcfrench@mil plural mark\endcsname % \end{macrocode} % Definition of case handling macros. This should be moved somewhere else to be commonalized between all -% languages. +% languages.\newline +% \DescribeMacro{\fc@UpperCaseFirstLetter}The macro \cs{fc@UpperCaseFirstLetter} is such that +% \cs{fc@UpperCaseFirstLetter}\meta{word}\cs{@nil} expands to \cs{word} with first letter capitalized and +% remainder unchanged. % \begin{macrocode} -\def\fc@UpperCaseFirstLetter#1#2\@nil{% +\gdef\fc@UpperCaseFirstLetter#1#2\@nil{% \uppercase{#1}#2} - -\def\fc@CaseIden#1\@nil{% +% \end{macrocode} +% \DescribeMacro{\fc@CaseIden}The macro \cs{fc@CaseIden} is such that \cs{fc@CaseIden}\meta{word}\cs{@nil} +% expands to \cs{word} unchanged. +% \begin{macrocode} +\gdef\fc@CaseIden#1\@nil{% #1% -} -\def\fc@UpperCaseAll#1\@nil{% +}% +% \end{macrocode} +% \DescribeMacro{\fc@UpperCaseAll}The macro \cs{fc@UpperCaseAll} is such that \cs{fc@UpperCaseAll}\meta{word}\cs{@nil} +% expands to \cs{word} all capitalized. +% \begin{macrocode} +\gdef\fc@UpperCaseAll#1\@nil{% \uppercase{#1}% +}% +% \end{macrocode} +% \DescribeMacro{\fc@wcase}The macro \cs{fc@wcase} is the capitalizing macro for word-by-word +% capitalization. By default we set it to identity, ie.\ no capitalization. +% \begin{macrocode} +\global\let\fc@wcase\fc@CaseIden +% \end{macrocode} +% \DescribeMacro{\fc@gcase}The macro \cs{fc@gcase} is the capitalizing macro for global (the completed number) +% capitalization. By default we set it to identity, ie.\ no capitalization. +% \changes{3.02}{2017/06/15}{Create new macro \cs{fc@gcase} for solving +% \uref{http://github.com/nlct/fmtcount/issues/24}{Issue \#24} about capitalization in French.} +% \begin{macrocode} +\global\let\fc@gcase\fc@CaseIden +% \end{macrocode} +% \DescribeMacro{\fc@apply@gcase}The macro \cs{fc@apply@gcase} simply applies \cs{fc@gcase} to \cs{@tempa}, +% knowing that \cs{@tempa} is the macro containing the result of formatting. +% \begin{macrocode} +\gdef\fc@apply@gcase{% +% \end{macrocode} +% First of all we expand whatever \cs{fc@wcase}\ldots\cs{@nil} found within \cs{@tempa}. +% \begin{macrocode} + \protected@edef\@tempa{\@tempa}% + \protected@edef\@tempa{\expandafter\fc@gcase\@tempa\@nil}% } - -\let\fc@case\fc@CaseIden - % \end{macrocode} % \DescribeMacro{\@ordinalMfrench} % \changes{3.01}{2014-11-12}{Protect \cs{`}, for solving @@ -1814,6 +1901,7 @@ this number}% \protected@edef#2{\number#1\relax\noexpand\fmtord{\protect\`eme}}% \fi \fi} +\global\let\@ordinalMfrench\@ordinalMfrench % \end{macrocode} % \DescribeMacro{\@ordinalFfrench} % \changes{3.01}{2014-11-10}{Protect \cs{`}, for solving @@ -1838,15 +1926,16 @@ this number}% \protected@edef#2{\number#1\relax\noexpand\fmtord{\protect\`eme}}% \fi \fi} +\global\let\@ordinalFfrench\@ordinalFfrench % \end{macrocode} % In French neutral gender and masculine gender are formally identical. % \begin{macrocode} -\let\@ordinalNfrench\@ordinalMfrench +\global\let\@ordinalNfrench\@ordinalMfrench % \end{macrocode} % \DescribeMacro{\@@unitstringfrench} % \begin{macrocode} \newcommand*{\@@unitstringfrench}[1]{% -\noexpand\fc@case +\noexpand\fc@wcase \ifcase#1 % z\'ero% \or un% @@ -1860,12 +1949,13 @@ z\'ero% \or neuf% \fi \noexpand\@nil -} +}% +\global\let\@@unitstringfrench\@@unitstringfrench % \end{macrocode} % \DescribeMacro{\@@tenstringfrench} % \begin{macrocode} \newcommand*{\@@tenstringfrench}[1]{% -\noexpand\fc@case +\noexpand\fc@wcase \ifcase#1 % \or dix% \or vingt% @@ -1879,12 +1969,13 @@ z\'ero% \or cent% \fi \noexpand\@nil -} +}% +\global\let\@@tenstringfrench\@@tenstringfrench % \end{macrocode} % \DescribeMacro{\@@teenstringfrench} % \begin{macrocode} \newcommand*{\@@teenstringfrench}[1]{% -\noexpand\fc@case +\noexpand\fc@wcase \ifcase#1 % dix% \or onze% @@ -1893,12 +1984,13 @@ z\'ero% \or quatorze% \or quinze% \or seize% -\or dix\noexpand\@nil-\noexpand\fc@case sept% -\or dix\noexpand\@nil-\noexpand\fc@case huit% -\or dix\noexpand\@nil-\noexpand\fc@case neuf% +\or dix\noexpand\@nil-\noexpand\fc@wcase sept% +\or dix\noexpand\@nil-\noexpand\fc@wcase huit% +\or dix\noexpand\@nil-\noexpand\fc@wcase neuf% \fi \noexpand\@nil -} +}% +\global\let\@@teenstringfrench\@@teenstringfrench % \end{macrocode} % \DescribeMacro{\@@seventiesfrench} % \begin{macrocode} @@ -1910,7 +2002,8 @@ z\'ero% -% \fi \@teenstring{#1}% -} +}% +\global\let\@@seventiesfrench\@@seventiesfrench % \end{macrocode} % \DescribeMacro{\@@eightiesfrench}Macro \cs{@@eightiesfrench} is used to format numbers in the interval % \([80\intv 89]\). Argument as follows:\newline @@ -1928,7 +2021,7 @@ z\'ero% % \end{tabularx} % \begin{macrocode} \newcommand*\@@eightiesfrench[1]{% -\fc@case quatre\@nil-\noexpand\fc@case vingt% +\fc@wcase quatre\@nil-\noexpand\fc@wcase vingt% \ifnum#1>0 % \ifnum\fc@frenchoptions@vingt@plural=0 % vingt plural=always s% @@ -1967,279 +2060,312 @@ z\'ero% \fi \noexpand\@nil \fi -} +}% +\global\let\@@eightiesfrench\@@eightiesfrench \newcommand*{\@@ninetiesfrench}[1]{% -\fc@case quatre\@nil-\noexpand\fc@case vingt% +\fc@wcase quatre\@nil-\noexpand\fc@wcase vingt% \ifnum\fc@frenchoptions@vingt@plural=0 % vingt plural=always s% \fi \noexpand\@nil -\@teenstring{#1}% -} +}% +\global\let\@@ninetiesfrench\@@ninetiesfrench \newcommand*{\@@seventiesfrenchswiss}[1]{% \@tenstring{7}% \ifnum#1=1\ \@andname\ \fi \ifnum#1>1-\fi \ifnum#1>0 \@unitstring{#1}\fi -} +}% +\global\let\@@seventiesfrenchswiss\@@seventiesfrenchswiss \newcommand*{\@@eightiesfrenchswiss}[1]{% \@tenstring{8}% \ifnum#1=1\ \@andname\ \fi \ifnum#1>1-\fi \ifnum#1>0 \@unitstring{#1}\fi -} +}% +\global\let\@@eightiesfrenchswiss\@@eightiesfrenchswiss \newcommand*{\@@ninetiesfrenchswiss}[1]{% \@tenstring{9}% \ifnum#1=1\ \@andname\ \fi \ifnum#1>1-\fi \ifnum#1>0 \@unitstring{#1}\fi -} +}% +\global\let\@@ninetiesfrenchswiss\@@ninetiesfrenchswiss % \end{macrocode} % \DescribeMacro{\fc@french@common}Macro \cs{fc@french@common} does all the preliminary settings common to all % French dialects \& formatting options. % \begin{macrocode} \newcommand*\fc@french@common{% + \let\fc@wcase\fc@CaseIden \let\@unitstring=\@@unitstringfrench \let\@teenstring=\@@teenstringfrench \let\@tenstring=\@@tenstringfrench \def\@hundred{cent}% \def\@andname{et}% -} +}% +\global\let\fc@french@common\fc@french@common % \end{macrocode} % \begin{macrocode} -\DeclareRobustCommand{\@numberstringMfrenchswiss}[2]{% -\let\fc@case\fc@CaseIden +\newcommand*{\@numberstringMfrenchswiss}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrenchswiss \let\@nineties=\@@ninetiesfrenchswiss \let\fc@nbrstr@preamble\@empty \let\fc@nbrstr@postamble\@empty \@@numberstringfrench{#1}{#2}} -\DeclareRobustCommand{\@numberstringMfrenchfrance}[2]{% -\let\fc@case\fc@CaseIden +\global\let\@numberstringMfrenchswiss\@numberstringMfrenchswiss +\newcommand*{\@numberstringMfrenchfrance}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \let\fc@nbrstr@preamble\@empty \let\fc@nbrstr@postamble\@empty \@@numberstringfrench{#1}{#2}} -\DeclareRobustCommand{\@numberstringMfrenchbelgian}[2]{% -\let\fc@case\fc@CaseIden +\global\let\@numberstringMfrenchfrance\@numberstringMfrenchfrance +\newcommand*{\@numberstringMfrenchbelgian}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \let\fc@nbrstr@preamble\@empty \let\fc@nbrstr@postamble\@empty \@@numberstringfrench{#1}{#2}} +\global\let\@numberstringMfrenchbelgian\@numberstringMfrenchbelgian \let\@numberstringMfrench=\@numberstringMfrenchfrance -\DeclareRobustCommand{\@numberstringFfrenchswiss}[2]{% -\let\fc@case\fc@CaseIden +\newcommand*{\@numberstringFfrenchswiss}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrenchswiss \let\@nineties=\@@ninetiesfrenchswiss \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble \let\fc@nbrstr@postamble\@empty \@@numberstringfrench{#1}{#2}} -\DeclareRobustCommand{\@numberstringFfrenchfrance}[2]{% -\let\fc@case\fc@CaseIden +\global\let\@numberstringFfrenchswiss\@numberstringFfrenchswiss +\newcommand*{\@numberstringFfrenchfrance}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble \let\fc@nbrstr@postamble\@empty \@@numberstringfrench{#1}{#2}} -\DeclareRobustCommand{\@numberstringFfrenchbelgian}[2]{% -\let\fc@case\fc@CaseIden +\global\let\@numberstringFfrenchfrance\@numberstringFfrenchfrance +\newcommand*{\@numberstringFfrenchbelgian}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble \let\fc@nbrstr@postamble\@empty \@@numberstringfrench{#1}{#2}} -\let\@numberstringFfrench=\@numberstringFfrenchfrance -\let\@ordinalstringNfrench\@ordinalstringMfrench -\DeclareRobustCommand{\@NumberstringMfrenchswiss}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter +\global\let\@numberstringFfrenchbelgian\@numberstringFfrenchbelgian +\global\let\@numberstringFfrench=\@numberstringFfrenchfrance +\global\let\@ordinalstringNfrench\@ordinalstringMfrench +\newcommand*{\@NumberstringMfrenchswiss}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrenchswiss \let\@nineties=\@@ninetiesfrenchswiss \let\fc@nbrstr@preamble\@empty -\let\fc@nbrstr@postamble\@empty +\let\fc@nbrstr@postamble\fc@apply@gcase \@@numberstringfrench{#1}{#2}} -\DeclareRobustCommand{\@NumberstringMfrenchfrance}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter +\global\let\@NumberstringMfrenchswiss\@NumberstringMfrenchswiss +\newcommand*{\@NumberstringMfrenchfrance}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \let\fc@nbrstr@preamble\@empty -\let\fc@nbrstr@postamble\@empty +\let\fc@nbrstr@postamble\fc@apply@gcase \@@numberstringfrench{#1}{#2}} -\DeclareRobustCommand{\@NumberstringMfrenchbelgian}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter +\global\let\@NumberstringMfrenchfrance\@NumberstringMfrenchfrance +\newcommand*{\@NumberstringMfrenchbelgian}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \let\fc@nbrstr@preamble\@empty -\let\fc@nbrstr@postamble\@empty +\let\fc@nbrstr@postamble\fc@apply@gcase \@@numberstringfrench{#1}{#2}} -\let\@NumberstringMfrench=\@NumberstringMfrenchfrance -\DeclareRobustCommand{\@NumberstringFfrenchswiss}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter +\global\let\@NumberstringMfrenchbelgian\@NumberstringMfrenchbelgian +\global\let\@NumberstringMfrench=\@NumberstringMfrenchfrance +\newcommand*{\@NumberstringFfrenchswiss}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrenchswiss \let\@nineties=\@@ninetiesfrenchswiss \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble -\let\fc@nbrstr@postamble\@empty +\let\fc@nbrstr@postamble\fc@apply@gcase \@@numberstringfrench{#1}{#2}} -\DeclareRobustCommand{\@NumberstringFfrenchfrance}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter +\global\let\@NumberstringFfrenchswiss\@NumberstringFfrenchswiss +\newcommand*{\@NumberstringFfrenchfrance}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble -\let\fc@nbrstr@postamble\@empty +\let\fc@nbrstr@postamble\fc@apply@gcase \@@numberstringfrench{#1}{#2}} -\DeclareRobustCommand{\@NumberstringFfrenchbelgian}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter +\global\let\@NumberstringFfrenchfrance\@NumberstringFfrenchfrance +\newcommand*{\@NumberstringFfrenchbelgian}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \let\fc@nbrstr@preamble\fc@@nbrstr@Fpreamble -\let\fc@nbrstr@postamble\@empty +\let\fc@nbrstr@postamble\fc@apply@gcase \@@numberstringfrench{#1}{#2}} -\let\@NumberstringFfrench=\@NumberstringFfrenchfrance -\let\@NumberstringNfrench\@NumberstringMfrench -\DeclareRobustCommand{\@ordinalstringMfrenchswiss}[2]{% -\let\fc@case\fc@CaseIden -\let\fc@first=\fc@@firstfrench +\global\let\@NumberstringFfrenchbelgian\@NumberstringFfrenchbelgian +\global\let\@NumberstringFfrench=\@NumberstringFfrenchfrance +\global\let\@NumberstringNfrench\@NumberstringMfrench +\newcommand*{\@ordinalstringMfrenchswiss}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden +\let\fc@first\fc@@firstfrench \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrenchswiss \let\@nineties=\@@ninetiesfrenchswiss \@@ordinalstringfrench{#1}{#2}% -} +}% +\global\let\@ordinalstringMfrenchswiss\@ordinalstringMfrenchswiss \newcommand*\fc@@firstfrench{premier} +\global\let\fc@@firstfrench\fc@@firstfrench % \end{macrocode} % \changes{3.01}{2014-11-10}{Protect \cs{`}, for solving % \uref{http://github.com/nlct/fmtcount/issues/15}{Issue \#15}} % \begin{macrocode} \newcommand*\fc@@firstFfrench{premi\protect\`ere} -\DeclareRobustCommand{\@ordinalstringMfrenchfrance}[2]{% -\let\fc@case\fc@CaseIden -\let\fc@first=\fc@@firstfrench +\global\let\fc@@firstFfrench\fc@@firstFfrench +\newcommand*{\@ordinalstringMfrenchfrance}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden +\let\fc@first=\fc@@firstfrench \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \@@ordinalstringfrench{#1}{#2}} -\DeclareRobustCommand{\@ordinalstringMfrenchbelgian}[2]{% -\let\fc@case\fc@CaseIden -\let\fc@first=\fc@@firstfrench +\global\let\@ordinalstringMfrenchfrance\@ordinalstringMfrenchfrance +\newcommand*{\@ordinalstringMfrenchbelgian}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden +\let\fc@first=\fc@@firstfrench \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \@@ordinalstringfrench{#1}{#2}% -} -\let\@ordinalstringMfrench=\@ordinalstringMfrenchfrance -\DeclareRobustCommand{\@ordinalstringFfrenchswiss}[2]{% -\let\fc@case\fc@CaseIden -\let\fc@first=\fc@@firstFfrench +}% +\global\let\@ordinalstringMfrenchbelgian\@ordinalstringMfrenchbelgian +\global\let\@ordinalstringMfrench=\@ordinalstringMfrenchfrance +\newcommand*{\@ordinalstringFfrenchswiss}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden +\let\fc@first\fc@@firstFfrench \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrenchswiss \let\@nineties=\@@ninetiesfrenchswiss \@@ordinalstringfrench{#1}{#2}% -} -\DeclareRobustCommand{\@ordinalstringFfrenchfrance}[2]{% -\let\fc@case\fc@CaseIden -\let\fc@first=\fc@@firstFfrench +}% +\global\let\@ordinalstringFfrenchswiss\@ordinalstringFfrenchswiss +\newcommand*{\@ordinalstringFfrenchfrance}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden +\let\fc@first=\fc@@firstFfrench \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \@@ordinalstringfrench{#1}{#2}% -} -\DeclareRobustCommand{\@ordinalstringFfrenchbelgian}[2]{% -\let\fc@case\fc@CaseIden -\let\fc@first=\fc@@firstFfrench +}% +\global\let\@ordinalstringFfrenchfrance\@ordinalstringFfrenchfrance +\newcommand*{\@ordinalstringFfrenchbelgian}[2]{% \fc@french@common +\let\fc@gcase\fc@CaseIden +\let\fc@first=\fc@@firstFfrench \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \@@ordinalstringfrench{#1}{#2}% -} -\let\@ordinalstringFfrench=\@ordinalstringFfrenchfrance -\let\@ordinalstringNfrench\@ordinalstringMfrench -\DeclareRobustCommand{\@OrdinalstringMfrenchswiss}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter -\let\fc@first=\fc@@firstfrench +}% +\global\let\@ordinalstringFfrenchbelgian\@ordinalstringFfrenchbelgian +\global\let\@ordinalstringFfrench=\@ordinalstringFfrenchfrance +\global\let\@ordinalstringNfrench\@ordinalstringMfrench +\newcommand*{\@OrdinalstringMfrenchswiss}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter +\let\fc@first=\fc@@firstfrench \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrenchswiss \let\@nineties=\@@ninetiesfrenchswiss \@@ordinalstringfrench{#1}{#2}% -} -\DeclareRobustCommand{\@OrdinalstringMfrenchfrance}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter -\let\fc@first=\fc@@firstfrench +}% +\global\let\@OrdinalstringMfrenchswiss\@OrdinalstringMfrenchswiss +\newcommand*{\@OrdinalstringMfrenchfrance}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter +\let\fc@first\fc@@firstfrench \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \@@ordinalstringfrench{#1}{#2}% -} -\DeclareRobustCommand{\@OrdinalstringMfrenchbelgian}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter -\let\fc@first=\fc@@firstfrench +}% +\global\let\@OrdinalstringMfrenchfrance\@OrdinalstringMfrenchfrance +\newcommand*{\@OrdinalstringMfrenchbelgian}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter +\let\fc@first\fc@@firstfrench \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \@@ordinalstringfrench{#1}{#2}% -} -\let\@OrdinalstringMfrench=\@OrdinalstringMfrenchfrance -\DeclareRobustCommand{\@OrdinalstringFfrenchswiss}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter -\let\fc@first=\fc@@firstfrench +}% +\global\let\@OrdinalstringMfrenchbelgian\@OrdinalstringMfrenchbelgian +\global\let\@OrdinalstringMfrench=\@OrdinalstringMfrenchfrance +\newcommand*{\@OrdinalstringFfrenchswiss}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter +\let\fc@first\fc@@firstfrench \let\@seventies=\@@seventiesfrenchswiss \let\@eighties=\@@eightiesfrenchswiss \let\@nineties=\@@ninetiesfrenchswiss \@@ordinalstringfrench{#1}{#2}% -} -\DeclareRobustCommand{\@OrdinalstringFfrenchfrance}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter -\let\fc@first=\fc@@firstFfrench +}% +\global\let\@OrdinalstringFfrenchswiss\@OrdinalstringFfrenchswiss +\newcommand*{\@OrdinalstringFfrenchfrance}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter +\let\fc@first\fc@@firstFfrench \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \@@ordinalstringfrench{#1}{#2}% -} -\DeclareRobustCommand{\@OrdinalstringFfrenchbelgian}[2]{% -\let\fc@case\fc@UpperCaseFirstLetter -\let\fc@first=\fc@@firstFfrench +}% +\global\let\@OrdinalstringFfrenchfrance\@OrdinalstringFfrenchfrance +\newcommand*{\@OrdinalstringFfrenchbelgian}[2]{% \fc@french@common +\let\fc@gcase\fc@UpperCaseFirstLetter +\let\fc@first\fc@@firstFfrench \let\@seventies=\@@seventiesfrench \let\@eighties=\@@eightiesfrench \let\@nineties=\@@ninetiesfrench \@@ordinalstringfrench{#1}{#2}% -} -\let\@OrdinalstringFfrench=\@OrdinalstringFfrenchfrance -\let\@OrdinalstringNfrench\@OrdinalstringMfrench +}% +\global\let\@OrdinalstringFfrenchbelgian\@OrdinalstringFfrenchbelgian +\global\let\@OrdinalstringFfrench=\@OrdinalstringFfrenchfrance +\global\let\@OrdinalstringNfrench\@OrdinalstringMfrench % \end{macrocode} % \DescribeMacro{\fc@@do@plural@mark}Macro \cs{fc@@do@plural@mark} will expand to the plural mark of % \meta{$n$}illiard, \meta{$n$}illion, mil, cent or vingt, whichever is applicable. First check that the macro @@ -2301,7 +2427,8 @@ z\'ero% \fi \fi \fi -} +}% +\global\let\fc@@do@plural@mark\fc@@do@plural@mark % \end{macrocode} % \DescribeMacro{\fc@@nbrstr@Fpreamble}Macro \cs{fc@@nbrstr@Fpreamble} do the necessary preliminaries before % formatting a cardinal with feminine gender. @@ -2315,24 +2442,26 @@ z\'ero% \def\fc@@nbrstr@Fpreamble{% \fc@read@unit{\count1}{0}% \ifnum\count1=1 % - \let\fc@case@save\fc@case - \def\fc@case{\noexpand\fc@case}% + \let\fc@wcase@save\fc@wcase + \def\fc@wcase{\noexpand\fc@wcase}% \def\@nil{\noexpand\@nil}% \let\fc@nbrstr@postamble\fc@@nbrstr@Fpostamble \fi -} +}% +\global\let\fc@@nbrstr@Fpreamble\fc@@nbrstr@Fpreamble % \end{macrocode} % \DescribeMacro{\fc@@nbrstr@Fpostamble} % \begin{macrocode} \def\fc@@nbrstr@Fpostamble{% - \let\fc@case\fc@case@save + \let\fc@wcase\fc@wcase@save \expandafter\fc@get@last@word\expandafter{\@tempa}\@tempb\@tempc \def\@tempd{un}% \ifx\@tempc\@tempd \let\@tempc\@tempa - \edef\@tempa{\@tempb\fc@case une\@nil}% + \edef\@tempa{\@tempb\fc@wcase une\@nil}% \fi -} +}% +\global\let\fc@@nbrstr@Fpostamble\fc@@nbrstr@Fpostamble % \end{macrocode} % \DescribeMacro{\fc@@pot@longscalefrench}Macro \cs{fc@@pot@longscalefrench} is used to produce % powers of ten with long scale convention. The long scale convention is correct for French and elsewhere in @@ -2431,7 +2560,7 @@ z\'ero% % \begin{macrocode} \count10=\fc@frenchoptions@mil@plural\space \edef\@tempe{% - \noexpand\fc@case + \noexpand\fc@wcase mil% \fc@@do@plural@mark\fc@frenchoptions@mil@plural@mark \noexpand\@nil @@ -2448,7 +2577,7 @@ z\'ero% \count10=\csname fc@frenchoptions@n-illion@plural\endcsname\space \fi \edef\@tempe{% - \noexpand\fc@case + \noexpand\fc@wcase \@tempg \the\toks10 % \fc@@do@plural@mark s% @@ -2479,7 +2608,8 @@ z\'ero% \edef\@tempa{\the\toks0 \@temph \def\noexpand#3{\the\toks1}}% \expandafter }\@tempa -} +}% +\global\let\fc@@pot@longscalefrench\fc@@pot@longscalefrench % \end{macrocode} % \DescribeMacro{\fc@@pot@shortscalefrench}Macro \cs{fc@@pot@shortscalefrench} is used to produce % powers of ten with short scale convention. This convention is the US convention and is not correct for @@ -2529,7 +2659,7 @@ z\'ero% \expandafter\fc@@latin@cardinal@pefix\expandafter{\the\count2}\@tempg \count10=\csname fc@frenchoptions@n-illion@plural\endcsname\space \edef\@tempe{% - \noexpand\fc@case + \noexpand\fc@wcase \@tempg illion% \fc@@do@plural@mark s% @@ -2558,7 +2688,8 @@ z\'ero% \edef\@tempa{\the\toks0 \@temph \def\noexpand#3{\the\toks1}}% \expandafter }\@tempa -} +}% +\global\let\fc@@pot@shortscalefrench\fc@@pot@shortscalefrench % \end{macrocode} % \DescribeMacro{\fc@@pot@recursivefrench}Macro \cs{fc@@pot@recursivefrench} is used to produce % power of tens that are of the form ``million de milliards de milliards'' for \(10^{24}\). First we check @@ -2592,7 +2723,7 @@ z\'ero% \advance\count2 by -1 % \let\@tempe\@empty \edef\@tempf{\fc@frenchoptions@supermillion@dos - de\fc@frenchoptions@supermillion@dos\fc@case milliards\@nil}% + de\fc@frenchoptions@supermillion@dos\fc@wcase milliards\@nil}% \count11\count0 % \ifnum\count2>0 % \count3\count2 % @@ -2649,16 +2780,16 @@ z\'ero% \or mil\fc@@do@plural@mark\fc@frenchoptions@mil@plural@mark \noexpand\@nil\fc@frenchoptions@supermillion@dos - \noexpand\fc@case milliards% 4 + \noexpand\fc@wcase milliards% 4 \or million\fc@@do@plural@mark s% \noexpand\@nil\fc@frenchoptions@supermillion@dos - de\fc@frenchoptions@supermillion@dos\noexpand\fc@case milliards% 5 + de\fc@frenchoptions@supermillion@dos\noexpand\fc@wcase milliards% 5 \fi }% \edef\@tempe{% \ifx\@tempf\@empty\else - \expandafter\fc@case\@tempf\@nil + \expandafter\fc@wcase\@tempf\@nil \fi \@tempg }% @@ -2667,7 +2798,7 @@ z\'ero% \let\@tempe\@empty \fi % \end{macrocode} -% now place into \@cs{@tempa} the assignment of results \cs{@temph} and \cs{@tempe} to to \texttt{\#2} and +% Now place into \@cs{@tempa} the assignment of results \cs{@temph} and \cs{@tempe} to \texttt{\#2} and % \texttt{\#3} for further propagation after closing brace. % \begin{macrocode} \expandafter\toks\expandafter1\expandafter{\@tempe}% @@ -2675,7 +2806,8 @@ z\'ero% \edef\@tempa{\the\toks0 \@temph \def\noexpand#3{\the\toks1}}% \expandafter }\@tempa -} +}% +\global\let\fc@@pot@recursivefrench\fc@@pot@recursivefrench % \end{macrocode} % \DescribeMacro{\fc@muladdfrench}Macro \cs{fc@muladdfrench} is used to format the sum of a number \(a\) and % the product of a number \(d\) by a power of ten \(10^w\). Number \(d\) is made of three consecutive digits @@ -2773,6 +2905,7 @@ z\'ero% \expandafter }\@tempa }% +\global\let\fc@muladdfrench\fc@muladdfrench % \end{macrocode} % \DescribeMacro{\fc@lthundredstringfrench}Macro \cs{fc@lthundredstringfrench} is used to format a number in % interval \([0 \intv 99]\). First we check that it is not already defined. @@ -2875,7 +3008,8 @@ z\'ero% \expandafter\@tempb\expandafter{\@tempa}% \expandafter }\@tempa -} +}% +\global\let\fc@lthundredstringfrench\fc@lthundredstringfrench % \end{macrocode} % \DescribeMacro{\fc@ltthousandstringfrench}Macro \cs{fc@ltthousandstringfrench} is used to format a number in % interval \([0 \intv 999]\). First we check that it is not already defined. @@ -2939,10 +3073,10 @@ z\'ero% \ifnum\count2=0 % \else \ifnum\count2=1 % - \expandafter\fc@case\@hundred\@nil + \expandafter\fc@wcase\@hundred\@nil \else \@unitstring{\count2}\fc@frenchoptions@submillion@dos - \noexpand\fc@case\@hundred\@temps\noexpand\@nil + \noexpand\fc@wcase\@hundred\@temps\noexpand\@nil \fi \@tempb \fi @@ -2956,7 +3090,8 @@ z\'ero% \expandafter\@tempb\expandafter{\@tempa}% \expandafter }\@tempa -} +}% +\global\let\fc@ltthousandstringfrench\fc@ltthousandstringfrench % \end{macrocode} % \DescribeMacro{\@@numberstringfrench}Macro \cs{@@numberstringfrench} is the main engine for formatting % cadinal numbers in French. First we check that the control sequence is not yet defined. @@ -2987,7 +3122,7 @@ z\'ero% % \cs{fc@sign@case} expands to `\texttt{0}', then \cs{@tempa} is defined to `' (i.e. empty) rather than to % `\cs{relax}'. % \begin{macrocode} - \edef\@tempa{\ifcase\fc@sign@case\space\or\fc@case plus\@nil\or\fc@case moins\@nil\fi}% + \edef\@tempa{\ifcase\fc@sign@case\space\or\fc@wcase plus\@nil\or\fc@wcase moins\@nil\fi}% \fc@nbrstr@preamble \fc@@nbrstrfrench@inner \fc@nbrstr@postamble @@ -2998,7 +3133,8 @@ z\'ero% \expandafter\@tempb\expandafter{\@tempa}% \expandafter }\@tempa -} +}% +\global\let\@@numberstringfrench\@@numberstringfrench % \end{macrocode} % \DescribeMacro{\fc@@nbrstrfrench@inner}Common part of \cs{@@numberstringfrench} and \cs % {@@ordinalstringfrench}. Arguments are as follows:\newline\noindent @@ -3055,7 +3191,8 @@ z\'ero% \advance\count0 by -3 % \ifnum\count6>\count0 \else \repeat -} +}% +\global\let\fc@@nbrstrfrench@inner\fc@@nbrstrfrench@inner % \end{macrocode} % \DescribeMacro{\@@ordinalstringfrench}Macro \cs{@@ordinalstringfrench} is the main engine for formatting % ordinal numbers in French. First check it is not yet defined. @@ -3103,7 +3240,7 @@ z\'ero% % \changes{3.01}{2014-11-10}{Protect \cs{`}, for solving % \uref{http://github.com/nlct/fmtcount/issues/15}{Issue \#15}} % \begin{macrocode} - \protected@edef\@tempa{\expandafter\fc@case\fc@first\@nil}% + \protected@edef\@tempa{\expandafter\fc@wcase\fc@first\@nil}% \else % \end{macrocode} % Now we tamper a little bit with the plural handling options to ensure that there is no final plural mark. @@ -3133,10 +3270,10 @@ z\'ero% \@tempa{n-illion}% \@tempa{n-illiard}% % \end{macrocode} -% Now make \cs{fc@case} and \cs{@nil} non expandable +% Now make \cs{fc@wcase} and \cs{@nil} non expandable % \begin{macrocode} - \let\fc@case@save\fc@case - \def\fc@case{\noexpand\fc@case}% + \let\fc@wcase@save\fc@wcase + \def\fc@wcase{\noexpand\fc@wcase}% \def\@nil{\noexpand\@nil}% % \end{macrocode} % In the sequel, \cs{@tempa} is used to accumulate the formatted number. @@ -3144,9 +3281,9 @@ z\'ero% \let\@tempa\@empty \fc@@nbrstrfrench@inner % \end{macrocode} -% Now restore \cs{fc@case} +% Now restore \cs{fc@wcase} % \begin{macrocode} - \let\fc@case\fc@case@save + \let\fc@wcase\fc@wcase@save % \end{macrocode} % Now we add the ``i\`eme'' ending % \changes{3.01}{2014-11-10}{Protect \cs{`}, for solving @@ -3156,55 +3293,65 @@ z\'ero% \expandafter\fc@get@last@letter\expandafter{\@tempc}\@tempd\@tempe \def\@tempf{e}% \ifx\@tempe\@tempf - \protected@edef\@tempa{\@tempb\expandafter\fc@case\@tempd i\protect\`eme\@nil}% + \protected@edef\@tempa{\@tempb\expandafter\fc@wcase\@tempd i\protect\`eme\@nil}% \else \def\@tempf{q}% \ifx\@tempe\@tempf - \protected@edef\@tempa{\@tempb\expandafter\fc@case\@tempd qui\protect\`eme\@nil}% + \protected@edef\@tempa{\@tempb\expandafter\fc@wcase\@tempd qui\protect\`eme\@nil}% \else \def\@tempf{f}% \ifx\@tempe\@tempf - \protected@edef\@tempa{\@tempb\expandafter\fc@case\@tempd vi\protect\`eme\@nil}% + \protected@edef\@tempa{\@tempb\expandafter\fc@wcase\@tempd vi\protect\`eme\@nil}% \else - \protected@edef\@tempa{\@tempb\expandafter\fc@case\@tempc i\protect\`eme\@nil}% + \protected@edef\@tempa{\@tempb\expandafter\fc@wcase\@tempc i\protect\`eme\@nil}% \fi \fi \fi \fi % \end{macrocode} +% Apply \cs{fc@gcase} to the result. +% \begin{macrocode} + \fc@apply@gcase +% \end{macrocode} % Propagate the result --- i.e. expansion of \cs{@tempa} --- into macro \texttt{\#2} after closing brace. % \begin{macrocode} \def\@tempb##1{\def\@tempa{\def#2{##1}}}% \expandafter\@tempb\expandafter{\@tempa}% \expandafter }\@tempa -} +}% +\global\let\@@ordinalstringfrench\@@ordinalstringfrench % \end{macrocode} % Macro \cs{fc@frenchoptions@setdefaults} allows to set all options to default for the French. % \begin{macrocode} \newcommand*\fc@frenchoptions@setdefaults{% \csname KV@fcfrench@all plural\endcsname{reformed}% - \def\fc@frenchoptions@submillion@dos{-}% - \let\fc@frenchoptions@supermillion@dos\space - \let\fc@u@in@duo\@empty% Could be `u' - % \let\fc@poweroften\fc@@pot@longscalefrench - \let\fc@poweroften\fc@@pot@recursivefrench - \def\fc@longscale@nilliard@upto{0}% infinity - \def\fc@frenchoptions@mil@plural@mark{le}% -} -\fc@frenchoptions@setdefaults + \fc@gl@def\fc@frenchoptions@submillion@dos{-}% + \fc@gl@let\fc@frenchoptions@supermillion@dos\space + \fc@gl@let\fc@u@in@duo\@empty% Could be `u' + % \fc@gl@let\fc@poweroften\fc@@pot@longscalefrench + \fc@gl@let\fc@poweroften\fc@@pot@recursivefrench + \fc@gl@def\fc@longscale@nilliard@upto{0}% infinity + \fc@gl@def\fc@frenchoptions@mil@plural@mark{le}% +}% +\global\let\fc@frenchoptions@setdefaults\fc@frenchoptions@setdefaults +{% + \let\fc@gl@def\gdef + \def\fc@gl@let{\global\let}% + \fc@frenchoptions@setdefaults +}% % \end{macrocode} % Make some indirection to call the current French dialect corresponding macro. % \changes{3.01}{2014-12-18}{Move French specific stuff from \styfmt{fmtcount.sty} to \styfmt{fc-french.def}.} % \begin{macrocode} -\def\@ordinalstringMfrench{\csuse{@ordinalstringMfrench\fmtcount@french}}% -\def\@ordinalstringFfrench{\csuse{@ordinalstringFfrench\fmtcount@french}}% -\def\@OrdinalstringMfrench{\csuse{@OrdinalstringMfrench\fmtcount@french}}% -\def\@OrdinalstringFfrench{\csuse{@OrdinalstringFfrench\fmtcount@french}}% -\def\@numberstringMfrench{\csuse{@numberstringMfrench\fmtcount@french}}% -\def\@numberstringFfrench{\csuse{@numberstringFfrench\fmtcount@french}}% -\def\@NumberstringMfrench{\csuse{@NumberstringMfrench\fmtcount@french}}% -\def\@NumberstringFfrench{\csuse{@NumberstringFfrench\fmtcount@french}}% +\gdef\@ordinalstringMfrench{\csuse{@ordinalstringMfrench\fmtcount@french}}% +\gdef\@ordinalstringFfrench{\csuse{@ordinalstringFfrench\fmtcount@french}}% +\gdef\@OrdinalstringMfrench{\csuse{@OrdinalstringMfrench\fmtcount@french}}% +\gdef\@OrdinalstringFfrench{\csuse{@OrdinalstringFfrench\fmtcount@french}}% +\gdef\@numberstringMfrench{\csuse{@numberstringMfrench\fmtcount@french}}% +\gdef\@numberstringFfrench{\csuse{@numberstringFfrench\fmtcount@french}}% +\gdef\@NumberstringMfrench{\csuse{@NumberstringMfrench\fmtcount@french}}% +\gdef\@NumberstringFfrench{\csuse{@NumberstringFfrench\fmtcount@french}}% % \end{macrocode} \iffalse Local variables: \fi \iffalse mode: docTeX \fi @@ -3257,7 +3404,7 @@ z\'ero% % German definitions (thank you to K. H. Fricke for supplying % this information) % \begin{macrocode} -\ProvidesFCLanguage{german}[2014/06/09]% +\ProvidesFCLanguage{german}[2016/01/12]% % \end{macrocode} % Define macro that converts a number or count register (first % argument) to an ordinal, and stores the result in the @@ -3349,10 +3496,17 @@ z\'ero% }% \global\let\@@teenstringgerman\@@teenstringgerman % \end{macrocode} -% The results are stored in the second argument, but doesn't -% display anything. -% \begin{macrocode} -\DeclareRobustCommand{\@numberstringMgerman}[2]{% +% The results are stored in the second argument, but doesn't display +% anything.% +% \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by +% \cs{newcommand*} as robustness is handled now at top level in +% \texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned +% macros are \cs{@numberstringMgerman}, \cs{@NumberstringMgerman}, +% \cs{@ordinalstringMgerman}, \cs{@ordinalstringFgerman}, +% \cs{@ordinalstringNgerman}, \cs{@OrdinalstringMgerman}, +% \cs{@OrdinalstringFgerman}, and \cs{@OrdinalstringNgerman}.} +% \begin{macrocode} +\newcommand*{\@numberstringMgerman}[2]{% \let\@unitstring=\@@unitstringgerman \let\@teenstring=\@@teenstringgerman \let\@tenstring=\@@tenstringgerman @@ -3367,7 +3521,7 @@ z\'ero% % \end{macrocode} % As above, but initial letters in upper case: % \begin{macrocode} -\DeclareRobustCommand{\@NumberstringMgerman}[2]{% +\newcommand*{\@NumberstringMgerman}[2]{% \@numberstringMgerman{#1}{\@@num@str}% \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}% }% @@ -3380,7 +3534,7 @@ z\'ero% % \end{macrocode} % As above, but for ordinals. % \begin{macrocode} -\DeclareRobustCommand{\@ordinalstringMgerman}[2]{% +\newcommand*{\@ordinalstringMgerman}[2]{% \let\@unitthstring=\@@unitthstringMgerman \let\@teenthstring=\@@teenthstringMgerman \let\@tenthstring=\@@tenthstringMgerman @@ -3395,7 +3549,7 @@ z\'ero% % \end{macrocode} % Feminine form: % \begin{macrocode} -\DeclareRobustCommand{\@ordinalstringFgerman}[2]{% +\newcommand*{\@ordinalstringFgerman}[2]{% \let\@unitthstring=\@@unitthstringFgerman \let\@teenthstring=\@@teenthstringFgerman \let\@tenthstring=\@@tenthstringFgerman @@ -3410,7 +3564,7 @@ z\'ero% % \end{macrocode} % Neuter form: % \begin{macrocode} -\DeclareRobustCommand{\@ordinalstringNgerman}[2]{% +\newcommand*{\@ordinalstringNgerman}[2]{% \let\@unitthstring=\@@unitthstringNgerman \let\@teenthstring=\@@teenthstringNgerman \let\@tenthstring=\@@tenthstringNgerman @@ -3425,7 +3579,7 @@ z\'ero% % \end{macrocode} % As above, but with initial letters in upper case. % \begin{macrocode} -\DeclareRobustCommand{\@OrdinalstringMgerman}[2]{% +\newcommand*{\@OrdinalstringMgerman}[2]{% \@ordinalstringMgerman{#1}{\@@num@str}% \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}% }% @@ -3433,7 +3587,7 @@ z\'ero% % \end{macrocode} % Feminine form: % \begin{macrocode} -\DeclareRobustCommand{\@OrdinalstringFgerman}[2]{% +\newcommand*{\@OrdinalstringFgerman}[2]{% \@ordinalstringFgerman{#1}{\@@num@str}% \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}% }% @@ -3441,7 +3595,7 @@ z\'ero% % \end{macrocode} % Neuter form: % \begin{macrocode} -\DeclareRobustCommand{\@OrdinalstringNgerman}[2]{% +\newcommand*{\@OrdinalstringNgerman}[2]{% \@ordinalstringNgerman{#1}{\@@num@str}% \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}% }% @@ -3824,7 +3978,9 @@ z\'ero% % \begin{macrocode} \FCloadlang{germanb}% % \end{macrocode} - +\iffalse Local variables: \fi +\iffalse mode: docTeX \fi +\iffalse End: \fi %\iffalse % \begin{macrocode} % @@ -4018,7 +4174,7 @@ z\'ero% % \subsubsection{fc-portuges.def} % Portuguse definitions % \begin{macrocode} -\ProvidesFCLanguage{portuges}[2014/06/09]% +\ProvidesFCLanguage{portuges}[2016/01/12]% % \end{macrocode} % Define macro that converts a number or count register (first % argument) to an ordinal, and stores the result in the second @@ -4270,8 +4426,15 @@ z\'ero% % anything. Since it only affects internal macros, it shouldn't % affect documents created with older versions. (These internal % macros are not meant for use in documents.) -% \begin{macrocode} -\DeclareRobustCommand{\@numberstringMportuges}[2]{% +% \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by % +\cs{newcommand*} as robustness is handled now at top level in % +\texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned % +macros are \cs{@numberstringMportuges}, \cs{@numberstringFportuges}, +\cs{@NumberstringMportuges}, \cs{@NumberstringFportuges}, +\cs{@ordinalstringMportuges}, \cs{@ordinalstringFportuges}, +\cs{@OrdinalstringMportuges}, and \cs{@OrdinalstringFportuges}.} +% \begin{macrocode} +\newcommand*{\@numberstringMportuges}[2]{% \let\@unitstring=\@@unitstringportuges \let\@teenstring=\@@teenstringportuges \let\@tenstring=\@@tenstringportuges @@ -4284,7 +4447,7 @@ z\'ero% % \end{macrocode} % As above, but feminine form: % \begin{macrocode} -\DeclareRobustCommand{\@numberstringFportuges}[2]{% +\newcommand*{\@numberstringFportuges}[2]{% \let\@unitstring=\@@unitstringFportuges \let\@teenstring=\@@teenstringportuges \let\@tenstring=\@@tenstringportuges @@ -4301,7 +4464,7 @@ z\'ero% % \end{macrocode} % As above, but initial letters in upper case: % \begin{macrocode} -\DeclareRobustCommand{\@NumberstringMportuges}[2]{% +\newcommand*{\@NumberstringMportuges}[2]{% \let\@unitstring=\@@Unitstringportuges \let\@teenstring=\@@Teenstringportuges \let\@tenstring=\@@Tenstringportuges @@ -4314,7 +4477,7 @@ z\'ero% % \end{macrocode} % As above, but feminine form: % \begin{macrocode} -\DeclareRobustCommand{\@NumberstringFportuges}[2]{% +\newcommand*{\@NumberstringFportuges}[2]{% \let\@unitstring=\@@UnitstringFportuges \let\@teenstring=\@@Teenstringportuges \let\@tenstring=\@@Tenstringportuges @@ -4331,7 +4494,7 @@ z\'ero% % \end{macrocode} % As above, but for ordinals. % \begin{macrocode} -\DeclareRobustCommand{\@ordinalstringMportuges}[2]{% +\newcommand*{\@ordinalstringMportuges}[2]{% \let\@unitthstring=\@@unitthstringportuges \let\@unitstring=\@@unitstringportuges \let\@teenthstring=\@@teenthstringportuges @@ -4344,7 +4507,7 @@ z\'ero% % \end{macrocode} % Feminine form: % \begin{macrocode} -\DeclareRobustCommand{\@ordinalstringFportuges}[2]{% +\newcommand*{\@ordinalstringFportuges}[2]{% \let\@unitthstring=\@@unitthstringFportuges \let\@unitstring=\@@unitstringFportuges \let\@teenthstring=\@@teenthstringportuges @@ -4361,7 +4524,7 @@ z\'ero% % \end{macrocode} % As above, but initial letters in upper case (masculine): % \begin{macrocode} -\DeclareRobustCommand{\@OrdinalstringMportuges}[2]{% +\newcommand*{\@OrdinalstringMportuges}[2]{% \let\@unitthstring=\@@Unitthstringportuges \let\@unitstring=\@@Unitstringportuges \let\@teenthstring=\@@teenthstringportuges @@ -4374,7 +4537,7 @@ z\'ero% % \end{macrocode} % Feminine form: % \begin{macrocode} -\DeclareRobustCommand{\@OrdinalstringFportuges}[2]{% +\newcommand*{\@OrdinalstringFportuges}[2]{% \let\@unitthstring=\@@UnitthstringFportuges \let\@unitstring=\@@UnitstringFportuges \let\@teenthstring=\@@teenthstringportuges @@ -4815,6 +4978,9 @@ this number}% }% \global\let\@@ordinalstringportuges\@@ordinalstringportuges % \end{macrocode} +\iffalse Local variables: \fi +\iffalse mode: docTeX \fi +\iffalse End: \fi %\iffalse % \begin{macrocode} % @@ -4865,7 +5031,7 @@ this number}% % \subsubsection{fc-spanish.def} % Spanish definitions % \begin{macrocode} -\ProvidesFCLanguage{spanish}[2013/08/17]% +\ProvidesFCLanguage{spanish}[2016/01/12]% % \end{macrocode} % Define macro that converts a number or count register (first % argument) to an ordinal, and stores the result in the @@ -5183,8 +5349,15 @@ this number}% % Since it only affects internal macros, it shouldn't affect % documents created with older versions. (These internal macros % are not meant for use in documents.) -% \begin{macrocode} -\DeclareRobustCommand{\@numberstringMspanish}[2]{% +% \changes{3.02}{2016/01/12}{Replace \cs{DeclareRobustCommand} by +% \cs{newcommand*} as robustness is handled now at top level in +% \texttt{fmtcount.sty}, and we don't need \cs{long} macros. Concerned +% macros as \cs{@numberstringMspanish}, \cs{@numberstringFspanish}, +% \cs{@NumberstringFspanish}, \cs{@ordinalstringMspanish}, +% \cs{@ordinalstringFspanish}, \cs{@OrdinalstringMspanish}, and +% \cs{@OrdinalstringFspanish}.} +% \begin{macrocode} +\newcommand*{\@numberstringMspanish}[2]{% \let\@unitstring=\@@unitstringspanish \let\@teenstring=\@@teenstringspanish \let\@tenstring=\@@tenstringspanish @@ -5200,7 +5373,7 @@ this number}% %\changes{2.0}{2012-06-18}{changed andname to `b' (correction %provided by Fernando Maldonado)} % \begin{macrocode} -\DeclareRobustCommand{\@numberstringFspanish}[2]{% +\newcommand*{\@numberstringFspanish}[2]{% \let\@unitstring=\@@unitstringFspanish \let\@teenstring=\@@teenstringspanish \let\@tenstring=\@@tenstringspanish @@ -5218,7 +5391,7 @@ this number}% % \end{macrocode} % As above, but initial letters in upper case: % \begin{macrocode} -\DeclareRobustCommand{\@NumberstringMspanish}[2]{% +\newcommand*{\@NumberstringMspanish}[2]{% \let\@unitstring=\@@Unitstringspanish \let\@teenstring=\@@Teenstringspanish \let\@tenstring=\@@Tenstringspanish @@ -5234,7 +5407,7 @@ this number}% %\changes{2.0}{2012-06-18}{changed andname to `b' (correction %provided by Fernando Maldonado)} % \begin{macrocode} -\DeclareRobustCommand{\@NumberstringFspanish}[2]{% +\newcommand*{\@NumberstringFspanish}[2]{% \let\@unitstring=\@@UnitstringFspanish \let\@teenstring=\@@Teenstringspanish \let\@tenstring=\@@Tenstringspanish @@ -5252,7 +5425,7 @@ this number}% % \end{macrocode} % As above, but for ordinals. % \begin{macrocode} -\DeclareRobustCommand{\@ordinalstringMspanish}[2]{% +\newcommand*{\@ordinalstringMspanish}[2]{% \let\@unitthstring=\@@unitthstringspanish \let\@unitstring=\@@unitstringspanish \let\@teenthstring=\@@teenthstringspanish @@ -5265,7 +5438,7 @@ this number}% % \end{macrocode} % Feminine form: % \begin{macrocode} -\DeclareRobustCommand{\@ordinalstringFspanish}[2]{% +\newcommand*{\@ordinalstringFspanish}[2]{% \let\@unitthstring=\@@unitthstringFspanish \let\@unitstring=\@@unitstringFspanish \let\@teenthstring=\@@teenthstringFspanish @@ -5282,7 +5455,7 @@ this number}% % \end{macrocode} % As above, but with initial letters in upper case. % \begin{macrocode} -\DeclareRobustCommand{\@OrdinalstringMspanish}[2]{% +\newcommand*{\@OrdinalstringMspanish}[2]{% \let\@unitthstring=\@@Unitthstringspanish \let\@unitstring=\@@Unitstringspanish \let\@teenthstring=\@@Teenthstringspanish @@ -5295,7 +5468,7 @@ this number}% % \end{macrocode} % Feminine form: % \begin{macrocode} -\DeclareRobustCommand{\@OrdinalstringFspanish}[2]{% +\newcommand*{\@OrdinalstringFspanish}[2]{% \let\@unitthstring=\@@UnitthstringFspanish \let\@unitstring=\@@UnitstringFspanish \let\@teenthstring=\@@TeenthstringFspanish @@ -5804,8 +5977,9 @@ this number}% }% \global\let\@@ordinalstringspanish\@@ordinalstringspanish % \end{macrocode} - -%\iffalse +\iffalse Local variables: \fi +\iffalse mode: docTeX \fi +\iffalse End: \fi%\iffalse % \begin{macrocode} % % \end{macrocode} @@ -5895,7 +6069,7 @@ this number}% %\subsection{fcnumparser.sty} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{fcnumparser}[2012/09/28] +\ProvidesPackage{fcnumparser}[2017/06/15] % \end{macrocode} % \cs{fc@counter@parser} is just a shorthand to parse a number held in a counter. % \begin{macrocode} @@ -6368,26 +6542,26 @@ this number}% \def\fc@get@last@word#1#2#3{% {% % \end{macrocode} -% First we split \texttt{\#1} into two parts: everything that is upto \cs{fc@case} exclusive goes to -% \cs{toks0}, and evrything from \cs{fc@case} exclusive upto the final \cs{@nil} exclusive goes to \cs{toks1}. +% First we split \texttt{\#1} into two parts: everything that is upto \cs{fc@wcase} exclusive goes to +% \cs{toks0}, and evrything from \cs{fc@wcase} exclusive upto the final \cs{@nil} exclusive goes to \cs{toks1}. % \begin{macrocode} - \def\@tempa##1\fc@case##2\@nil\fc@end{% + \def\@tempa##1\fc@wcase##2\@nil\fc@end{% \toks0{##1}% % \end{macrocode} -% Actually a dummy \cs{fc@case} is appended to \cs{toks1}, because that makes easier further checking that it -% does not contains any other \cs{fc@case}. +% Actually a dummy \cs{fc@wcase} is appended to \cs{toks1}, because that makes easier further checking that it +% does not contains any other \cs{fc@wcase}. % \begin{macrocode} - \toks1{##2\fc@case}% + \toks1{##2\fc@wcase}% }% \@tempa#1\fc@end % \end{macrocode} % Now leading part upto last word should be in \cs{toks0}, and last word should be in \cs{toks1}. However we -% need to check that this is really the last word, i.e. we need to check that there is no \cs{fc@case} inside +% need to check that this is really the last word, i.e. we need to check that there is no \cs{fc@wcase} inside % \cs{toks1} other than the tailing dummy one. To that purpose we will loop while we find that \cs{toks1} -% contains some \cs{fc@case}. First we define \cs{@tempa} to split \cs{the}\cs{toks1} between parts before and -% after some potential \cs{fc@case}. +% contains some \cs{fc@wcase}. First we define \cs{@tempa} to split \cs{the}\cs{toks1} between parts before and +% after some potential \cs{fc@wcase}. % \begin{macrocode} - \def\@tempa##1\fc@case##2\fc@end{% + \def\@tempa##1\fc@wcase##2\fc@end{% \toks2{##1}% \def\@tempb{##2}% \toks3{##2}% @@ -6403,7 +6577,7 @@ this number}% \expandafter\@tempa\the\toks1 \fc@end \ifx\@tempb\@empty % \end{macrocode} -% \cs{@tempb} empty means that the only \cs{fc@case} found in \cs{the}\cs{toks1} is the dummy one. So we end +% \cs{@tempb} empty means that the only \cs{fc@wcase} found in \cs{the}\cs{toks1} is the dummy one. So we end % the loop here, \cs{toks2} contains the last word. % \begin{macrocode} \let\next\relax @@ -6414,7 +6588,7 @@ this number}% \expandafter\expandafter\expandafter\@tempt \expandafter\expandafter\expandafter{% \expandafter\the\expandafter\@tempt - \expandafter\fc@case\the\toks2}% + \expandafter\fc@wcase\the\toks2}% \toks1\toks3 % \fi \next @@ -7081,11 +7255,12 @@ this number}% %<*fmtcount.sty> % \end{macrocode} %\fi + %\subsection{fmtcount.sty} % This section deals with the code for |fmtcount.sty| % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{fmtcount}[2015/05/05 v3.01] +\ProvidesPackage{fmtcount}[2016/01/12 v3.02] \RequirePackage{ifthen} % \end{macrocode} % \changes{3.01}{2014-12-18}{Use \styfmt{xkeyval} instead of \styfmt{keyval}, so that we do not get in trouble @@ -7463,7 +7638,7 @@ italian} %\end{option} %\begin{macro}{\fmtcountsetoptions} % Define command to set options. -% \changes{3.01}{2014-12-18}{ Move French specific stuff to \styfmt{french.def}.} +% \changes{3.01}{2014-12-18}{Move French specific stuff to \styfmt{french.def}.} % \begin{macrocode} \def\fmtcountsetoptions{% \def\fmtcount@fmtord{}% @@ -7569,8 +7744,9 @@ italian} % \end{macrocode} %\begin{macro}{\binarynum} % Converts a decimal number to binary, and display. +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\@binary}[1]{% +\newrobustcmd*{\@binary}[1]{% \@DT@padzeroestrue \@DT@loopN=17\relax \@strctr=\@DT@loopN @@ -7600,8 +7776,9 @@ italian} %\end{macro} %\begin{macro}{\octalnum} % Converts a decimal number to octal, and displays. +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\@octal}[1]{% +\newrobustcmd*{\@octal}[1]{% \ifnum#1>32768 \PackageError{fmtcount}% {Value of counter too large for \protect\@octal} @@ -7645,8 +7822,9 @@ italian} %\begin{macro}{\hexadecimalnum} % Converts a decimal number to a lowercase hexadecimal number, % and displays it. +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\@hexadecimal}[1]{% +\newrobustcmd*{\@hexadecimal}[1]{% \@DT@padzeroestrue \@DT@loopN=5\relax \@strctr=\@DT@loopN @@ -7683,8 +7861,9 @@ italian} %\end{macro} %\begin{macro}{\Hexadecimalnum} % Uppercase hexadecimal +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\@Hexadecimal}[1]{% +\newrobustcmd*{\@Hexadecimal}[1]{% \@DT@padzeroestrue \@DT@loopN=5\relax \@strctr=\@DT@loopN @@ -7713,8 +7892,9 @@ italian} %\end{macro} %\begin{macro}{\aaalphnum} % Lowercase alphabetical representation (a \ldots\ z aa \ldots\ zz) +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\@aaalph}[1]{% +\newrobustcmd*{\@aaalph}[1]{% \@DT@loopN=#1\relax \advance\@DT@loopN by -1\relax \divide\@DT@loopN by 26\relax @@ -7737,8 +7917,9 @@ italian} %\end{macro} %\begin{macro}{\AAAlphnum} % Uppercase alphabetical representation (a \ldots\ z aa \ldots\ zz) +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\@AAAlph}[1]{% +\newrobustcmd*{\@AAAlph}[1]{% \@DT@loopN=#1\relax \advance\@DT@loopN by -1\relax \divide\@DT@loopN by 26\relax @@ -7761,8 +7942,9 @@ italian} %\end{macro} %\begin{macro}{\abalphnum} % Lowercase alphabetical representation +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\@abalph}[1]{% +\newrobustcmd*{\@abalph}[1]{% \ifnum#1>17576\relax \PackageError{fmtcount}% {Value of counter too large for \protect\@abalph}% @@ -7794,8 +7976,9 @@ italian} %\end{macro} %\begin{macro}{\ABAlphnum} % Uppercase alphabetical representation +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\@ABAlph}[1]{% +\newrobustcmd*{\@ABAlph}[1]{% \ifnum#1>17576\relax \PackageError{fmtcount}% {Value of counter too large for \protect\@ABAlph}% @@ -7840,8 +8023,9 @@ italian} %\begin{macro}{\@decimal} %\changes{1.31}{2009/10/02}{fixed unwanted space.} % Format number as a decimal, possibly padded with zeroes in front. +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand{\@decimal}[1]{% +\newrobustcmd*{\@decimal}[1]{% \@strctr=0\relax \expandafter\@fmtc@count\number#1\relax \@DT@loopN=\c@padzeroesN @@ -7875,10 +8059,12 @@ italian} % argument is omitted. % Version 1.04 changed \cs{ordinal} to \cs{FCordinal} % to prevent it clashing with the memoir class. +% \changes{3.02}{2015/08/01}{Suppress useless \cs{expandafter}'s and and use \cs{value} instead tweaking with +% \cs{csname}. Do not use any longer \cs{protect} as \cs{ordinalnum} is made robust.} % \begin{macrocode} \newcommand{\FCordinal}[1]{% - \expandafter\protect\expandafter\ordinalnum{% - \expandafter\the\csname c@#1\endcsname}% + \ordinalnum{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} @@ -7903,8 +8089,9 @@ italian} % count register instead of a counter: %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with %\cs{new@ifnextchar}} +% \changes{3.02}{2015-08-01}{Make \cs{ordinalnum} robust.} % \begin{macrocode} -\newcommand*{\ordinalnum}[1]{% +\DeclareRobustCommand*{\ordinalnum}[1]{% \new@ifnextchar[% {\@ordinalnum{#1}}% {\@ordinalnum{#1}[m]}% @@ -7947,10 +8134,16 @@ italian} %\begin{macro}{\storeordinal} % Store the ordinal (first argument % is identifying name, second argument is a counter.) +% \changes{3.02}{2015-08-01}{Suppress useless \cs{expandafter}'s and and use \cs{value} instead tweaking with +% \cs{csname}. Do not use any longer \cs{protect} as \cs{storeordinalnum} is made robust.} +% \changes{3.02}{2016/01/08}{Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before passing to \cs{storeordinalnum}} % \begin{macrocode} \newcommand*{\storeordinal}[2]{% - \expandafter\protect\expandafter\storeordinalnum{#1}{% - \expandafter\the\csname c@#2\endcsname}% + {% + \toks0{\storeordinalnum{#1}}% + \expandafter + }\the\toks0\expandafter{% + \the\value{#2}}% } % \end{macrocode} %\end{macro} @@ -7958,8 +8151,9 @@ italian} % Store ordinal (first argument % is identifying name, second argument is a number or % count register.) +% \changes{3.02}{2016/01/08}{Make \cs{storeordinalnum} robust with etoolbox \cs{newrobustcmd}.} % \begin{macrocode} -\newcommand*{\storeordinalnum}[2]{% +\newrobustcmd*{\storeordinalnum}[2]{% \@ifnextchar[% {\@storeordinalnum{#1}{#2}}% {\@storeordinalnum{#1}{#2}[m]}% @@ -8001,11 +8195,16 @@ italian} % \end{macrocode} %\end{macro} %\begin{macro}{\ordinalstring} -% Display ordinal as a string (argument is a counter) +% Display ordinal as a string (argument is a counter) +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use +% any longer \cs{protect} as \cs{ordinalstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{ordinalstringnum}} % \begin{macrocode} \newcommand*{\ordinalstring}[1]{% - \expandafter\protect\expandafter\ordinalstringnum{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\ordinalstringnum\expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} @@ -8015,8 +8214,9 @@ italian} %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with %\cs{new@ifnextchar}} %\changes{1.33}{2009/10/15}{Made robust} +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand{\ordinalstringnum}[1]{% +\newrobustcmd*{\ordinalstringnum}[1]{% \new@ifnextchar[% {\@ordinal@string{#1}}% {\@ordinal@string{#1}[m]}% @@ -8060,18 +8260,26 @@ italian} % Store textual representation of number. First argument is % identifying name, second argument is the counter set to the % required number. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{storeordinalstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before +% passing to \cs{storeordinalstringnum}} % \begin{macrocode} \newcommand*{\storeordinalstring}[2]{% - \expandafter\protect\expandafter\storeordinalstringnum{#1}{% - \expandafter\the\csname c@#2\endcsname}% + {% + \toks0{\storeordinalstringnum{#1}}% + \expandafter + }\the\toks0\expandafter{\the\value{#2}}% } % \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. +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\storeordinalstringnum}[2]{% +\newrobustcmd*{\storeordinalstringnum}[2]{% \@ifnextchar[% {\@store@ordinal@string{#1}{#2}}% {\@store@ordinal@string{#1}{#2}[m]}% @@ -8111,10 +8319,15 @@ italian} %\begin{macro}{\Ordinalstring} % Display ordinal as a string with initial letters in upper case % (argument is a counter) +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{Ordinalstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{Ordinalstringnum}} % \begin{macrocode} \newcommand*{\Ordinalstring}[1]{% - \expandafter\protect\expandafter\Ordinalstringnum{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\Ordinalstringnum\expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} @@ -8123,8 +8336,9 @@ italian} % (argument is a number or count register) %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with %\cs{new@ifnextchar}} +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\Ordinalstringnum}[1]{% +\newrobustcmd*{\Ordinalstringnum}[1]{% \new@ifnextchar[% {\@Ordinal@string{#1}}% {\@Ordinal@string{#1}[m]}% @@ -8167,10 +8381,17 @@ italian} % upper case. First argument is identifying name, second argument % is the counter set to the % required number. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{storeOrdinalstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{storeOrdinalstringnum}} % \begin{macrocode} \newcommand*{\storeOrdinalstring}[2]{% - \expandafter\protect\expandafter\storeOrdinalstringnum{#1}{% - \expandafter\the\csname c@#2\endcsname}% + {% + \toks0{\storeOrdinalstringnum{#1}}% + \expandafter + }\the\toks0\expandafter{\the\value{#2}}% } % \end{macrocode} %\end{macro} @@ -8178,8 +8399,9 @@ italian} % Store textual representation of number, with initial letters in % upper case. First argument is identifying name, second argument % is a count register or number. +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\storeOrdinalstringnum}[2]{% +\newrobustcmd*{\storeOrdinalstringnum}[2]{% \@ifnextchar[% {\@store@Ordinal@string{#1}{#2}}% {\@store@Ordinal@string{#1}{#2}[m]}% @@ -8219,18 +8441,26 @@ italian} %\begin{macro}{\storeORDINALstring} % Store upper case textual representation of ordinal. The first % argument is identifying name, the second argument is a counter. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{storeORDINALstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before +% passing to \cs{storeORDINALstringnum}.} % \begin{macrocode} \newcommand*{\storeORDINALstring}[2]{% - \expandafter\protect\expandafter\storeORDINALstringnum{#1}{% - \expandafter\the\csname c@#2\endcsname}% + {% + \toks0{\storeORDINALstringnum{#1}}% + \expandafter + }\the\toks0\expandafter{\the\value{#2}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\storeORDINALstringnum} % As above, but the second argument is a count register or a % number. +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\storeORDINALstringnum}[2]{% +\newrobustcmd*{\storeORDINALstringnum}[2]{% \@ifnextchar[% {\@store@ORDINAL@string{#1}{#2}}% {\@store@ORDINAL@string{#1}{#2}[m]}% @@ -8273,10 +8503,15 @@ italian} %\begin{macro}{\ORDINALstring} % Display upper case textual representation of an ordinal. The % argument must be a counter. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{ORDINALstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{ORDINALstringnum}} % \begin{macrocode} \newcommand*{\ORDINALstring}[1]{% - \expandafter\protect\expandafter\ORDINALstringnum{% - \expandafter\the\csname c@#1\endcsname + \expandafter\ORDINALstringnum\expandafter{% + \the\value{#1}% }% } % \end{macrocode} @@ -8285,8 +8520,9 @@ italian} % As above, but the argument is a count register or a number. %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with %\cs{new@ifnextchar}} +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\ORDINALstringnum}[1]{% +\newrobustcmd*{\ORDINALstringnum}[1]{% \new@ifnextchar[% {\@ORDINAL@string{#1}}% {\@ORDINAL@string{#1}[m]}% @@ -8327,10 +8563,15 @@ italian} % Convert number to textual respresentation, and store. First % argument is the identifying name, second argument is a counter % containing the number. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{storenumberstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before +% passing to \cs{storenumberstringnum}} % \begin{macrocode} \newcommand*{\storenumberstring}[2]{% \expandafter\protect\expandafter\storenumberstringnum{#1}{% - \expandafter\the\csname c@#2\endcsname}% + \expandafter\the\value{#2}}% } % \end{macrocode} %\end{macro} @@ -8375,10 +8616,15 @@ italian} %\begin{macro}{\numberstring} % Display textual representation of a number. The argument % must be a counter. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{numberstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{numberstringnum}} % \begin{macrocode} \newcommand*{\numberstring}[1]{% - \expandafter\protect\expandafter\numberstringnum{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\numberstringnum\expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} @@ -8386,8 +8632,9 @@ italian} % As above, but the argument is a count register or a number. %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with %\cs{new@ifnextchar}} +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\numberstringnum}[1]{% +\newrobustcmd*{\numberstringnum}[1]{% \new@ifnextchar[% {\@number@string{#1}}% {\@number@string{#1}[m]}% @@ -8428,10 +8675,17 @@ italian} %\begin{macro}{\storeNumberstring} % Store textual representation of number. First argument is % identifying name, second argument is a counter. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{storeNumberstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before +% passing to \cs{storeNumberstringnum}} % \begin{macrocode} \newcommand*{\storeNumberstring}[2]{% - \expandafter\protect\expandafter\storeNumberstringnum{#1}{% - \expandafter\the\csname c@#2\endcsname}% + {% + \toks0{\storeNumberstringnum{#1}}% + \expandafter + }\the\toks0\expandafter{\the\value{#2}}% } % \end{macrocode} %\end{macro} @@ -8476,10 +8730,15 @@ italian} %\begin{macro}{\Numberstring} % Display textual representation of number. The argument must be % a counter. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{Numberstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{Numberstringnum}} % \begin{macrocode} \newcommand*{\Numberstring}[1]{% - \expandafter\protect\expandafter\Numberstringnum{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\Numberstringnum\expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} @@ -8487,8 +8746,9 @@ italian} % As above, but the argument is a count register or number. %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with %\cs{new@ifnextchar}} +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\Numberstringnum}[1]{% +\newrobustcmd*{\Numberstringnum}[1]{% \new@ifnextchar[% {\@Number@string{#1}}% {\@Number@string{#1}[m]}% @@ -8528,10 +8788,17 @@ italian} %\begin{macro}{\storeNUMBERstring} % Store upper case textual representation of number. The first % argument is identifying name, the second argument is a counter. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{storeNUMBERstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#2\}} once before +% passing to \cs{storeNUMBERstringnum}.} % \begin{macrocode} \newcommand{\storeNUMBERstring}[2]{% - \expandafter\protect\expandafter\storeNUMBERstringnum{#1}{% - \expandafter\the\csname c@#2\endcsname}% + {% + \toks0{\storeNUMBERstringnum{#1}}% + \expandafter + }\the\toks0\expandafter{\the\value{#2}}% } % \end{macrocode} %\end{macro} @@ -8579,10 +8846,15 @@ italian} %\begin{macro}{\NUMBERstring} % Display upper case textual representation of a number. The % argument must be a counter. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{NUMBERstringnum} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{NUMBERstringnum}.} % \begin{macrocode} \newcommand*{\NUMBERstring}[1]{% - \expandafter\protect\expandafter\NUMBERstringnum{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\NUMBERstringnum\expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} @@ -8590,8 +8862,9 @@ italian} % As above, but the argument is a count register or a number. %\changes{1.31}{2009/10/02}{replaced \cs{@ifnextchar} with %\cs{new@ifnextchar}} +%\changes{3.02}{2016/01/08}{Made robust using \texttt{etoolbox} \cs{newrobustcmd}} % \begin{macrocode} -\newcommand*{\NUMBERstringnum}[1]{% +\newrobustcmd*{\NUMBERstringnum}[1]{% \new@ifnextchar[% {\@NUMBER@string{#1}}% {\@NUMBER@string{#1}[m]}% @@ -8630,89 +8903,143 @@ italian} %\end{macro} %\begin{macro}{\binary} % Number representations in other bases. Binary: +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@binary} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@binary}} % \begin{macrocode} \providecommand*{\binary}[1]{% - \expandafter\protect\expandafter\@binary{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@binary + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\aaalph} % Like \ics{alph}, but goes beyond 26. % (a \ldots\ z aa \ldots zz \ldots) +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@aaalph} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@aaalph}.} % \begin{macrocode} \providecommand*{\aaalph}[1]{% - \expandafter\protect\expandafter\@aaalph{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@aaalph + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\AAAlph} % As before, but upper case. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@AAAlph} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@AAAlph}.} % \begin{macrocode} \providecommand*{\AAAlph}[1]{% - \expandafter\protect\expandafter\@AAAlph{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@AAAlph + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\abalph} % Like \ics{alph}, but goes beyond 26. % (a \ldots\ z ab \ldots az \ldots) +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@abalph} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@abalph}.} % \begin{macrocode} \providecommand*{\abalph}[1]{% - \expandafter\protect\expandafter\@abalph{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@abalph + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\ABAlph} % As above, but upper case. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@ABAlph} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@ABAlph}.} % \begin{macrocode} \providecommand*{\ABAlph}[1]{% - \expandafter\protect\expandafter\@ABAlph{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@ABAlph + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\hexadecimal} % Hexadecimal: +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@hexadecimal} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@hexadecimal}.} % \begin{macrocode} \providecommand*{\hexadecimal}[1]{% - \expandafter\protect\expandafter\@hexadecimal{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@hexadecimal + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\Hexadecimal} % As above, but in upper case. +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@Hexadecimal} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@Hexadecimal}.} % \begin{macrocode} \providecommand*{\Hexadecimal}[1]{% - \expandafter\protect\expandafter\@Hexadecimal{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@Hexadecimal + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\octal} % Octal: +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@octal} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@octal}} % \begin{macrocode} \providecommand*{\octal}[1]{% - \expandafter\protect\expandafter\@octal{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@octal + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} %\begin{macro}{\decimal} % Decimal: +% \changes{3.02}{2016/01/08}{Suppress useless \cs{expandafter}'s and +% and use \cs{value} instead tweaking with \cs{csname}. Do not use any +% longer \cs{protect} as \cs{@decimal} is made +% robust. Expand \cs{the}\cs{value}\texttt{\{\#1\}} once before +% passing to \cs{@decimal}} % \begin{macrocode} \providecommand*{\decimal}[1]{% - \expandafter\protect\expandafter\@decimal{% - \expandafter\the\csname c@#1\endcsname}% + \expandafter\@decimal + \expandafter{% + \the\value{#1}}% } % \end{macrocode} %\end{macro} % -%\subsection{Multilinguage Definitions} +%\subsubsection{Multilinguage Definitions} %\begin{macro}{\@setdef@ultfmtcount} % If multilingual support is provided, make \cs{@numberstring} % etc use the correct language (if defined). diff --git a/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins b/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins index 5a40522adae..8d25c56ac77 100644 --- a/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins +++ b/Master/texmf-dist/source/latex/fmtcount/fmtcount.ins @@ -1,10 +1,10 @@ -% fmtcount.ins generated using makedtx version 0.94b 2015/5/8 16:50 +% fmtcount.ins generated using makedtx version 0.94b 2017/6/15 19:28 \input docstrip \preamble fmtcount.dtx - Copyright 2015 Nicola Talbot and Vincent Belaïche + Copyright 2017 Nicola Talbot and Vincent Belaïche This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 -- cgit v1.2.3