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.sty64
1 files changed, 27 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty b/Master/texmf-dist/tex/latex/fmtcount/fmtcount.sty
index a918fb7a7d4..f42140e0eb4 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 2017 Nicola Talbot and Vincent Belaïche
+%% Copyright 2020 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
@@ -50,10 +50,11 @@
%%\end{definition}
%% Local Variables:
%% coding: utf-8
+%% compile-command: "make -C ../dist fmtcount.pdf"
%% End:
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fmtcount}[2017/12/24 v3.05]
+\ProvidesPackage{fmtcount}[2020/01/30 v3.06]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{etoolbox}
@@ -341,48 +342,26 @@ 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
}
-\newrobustcmd*{\@hexadecimal}[1]{%
- \@DT@padzeroestrue
- \@DT@loopN=\@vpt
- \@strctr=\@DT@loopN
- \whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by \@ne}%
- \@strctr=65536\relax
- \@DT@X=#1\relax
- \loop
- \@DT@modctr=\@DT@X
- \divide\@DT@modctr by \@strctr
- \ifthenelse{\boolean{@DT@padzeroes}
- \and \(\@DT@modctr=0\)
- \and \(\@DT@loopN>\c@padzeroesN\)}
- {}{\@@hexadecimal\@DT@modctr}%
- \ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi
- \multiply\@DT@modctr by \@strctr
- \advance\@DT@X by -\@DT@modctr
- \divide\@strctr by 16\relax
- \advance\@DT@loopN by \m@ne
- \ifnum\@strctr>\@ne
- \repeat
- \@@hexadecimal\@DT@X
-}
-\let\hexadecimalnum=\@hexadecimal
+\newrobustcmd*{\hexadecimalnum}{\@hexadecimalengine\@@hexadecimal}
\newcommand*{\@@Hexadecimal}[1]{%
\ifcase#10\or1\or2\or3\or4\or5\or6\or
7\or8\or9\or A\or B\or C\or D\or E\or F\fi
}
-\newrobustcmd*{\@Hexadecimal}[1]{%
+\newrobustcmd*{\HEXADecimalnum}{\@hexadecimalengine\@@Hexadecimal}
+\newcommand*{\@hexadecimalengine}[2]{%
\@DT@padzeroestrue
- \@DT@loopN=5\relax
+ \@DT@loopN=\@vpt
\@strctr=\@DT@loopN
\whiledo{\@strctr<\c@padzeroesN}{0\advance\@strctr by \@ne}%
\@strctr=65536\relax
- \@DT@X=#1\relax
+ \@DT@X=#2\relax
\loop
\@DT@modctr=\@DT@X
\divide\@DT@modctr by \@strctr
\ifthenelse{\boolean{@DT@padzeroes}
\and \(\@DT@modctr=0\)
- \and \(\@DT@loopN>\c@padzeroesN\)}%
- {}{\@@Hexadecimal\@DT@modctr}%
+ \and \(\@DT@loopN>\c@padzeroesN\)}
+ {}{#1\@DT@modctr}%
\ifnum\@DT@modctr=0\else\@DT@padzeroesfalse\fi
\multiply\@DT@modctr by \@strctr
\advance\@DT@X by -\@DT@modctr
@@ -390,10 +369,13 @@ italian}
\advance\@DT@loopN by \m@ne
\ifnum\@strctr>\@ne
\repeat
- \@@Hexadecimal\@DT@X
+ #1\@DT@X
}
-
-\let\Hexadecimalnum=\@Hexadecimal
+\def\Hexadecimalnum{%
+ \PackageWarning{fmtcount}{\string\Hexadecimalnum\space is deprecated, use \string\HEXADecimalnum\space
+ instead. The \string\Hexadecimalnum\space control sequence name is confusing as it can mislead in thinking
+ that only the 1st letter is upper-cased.}%
+ \HEXADecimalnum}
\newrobustcmd*{\@aaalph}{\fc@aaalph\@alph}
\newcommand*\fc@aaalph[2]{%
\@DT@loopN=#2\relax
@@ -979,13 +961,21 @@ italian}
\the\value{#1}}%
}
\providecommand*{\hexadecimal}[1]{%
- \@hexadecimal{\expandafter\expandafter\expandafter
+ \hexadecimalnum{\expandafter\expandafter\expandafter
\the\value{#1}}%
}
-\providecommand*{\Hexadecimal}[1]{%
- \@Hexadecimal{\expandafter\expandafter\expandafter
+\providecommand*{\HEXADecimal}[1]{%
+ \HEXADecimalnum{\expandafter\expandafter\expandafter
\the\value{#1}}%
}
+\newrobustcmd*\FC@Hexadecimal@warning{%
+ \PackageWarning{fmtcount}{\string\Hexadecimal\space is deprecated, use \string\HEXADecimal\space
+ instead. The \string\Hexadecimal\space control sequence name is confusing as it can mislead in thinking
+ that only the 1st letter is upper-cased.}%
+}
+\def\Hexadecimal{%
+ \FC@Hexadecimal@warning
+ \HEXADecimal}
\providecommand*{\octal}[1]{%
\@octal{\expandafter\expandafter\expandafter
\the\value{#1}}%