summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty')
-rw-r--r--Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty157
1 files changed, 90 insertions, 67 deletions
diff --git a/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty b/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
index 6d55bef08fc..e923c801f81 100644
--- a/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
+++ b/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
@@ -7,7 +7,7 @@
%% fmtcount.dtx (with options: `fmtcount.sty,package')
%%
%% 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
@@ -51,8 +51,9 @@
%% Local Variables:
%% coding: utf-8
%% End:
+
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fmtcount}[2015/05/05 v3.01]
+\ProvidesPackage{fmtcount}[2016/01/12 v3.02]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{etoolbox}
@@ -277,7 +278,7 @@ italian}
\newif\if@DT@padzeroes
\newcount\@DT@loopN
\newcount\@DT@X
-\newcommand*{\@binary}[1]{%
+\newrobustcmd*{\@binary}[1]{%
\@DT@padzeroestrue
\@DT@loopN=17\relax
\@strctr=\@DT@loopN
@@ -303,7 +304,7 @@ italian}
}
\let\binarynum=\@binary
-\newcommand*{\@octal}[1]{%
+\newrobustcmd*{\@octal}[1]{%
\ifnum#1>32768
\PackageError{fmtcount}%
{Value of counter too large for \protect\@octal}
@@ -337,7 +338,7 @@ italian}
\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]{%
+\newrobustcmd*{\@hexadecimal}[1]{%
\@DT@padzeroestrue
\@DT@loopN=5\relax
\@strctr=\@DT@loopN
@@ -365,7 +366,7 @@ italian}
\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]{%
+\newrobustcmd*{\@Hexadecimal}[1]{%
\@DT@padzeroestrue
\@DT@loopN=5\relax
\@strctr=\@DT@loopN
@@ -390,7 +391,7 @@ italian}
}
\let\Hexadecimalnum=\@Hexadecimal
-\newcommand*{\@aaalph}[1]{%
+\newrobustcmd*{\@aaalph}[1]{%
\@DT@loopN=#1\relax
\advance\@DT@loopN by -1\relax
\divide\@DT@loopN by 26\relax
@@ -409,7 +410,7 @@ italian}
}
\let\aaalphnum=\@aaalph
-\newcommand*{\@AAAlph}[1]{%
+\newrobustcmd*{\@AAAlph}[1]{%
\@DT@loopN=#1\relax
\advance\@DT@loopN by -1\relax
\divide\@DT@loopN by 26\relax
@@ -428,7 +429,7 @@ italian}
}
\let\AAAlphnum=\@AAAlph
-\newcommand*{\@abalph}[1]{%
+\newrobustcmd*{\@abalph}[1]{%
\ifnum#1>17576\relax
\PackageError{fmtcount}%
{Value of counter too large for \protect\@abalph}%
@@ -456,7 +457,7 @@ italian}
}
\let\abalphnum=\@abalph
-\newcommand*{\@ABAlph}[1]{%
+\newrobustcmd*{\@ABAlph}[1]{%
\ifnum#1>17576\relax
\PackageError{fmtcount}%
{Value of counter too large for \protect\@ABAlph}%
@@ -490,7 +491,7 @@ italian}
\@fmtc@count#2\relax
\fi
}
-\newcommand{\@decimal}[1]{%
+\newrobustcmd*{\@decimal}[1]{%
\@strctr=0\relax
\expandafter\@fmtc@count\number#1\relax
\@DT@loopN=\c@padzeroesN
@@ -504,8 +505,8 @@ italian}
\let\decimalnum=\@decimal
\newcommand{\FCordinal}[1]{%
- \expandafter\protect\expandafter\ordinalnum{%
- \expandafter\the\csname c@#1\endcsname}%
+ \ordinalnum{%
+ \the\value{#1}}%
}
\ifcsundef{ordinal}
{\let\ordinal\FCordinal}%
@@ -514,7 +515,7 @@ italian}
{\protect\ordinal \space already defined use
\protect\FCordinal \space instead.}
}
-\newcommand*{\ordinalnum}[1]{%
+\DeclareRobustCommand*{\ordinalnum}[1]{%
\new@ifnextchar[%
{\@ordinalnum{#1}}%
{\@ordinalnum{#1}[m]}%
@@ -545,10 +546,13 @@ italian}
}%
}
\newcommand*{\storeordinal}[2]{%
- \expandafter\protect\expandafter\storeordinalnum{#1}{%
- \expandafter\the\csname c@#2\endcsname}%
+ {%
+ \toks0{\storeordinalnum{#1}}%
+ \expandafter
+ }\the\toks0\expandafter{%
+ \the\value{#2}}%
}
-\newcommand*{\storeordinalnum}[2]{%
+\newrobustcmd*{\storeordinalnum}[2]{%
\@ifnextchar[%
{\@storeordinalnum{#1}{#2}}%
{\@storeordinalnum{#1}{#2}[m]}%
@@ -578,10 +582,10 @@ italian}
}
\newcommand*{\FMCuse}[1]{\csname @fcs@#1\endcsname}
\newcommand*{\ordinalstring}[1]{%
- \expandafter\protect\expandafter\ordinalstringnum{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\ordinalstringnum\expandafter{%
+ \the\value{#1}}%
}
-\newcommand{\ordinalstringnum}[1]{%
+\newrobustcmd*{\ordinalstringnum}[1]{%
\new@ifnextchar[%
{\@ordinal@string{#1}}%
{\@ordinal@string{#1}[m]}%
@@ -612,10 +616,12 @@ italian}
}%
}
\newcommand*{\storeordinalstring}[2]{%
- \expandafter\protect\expandafter\storeordinalstringnum{#1}{%
- \expandafter\the\csname c@#2\endcsname}%
+ {%
+ \toks0{\storeordinalstringnum{#1}}%
+ \expandafter
+ }\the\toks0\expandafter{\the\value{#2}}%
}
-\newcommand*{\storeordinalstringnum}[2]{%
+\newrobustcmd*{\storeordinalstringnum}[2]{%
\@ifnextchar[%
{\@store@ordinal@string{#1}{#2}}%
{\@store@ordinal@string{#1}{#2}[m]}%
@@ -644,10 +650,10 @@ italian}
\expandafter\let\csname @fcs@#1\endcsname\@fc@ordstr
}
\newcommand*{\Ordinalstring}[1]{%
- \expandafter\protect\expandafter\Ordinalstringnum{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\Ordinalstringnum\expandafter{%
+ \the\value{#1}}%
}
-\newcommand*{\Ordinalstringnum}[1]{%
+\newrobustcmd*{\Ordinalstringnum}[1]{%
\new@ifnextchar[%
{\@Ordinal@string{#1}}%
{\@Ordinal@string{#1}[m]}%
@@ -678,10 +684,12 @@ italian}
}%
}
\newcommand*{\storeOrdinalstring}[2]{%
- \expandafter\protect\expandafter\storeOrdinalstringnum{#1}{%
- \expandafter\the\csname c@#2\endcsname}%
+ {%
+ \toks0{\storeOrdinalstringnum{#1}}%
+ \expandafter
+ }\the\toks0\expandafter{\the\value{#2}}%
}
-\newcommand*{\storeOrdinalstringnum}[2]{%
+\newrobustcmd*{\storeOrdinalstringnum}[2]{%
\@ifnextchar[%
{\@store@Ordinal@string{#1}{#2}}%
{\@store@Ordinal@string{#1}{#2}[m]}%
@@ -710,10 +718,12 @@ italian}
\expandafter\let\csname @fcs@#1\endcsname\@fc@ordstr
}
\newcommand*{\storeORDINALstring}[2]{%
- \expandafter\protect\expandafter\storeORDINALstringnum{#1}{%
- \expandafter\the\csname c@#2\endcsname}%
+ {%
+ \toks0{\storeORDINALstringnum{#1}}%
+ \expandafter
+ }\the\toks0\expandafter{\the\value{#2}}%
}
-\newcommand*{\storeORDINALstringnum}[2]{%
+\newrobustcmd*{\storeORDINALstringnum}[2]{%
\@ifnextchar[%
{\@store@ORDINAL@string{#1}{#2}}%
{\@store@ORDINAL@string{#1}{#2}[m]}%
@@ -744,11 +754,11 @@ italian}
}%
}
\newcommand*{\ORDINALstring}[1]{%
- \expandafter\protect\expandafter\ORDINALstringnum{%
- \expandafter\the\csname c@#1\endcsname
+ \expandafter\ORDINALstringnum\expandafter{%
+ \the\value{#1}%
}%
}
-\newcommand*{\ORDINALstringnum}[1]{%
+\newrobustcmd*{\ORDINALstringnum}[1]{%
\new@ifnextchar[%
{\@ORDINAL@string{#1}}%
{\@ORDINAL@string{#1}[m]}%
@@ -780,7 +790,7 @@ italian}
}
\newcommand*{\storenumberstring}[2]{%
\expandafter\protect\expandafter\storenumberstringnum{#1}{%
- \expandafter\the\csname c@#2\endcsname}%
+ \expandafter\the\value{#2}}%
}
\newcommand{\storenumberstringnum}[2]{%
\@ifnextchar[%
@@ -811,10 +821,10 @@ italian}
\expandafter\let\csname @fcs@#1\endcsname\@fc@numstr
}
\newcommand*{\numberstring}[1]{%
- \expandafter\protect\expandafter\numberstringnum{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\numberstringnum\expandafter{%
+ \the\value{#1}}%
}
-\newcommand*{\numberstringnum}[1]{%
+\newrobustcmd*{\numberstringnum}[1]{%
\new@ifnextchar[%
{\@number@string{#1}}%
{\@number@string{#1}[m]}%
@@ -845,8 +855,10 @@ italian}
}%
}
\newcommand*{\storeNumberstring}[2]{%
- \expandafter\protect\expandafter\storeNumberstringnum{#1}{%
- \expandafter\the\csname c@#2\endcsname}%
+ {%
+ \toks0{\storeNumberstringnum{#1}}%
+ \expandafter
+ }\the\toks0\expandafter{\the\value{#2}}%
}
\newcommand{\storeNumberstringnum}[2]{%
\@ifnextchar[%
@@ -877,10 +889,10 @@ italian}
\expandafter\let\csname @fcs@#1\endcsname\@fc@numstr
}
\newcommand*{\Numberstring}[1]{%
- \expandafter\protect\expandafter\Numberstringnum{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\Numberstringnum\expandafter{%
+ \the\value{#1}}%
}
-\newcommand*{\Numberstringnum}[1]{%
+\newrobustcmd*{\Numberstringnum}[1]{%
\new@ifnextchar[%
{\@Number@string{#1}}%
{\@Number@string{#1}[m]}%
@@ -911,8 +923,10 @@ italian}
}%
}
\newcommand{\storeNUMBERstring}[2]{%
- \expandafter\protect\expandafter\storeNUMBERstringnum{#1}{%
- \expandafter\the\csname c@#2\endcsname}%
+ {%
+ \toks0{\storeNUMBERstringnum{#1}}%
+ \expandafter
+ }\the\toks0\expandafter{\the\value{#2}}%
}
\newcommand{\storeNUMBERstringnum}[2]{%
\@ifnextchar[%
@@ -945,10 +959,10 @@ italian}
}%
}
\newcommand*{\NUMBERstring}[1]{%
- \expandafter\protect\expandafter\NUMBERstringnum{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\NUMBERstringnum\expandafter{%
+ \the\value{#1}}%
}
-\newcommand*{\NUMBERstringnum}[1]{%
+\newrobustcmd*{\NUMBERstringnum}[1]{%
\new@ifnextchar[%
{\@NUMBER@string{#1}}%
{\@NUMBER@string{#1}[m]}%
@@ -979,40 +993,49 @@ italian}
}%
}
\providecommand*{\binary}[1]{%
- \expandafter\protect\expandafter\@binary{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@binary
+ \expandafter{%
+ \the\value{#1}}%
}
\providecommand*{\aaalph}[1]{%
- \expandafter\protect\expandafter\@aaalph{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@aaalph
+ \expandafter{%
+ \the\value{#1}}%
}
\providecommand*{\AAAlph}[1]{%
- \expandafter\protect\expandafter\@AAAlph{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@AAAlph
+ \expandafter{%
+ \the\value{#1}}%
}
\providecommand*{\abalph}[1]{%
- \expandafter\protect\expandafter\@abalph{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@abalph
+ \expandafter{%
+ \the\value{#1}}%
}
\providecommand*{\ABAlph}[1]{%
- \expandafter\protect\expandafter\@ABAlph{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@ABAlph
+ \expandafter{%
+ \the\value{#1}}%
}
\providecommand*{\hexadecimal}[1]{%
- \expandafter\protect\expandafter\@hexadecimal{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@hexadecimal
+ \expandafter{%
+ \the\value{#1}}%
}
\providecommand*{\Hexadecimal}[1]{%
- \expandafter\protect\expandafter\@Hexadecimal{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@Hexadecimal
+ \expandafter{%
+ \the\value{#1}}%
}
\providecommand*{\octal}[1]{%
- \expandafter\protect\expandafter\@octal{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@octal
+ \expandafter{%
+ \the\value{#1}}%
}
\providecommand*{\decimal}[1]{%
- \expandafter\protect\expandafter\@decimal{%
- \expandafter\the\csname c@#1\endcsname}%
+ \expandafter\@decimal
+ \expandafter{%
+ \the\value{#1}}%
}
\def\@setdef@ultfmtcount{%
\ifcsundef{@ordinalMenglish}{\FCloadlang{english}}{}%