diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/numspell/numspell-english.sty | 250 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/numspell/numspell-french.sty | 335 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/numspell/numspell-german.sty | 262 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/numspell/numspell-magyar.sty | 398 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/numspell/numspell.sty | 295 |
5 files changed, 1540 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-english.sty b/Master/texmf-dist/tex/latex/numspell/numspell-english.sty new file mode 100644 index 00000000000..2bf2f69bbf3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/numspell/numspell-english.sty @@ -0,0 +1,250 @@ +%% +%% `numspell-english.sty' English language package for 'numspell.sty' +%% +%% Copyright 2017- by Tibor Tomacs +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Tibor Tomacs. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{numspell-english}[2017/02/09 v1.0 English language package for numspell] + +%% ----------- +%% \numspellGB (Default) +%% ----------- +%% It changes to British English +%% +\def\numspellGB{% + \def\numspell@and@en{\numspell@{ and }}% + \def\numspell@and@@en{\numspell@{ and }}% +} +\numspellGB + +%% ----------- +%% \numspellUS +%% ----------- +%% It changes to American English +%% +\def\numspellUS{% + \def\numspell@and@en{\numspell@{ }}% + \def\numspell@and@@en{\numspell@{, }}% +} + +%% GROUP NAMES +\def\numspell@group@ii@en@name{\numspell@{thousand}} +\def\numspell@group@iii@en@name{\numspell@{million}} +\def\numspell@group@iv@en@name{\numspell@{billion}} +\def\numspell@group@v@en@name{\numspell@{trillion}} +\def\numspell@group@vi@en@name{\numspell@{quadrillion}} +\def\numspell@group@vii@en@name{\numspell@{quintillion}} +\def\numspell@group@viii@en@name{\numspell@{sextillion}} +\def\numspell@group@ix@en@name{\numspell@{septillion}} +\def\numspell@group@x@en@name{\numspell@{octillion}} +\def\numspell@group@xi@en@name{\numspell@{nonillion}} +\def\numspell@group@xii@en@name{\numspell@{decillion}} +\def\numspell@group@xiii@en@name{\numspell@{undecillion}} +\def\numspell@group@xiv@en@name{\numspell@{duodecillion}} +\def\numspell@group@xv@en@name{\numspell@{tredecillion}} +\def\numspell@group@xvi@en@name{\numspell@{quattuordecillion}} +\def\numspell@group@xvii@en@name{\numspell@{quindecillion}} +\def\numspell@group@xviii@en@name{\numspell@{sexdecillion}} +\def\numspell@group@xix@en@name{\numspell@{septendecillion}} +\def\numspell@group@xx@en@name{\numspell@{octodecillion}} +\def\numspell@group@xxi@en@name{\numspell@{novemdecillion}} +\def\numspell@group@xxii@en@name{\numspell@{vigintillion}} + +%% SPELLING CARDINAL NUMBER GROUP +%% --------------------------------- +%% \numspell@group@spell@en{<group>} (<group>=000,001,...,999) +%% --------------------------------- +%% \numspell@group@digits{<group>} +%% Adding the <group> spelling to \thenumspell +%% +\def\numspell@group@spell@en#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\numspell@{one}\or\numspell@{two}\or\numspell@{three}\or\numspell@{four}\or\numspell@{five}% + \or\numspell@{six}\or\numspell@{seven}\or\numspell@{eight}\or\numspell@{nine}% + \fi% + \ifnum\numspell@group@digit@i>0% + \numspell@{ hundred}% + \fi% + \ifnum\number\numexpr\numspell@group@digit@i*(\numspell@group@digit@ii+\numspell@group@digit@iii)>0% + \numspell@and@en% + \fi% + \ifcase\numspell@group@digit@ii% + \or\or\numspell@{twenty}\or\numspell@{thirty}\or\numspell@{forty}\or\numspell@{fifty}\or\numspell@{sixty}% + \or\numspell@{seventy}\or\numspell@{eighty}\or\numspell@{ninety}% + \fi% + \ifnum\numspell@group@digit@ii>1% + \ifcase\numspell@group@digit@iii% + \or\numspell@dash@\numspell@{one}\or\numspell@dash@\numspell@{two}\or\numspell@dash@\numspell@{three}% + \or\numspell@dash@\numspell@{four}\or\numspell@dash@\numspell@{five}\or\numspell@dash@\numspell@{six}% + \or\numspell@dash@\numspell@{seven}\or\numspell@dash@\numspell@{eight}\or\numspell@dash@\numspell@{nine}% + \fi% + \fi% + \ifnum\numspell@group@digit@ii<2% + \ifcase\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii% + \or\numspell@{one}\or\numspell@{two}\or\numspell@{three}\or\numspell@{four}\or\numspell@{five}\or\numspell@{six}% + \or\numspell@{seven}\or\numspell@{eight}\or\numspell@{nine}\or\numspell@{ten}\or\numspell@{eleven}\or\numspell@{twelve}% + \or\numspell@{thirteen}\or\numspell@{fourteen}\or\numspell@{fifteen}\or\numspell@{sixteen}\or\numspell@{seventeen}% + \or\numspell@{eighteen}\or\numspell@{nineteen}% + \fi% + \fi% +} + +%% SPELLING ORDINAL NUMBER GROUP +%% ------------------------------------ +%% \numspell@ordgroup@spell@en{<group>} (<group>=000,001,...,999) +%% ------------------------------------ +%% \numspell@group@digits{<group>} +%% Adding the <group> ordinal spelling to \thenumspell +%% +\def\numspell@ordgroup@spell@en#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\numspell@{one}\or\numspell@{two}\or\numspell@{three}\or\numspell@{four}\or\numspell@{five}% + \or\numspell@{six}\or\numspell@{seven}\or\numspell@{eight}\or\numspell@{nine}% + \fi% + \ifnum\numspell@group@digit@i>0% + \ifnum\number\numexpr\numspell@group@digit@i*(\numspell@group@digit@ii+\numspell@group@digit@iii)>0% + \numspell@{ hundred}% + \else% + \numspell@{ hundredth}% + \fi% + \fi% + \ifnum\number\numexpr\numspell@group@digit@i*(\numspell@group@digit@ii+\numspell@group@digit@iii)>0% + \numspell@and@en% + \fi% + \ifnum\numspell@group@digit@iii>0% + \ifcase\numspell@group@digit@ii% + \or\or\numspell@{twenty}\or\numspell@{thirty}\or\numspell@{forty}\or\numspell@{fifty}\or\numspell@{sixty}% + \or\numspell@{seventy}\or\numspell@{eighty}\or\numspell@{ninety}% + \fi% + \else% + \ifcase\numspell@group@digit@ii% + \or\or\numspell@{twentieth}\or\numspell@{thirtieth}\or\numspell@{fortieth}\or\numspell@{fiftieth}% + \or\numspell@{sixtieth}\or\numspell@{seventieth}\or\numspell@{eightieth}\or\numspell@{ninetieth}% + \fi% + \fi% + \ifnum\numspell@group@digit@ii>1% + \ifcase\numspell@group@digit@iii% + \or\numspell@dash@\numspell@{first}\or\numspell@dash@\numspell@{second}\or\numspell@dash@\numspell@{third}% + \or\numspell@dash@\numspell@{fourth}\or\numspell@dash@\numspell@{fifth}\or\numspell@dash@\numspell@{sixth}% + \or\numspell@dash@\numspell@{seventh}\or\numspell@dash@\numspell@{eighth}\or\numspell@dash@\numspell@{ninth}% + \fi% + \fi% + \ifnum\numspell@group@digit@ii<2% + \ifcase\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii% + \or\numspell@{first}\or\numspell@{second}\or\numspell@{third}\or\numspell@{fourth}\or\numspell@{fifth}% + \or\numspell@{sixth}\or\numspell@{seventh}\or\numspell@{eighth}\or\numspell@{ninth}\or\numspell@{tenth}% + \or\numspell@{eleventh}\or\numspell@{twelfth}\or\numspell@{thirteenth}\or\numspell@{fourteenth}% + \or\numspell@{fifteenth}\or\numspell@{sixteenth}\or\numspell@{seventeenth}\or\numspell@{eighteenth}\or\numspell@{nineteenth}% + \fi% + \fi% +} + +%% SPELLING CARDINAL NUMBER +%% -------------------------------------- +%% \numspell@num@spell@en{<num1>}{<num2>} +%% -------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num spelling to \thenumspell +%% +\def\numspell@num@spell@en#1#2{% + \gdef\thenumspell{}% + \numspell@groups{#1}{#2}% + \setcounter{numspell@groupcount}{22}% + \@whilenum\value{numspell@groupcount}>2% + \do{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{0}{}{% + \numspell@group@spell@en{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \numspell@{ }% + \csname numspell@group@\roman{numspell@groupcount}@en@name\endcsname% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname>1\numspell@{, }\fi% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname=1\numspell@and@@en\fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \numspell@group@spell@en{\numspell@group@ii}% + \numspell@{ }% + \numspell@group@ii@en@name% + \ifnum\numspell@group@ii@before=1\numspell@and@@en\fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \numspell@group@spell@en{\numspell@group@i}% + }% + \ifnum\numspell@group@max=0\numspell@{nought}\fi% +} + +%% SPELLING ORDINAL NUMBER +%% ----------------------------------------- +%% \numspell@ordnum@spell@en{<num1>}{<num2>} +%% ----------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num ordinal spelling to \thenumspell +%% +\def\numspell@ordnum@spell@en#1#2{% + \gdef\thenumspell{}% + \numspell@groups{#1}{#2}% + \setcounter{numspell@groupcount}{22}% + \@whilenum\value{numspell@groupcount}>2% + \do{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{0}{}{% + \numspell@group@spell@en{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \numspell@{ }% + \csname numspell@group@\roman{numspell@groupcount}@en@name\endcsname% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname>1\numspell@{, }\fi% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname=1\numspell@and@@en\fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \numspell@group@spell@en{\numspell@group@ii}% + \numspell@{ }% + \numspell@group@ii@en@name% + \ifnum\numspell@group@ii@before=1\numspell@and@@en\fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \numspell@ordgroup@spell@en{\numspell@group@i}% + }% + \IfEq{\numspell@group@i}{0}{\ifnum\numspell@group@max>0\numspell@{th}\fi}{}% + \ifnum\numspell@group@max=0\numspell@{zeroth}\fi% +} + +%% ---------------------- +%% \numspell@uppercase@en +%% ---------------------- +%% E.g. \def\thenumspell{one}\numspell@uppercase\thenumspell --> 'One' +%% \MakeUppercase does not work on pdf bookmark (see hyperref), so using another effective macro. +%% +\def\numspell@uppercase@en{% + \fullexpandarg% + \StrChar{\thenumspell}{1}[\numspell@firstletter]% + \expandarg% + \StrGobbleLeft{\thenumspell}{1}[\numspell@trunc]% + \fullexpandarg% + \def\numspell@the{}% + \IfStrEq{\numspell@firstletter}{o}{\g@addto@macro\numspell@the{O}}{}% one + \IfStrEq{\numspell@firstletter}{t}{\g@addto@macro\numspell@the{T}}{}% two + \IfStrEq{\numspell@firstletter}{f}{\g@addto@macro\numspell@the{F}}{}% four + \IfStrEq{\numspell@firstletter}{s}{\g@addto@macro\numspell@the{S}}{}% six + \IfStrEq{\numspell@firstletter}{e}{\g@addto@macro\numspell@the{E}}{}% eight + \IfStrEq{\numspell@firstletter}{n}{\g@addto@macro\numspell@the{N}}{}% nine + \IfStrEq{\numspell@firstletter}{z}{\g@addto@macro\numspell@the{Z}}{}% zero + \ifx\numspell@the\@empty\@latexerr{'numspell.sty' error! There is not '\numspell@firstletter' in uppercase!}{}\fi% + \g@addto@macro\numspell@the{\numspell@trunc}% + \def\thenumspell{\numspell@the}% +} + +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-french.sty b/Master/texmf-dist/tex/latex/numspell/numspell-french.sty new file mode 100644 index 00000000000..00426043bf5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/numspell/numspell-french.sty @@ -0,0 +1,335 @@ +%% +%% `numspell-french.sty' French language package for 'numspell.sty' +%% +%% Copyright 2017- by Tibor Tomacs +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Tibor Tomacs. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{numspell-french}[2017/02/09 v1.0 French language package for numspell] + +%% For 'cent' or 'cents' +\newif\if@numspell@fr@firstgroup@ + +%% 'premier' or 'premiere' +\def\numspellpremier{\def\numspell@fr@premier{\numspell@{premier}}} +\def\numspellpremiere{\def\numspell@fr@premier{\numspell@{premi\`{e}re}}} +\numspellpremier + +%% GROUP NAMES +\def\numspell@group@ii@fr@name{\numspell@{mille}} +\def\numspell@group@iii@fr@name{\numspell@{million}} +\def\numspell@group@iv@fr@name{\numspell@{milliard}} +\def\numspell@group@v@fr@name{\numspell@{billion}} +\def\numspell@group@vi@fr@name{\numspell@{billiard}} +\def\numspell@group@vii@fr@name{\numspell@{trillion}} +\def\numspell@group@viii@fr@name{\numspell@{trilliard}} +\def\numspell@group@ix@fr@name{\numspell@{quadrillion}} +\def\numspell@group@x@fr@name{\numspell@{quadrilliard}} +\def\numspell@group@xi@fr@name{\numspell@{quintilion}} +\def\numspell@group@xii@fr@name{\numspell@{quintilliard}} +\def\numspell@group@xiii@fr@name{\numspell@{sextillion}} +\def\numspell@group@xiv@fr@name{\numspell@{sextilliard}} +\def\numspell@group@xv@fr@name{\numspell@{septillion}} +\def\numspell@group@xvi@fr@name{\numspell@{septilliard}} +\def\numspell@group@xvii@fr@name{\numspell@{octillion}} +\def\numspell@group@xviii@fr@name{\numspell@{octilliard}} +\def\numspell@group@xix@fr@name{\numspell@{nonillion}} +\def\numspell@group@xx@fr@name{\numspell@{nonilliard}} +\def\numspell@group@xxi@fr@name{\numspell@{d\'{e}cillion}} +\def\numspell@group@xxii@fr@name{\numspell@{d\'{e}cilliard}} + +%% SPELLING CARDINAL NUMBER GROUP +%% --------------------------------- +%% \numspell@group@spell@fr{<group>} (<group>=000,001,...,999) +%% --------------------------------- +%% \numspell@group@digits{<group>} +%% Adding the <group> spelling to \thenumspell +%% +\def\numspell@group@spell@fr#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\or\numspell@{deux }\or\numspell@{trois }\or\numspell@{quatre }\or\numspell@{cinq }% + \or\numspell@{six }\or\numspell@{sept }\or\numspell@{huit }\or\numspell@{neuf }% + \fi% + \ifnum\numspell@group@digit@i>0% + \numspell@{cent}% + \if@numspell@fr@firstgroup@% + \ifnum\number\numexpr\numspell@group@digit@ii+\numspell@group@digit@iii=0% + \ifnum\numspell@group@digit@i>1% + \numspell@{s}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr\numspell@group@digit@ii+\numspell@group@digit@iii>0% + \numspell@{ }% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii=1% + \numspell@{un}% + \fi% + \fi% + \ifcase\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii% + \or\or\numspell@{deux}\or\numspell@{trois}\or\numspell@{quatre}\or\numspell@{cinq}% + \or\numspell@{six}\or\numspell@{sept}\or\numspell@{huit}\or\numspell@{neuf}% + \or\numspell@{dix}\or\numspell@{onze}\or\numspell@{douze}\or\numspell@{treize}% + \or\numspell@{quatorze}\or\numspell@{quinze}\or\numspell@{seize}\or\numspell@{dix}\numspell@dash@\numspell@{sept}% + \or\numspell@{dix}\numspell@dash@\numspell@{huit}\or\numspell@{dix}\numspell@dash@\numspell@{neuf}% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>19% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii<70% + \ifcase\numspell@group@digit@ii% + \or\or\numspell@{vingt}\or\numspell@{trente}\or\numspell@{quarante}\or\numspell@{cinquante}\or\numspell@{soixante}% + \fi% + \ifcase\numspell@group@digit@iii% + \or\numspell@{ et un}\or\numspell@dash@\numspell@{deux}\or\numspell@dash@\numspell@{trois}% + \or\numspell@dash@\numspell@{quatre}\or\numspell@dash@\numspell@{cinq}\or\numspell@dash@\numspell@{six}% + \or\numspell@dash@\numspell@{sept}\or\numspell@dash@\numspell@{huit}\or\numspell@dash@\numspell@{neuf}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>69% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii<80% + \numspell@{soixante}% + \ifcase\numspell@group@digit@iii% + \numspell@dash@\numspell@{dix}\or\numspell@{ et onze}\or\numspell@dash@\numspell@{douze}\or\numspell@dash@\numspell@{treize}% + \or\numspell@dash@\numspell@{quatorze}\or\numspell@dash@\numspell@{quinze}\or\numspell@dash@\numspell@{seize}% + \or\numspell@dash@\numspell@{dix}\numspell@dash@\numspell@{sept}\or\numspell@dash@\numspell@{dix}\numspell@dash@\numspell@{huit}% + \or\numspell@dash@\numspell@{dix}\numspell@dash@\numspell@{neuf}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>79% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii<90% + \numspell@{quatre}\numspell@dash@\numspell@{vingt}% + \ifcase\numspell@group@digit@iii% + \numspell@{s}\or\numspell@dash@\numspell@{un}\or\numspell@dash@\numspell@{deux}\or\numspell@dash@\numspell@{trois}% + \or\numspell@dash@\numspell@{quatre}\or\numspell@dash@\numspell@{cinq}\or\numspell@dash@\numspell@{six}% + \or\numspell@dash@\numspell@{sept}\or\numspell@dash@\numspell@{huit}\or\numspell@dash@\numspell@{neuf}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>89% + \numspell@{quatre}\numspell@dash@\numspell@{vingt}\numspell@dash@% + \ifcase\numspell@group@digit@iii% + \numspell@{dix}\or\numspell@{onze}\or\numspell@{douze}\or\numspell@{treize}% + \or\numspell@{quatorze}\or\numspell@{quinze}\or\numspell@{seize}% + \or\numspell@{dix}\numspell@dash@\numspell@{sept}\or\numspell@{dix}\numspell@dash@\numspell@{huit}% + \or\numspell@{dix}\numspell@dash@\numspell@{neuf}% + \fi% + \fi% +} + +%% SPELLING ORDINAL NUMBER GROUP +%% ------------------------------------ +%% \numspell@ordgroup@spell@fr{<group>} (<group>=000,001,...,999) +%% ------------------------------------ +%% \numspell@group@digits{<group>} +%% Adding the <group> ordinal spelling to \thenumspell +%% +\def\numspell@ordgroup@spell@fr#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\or\numspell@{deux }\or\numspell@{trois }\or\numspell@{quatre }\or\numspell@{cinq }% + \or\numspell@{six }\or\numspell@{sept }\or\numspell@{huit }\or\numspell@{neuf }% + \fi% + \ifnum\numspell@group@digit@i>0% + \numspell@{cent}% + \ifnum\number\numexpr\numspell@group@digit@ii+\numspell@group@digit@iii=0% + \numspell@{i\`{e}me}% + \else% + \numspell@{ }% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii=1% + \numspell@{uni\`{e}me}% + \fi% + \fi% + \ifcase\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii% + \or\or\numspell@{deuxi\`{e}me}\or\numspell@{troisi\`{e}me}\or\numspell@{quatri\`{e}me}\or\numspell@{cinqui\`{e}me}% + \or\numspell@{sixi\`{e}me}\or\numspell@{septi\`{e}me}\or\numspell@{huiti\`{e}me}\or\numspell@{neuvi\`{e}me}% + \or\numspell@{dixi\`{e}me}\or\numspell@{onzi\`{e}me}\or\numspell@{douzi\`{e}me}\or\numspell@{treizi\`{e}me}% + \or\numspell@{quatorzi\`{e}me}\or\numspell@{quinzi\`{e}me}\or\numspell@{seizi\`{e}me}% + \or\numspell@{dix}\numspell@dash@\numspell@{septi\`{e}me}\or\numspell@{dix}\numspell@dash@\numspell@{huiti\`{e}me}% + \or\numspell@{dix}\numspell@dash@\numspell@{neuvi\`{e}me}% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>19% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii<70% + \ifnum\numspell@group@digit@iii=0% + \ifcase\numspell@group@digit@ii% + \or\or\numspell@{vingti\`{e}me}\or\numspell@{trenti\`{e}me}\or\numspell@{quaranti\`{e}me}% + \or\numspell@{cinquanti\`{e}me}\or\numspell@{soixanti\`{e}me}% + \fi% + \else% + \ifcase\numspell@group@digit@ii% + \or\or\numspell@{vingt}\or\numspell@{trente}\or\numspell@{quarante}\or\numspell@{cinquante}\or\numspell@{soixante}% + \fi% + \fi% + \ifcase\numspell@group@digit@iii% + \or\numspell@{ et uni\`{e}me}\or\numspell@dash@\numspell@{deuxi\`{e}me}\or\numspell@dash@\numspell@{troisi\`{e}me}% + \or\numspell@dash@\numspell@{quatri\`{e}me}\or\numspell@dash@\numspell@{cinqui\`{e}me}\or\numspell@dash@\numspell@{sixi\`{e}me}% + \or\numspell@dash@\numspell@{septi\`{e}me}\or\numspell@dash@\numspell@{huiti\`{e}me}\or\numspell@dash@\numspell@{neuvi\`{e}me}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>69% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii<80% + \numspell@{soixante}% + \ifcase\numspell@group@digit@iii% + \numspell@dash@\numspell@{dixi\`{e}me}\or\numspell@{ et onzi\`{e}me}\or\numspell@dash@\numspell@{douzi\`{e}me}\or\numspell@dash@\numspell@{treizi\`{e}me}% + \or\numspell@dash@\numspell@{quatorzi\`{e}me}\or\numspell@dash@\numspell@{quinzi\`{e}me}% + \or\numspell@dash@\numspell@{seizi\`{e}me}\or\numspell@dash@\numspell@{dix}\numspell@dash@\numspell@{septi\`{e}me}% + \or\numspell@dash@\numspell@{dix}\numspell@dash@\numspell@{huiti\`{e}me}% + \or\numspell@dash@\numspell@{dix}\numspell@dash@\numspell@{neuvi\`{e}me}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>79% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii<90% + \numspell@{quatre}\numspell@dash@\numspell@{vingt}% + \ifcase\numspell@group@digit@iii% + \numspell@{i\`{e}me}\or\numspell@dash@\numspell@{uni\`{e}me}\or\numspell@dash@\numspell@{deuxi\`{e}me}% + \or\numspell@dash@\numspell@{troisi\`{e}me}% + \or\numspell@dash@\numspell@{quatri\`{e}me}\or\numspell@dash@\numspell@{cinqui\`{e}me}\or\numspell@dash@\numspell@{sixi\`{e}me}% + \or\numspell@dash@\numspell@{septi\`{e}me}\or\numspell@dash@\numspell@{huiti\`{e}me}\or\numspell@dash@\numspell@{neuvi\`{e}me}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>89% + \numspell@{quatre}\numspell@dash@\numspell@{vingt}\numspell@dash@% + \ifcase\numspell@group@digit@iii% + \numspell@{dixi\`{e}me}\or\numspell@{onzi\`{e}me}\or\numspell@{douzi\`{e}me}\or\numspell@{treizi\`{e}me}% + \or\numspell@{quatorzi\`{e}me}\or\numspell@{quinzi\`{e}me}\or\numspell@{seizi\`{e}me}% + \or\numspell@{dix}\numspell@dash@\numspell@{septi\`{e}me}\or\numspell@{dix}\numspell@dash@\numspell@{huiti\`{e}me}% + \or\numspell@{dix}\numspell@dash@\numspell@{neuvi\`{e}me}% + \fi% + \fi% +} + +%% SPELLING CARDINAL NUMBER +%% -------------------------------------- +%% \numspell@num@spell@fr{<num1>}{<num2>} +%% -------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num spelling to \thenumspell +%% +\def\numspell@num@spell@fr#1#2{% + \gdef\thenumspell{}% + \@numspell@fr@firstgroup@false% + \numspell@groups{#1}{#2}% + \setcounter{numspell@groupcount}{22}% + \@whilenum\value{numspell@groupcount}>2% + \do{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{0}{}{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{\numspell@{un}}{}% + \numspell@group@spell@fr{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \numspell@{ }% + \csname numspell@group@\roman{numspell@groupcount}@fr@name\endcsname% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{}{\numspell@{s}}% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname>0\numspell@{ }\fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \IfEq{\numspell@group@ii}{1}{\numspell@group@ii@fr@name}{% + \numspell@group@spell@fr{\numspell@group@ii}% + \numspell@{ }% + \numspell@group@ii@fr@name% + }% + \ifnum\numspell@group@ii@before>0\numspell@{ }\fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \@numspell@fr@firstgroup@true% + \IfEq{\numspell@group@i}{1}{\numspell@{un}}{}% + \numspell@group@spell@fr{\numspell@group@i}% + }% + \ifnum\numspell@group@max=0\numspell@{z\'{e}ro}\fi% +} + +%% SPELLING ORDINAL NUMBER +%% ----------------------------------------- +%% \numspell@ordnum@spell@fr{<num1>}{<num2>} +%% ----------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num ordinal spelling to \thenumspell +%% +\def\numspell@ordnum@spell@fr#1#2{% + \gdef\thenumspell{}% + \numspell@groups{#1}{#2}% + \setcounter{numspell@groupcount}{22}% + \@whilenum\value{numspell@groupcount}>2% + \do{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{0}{}{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{\numspell@{un}}{}% + \numspell@group@spell@fr{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \numspell@{ }% + \csname numspell@group@\roman{numspell@groupcount}@fr@name\endcsname% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname>0% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{\numspell@{ }}{\numspell@{s }}% + \else% + \numspell@{i\`{e}me}% + \fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \numspell@group@spell@fr{\numspell@group@ii}% + \IfEq{\numspell@group@ii}{1}{}{\numspell@{ }}% + \ifnum\numspell@group@ii@before>0% + \numspell@{mille }% + \else% + \numspell@{milli\`{e}me}% + \fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \numspell@ordgroup@spell@fr{\numspell@group@i}% + \IfEq{\numspell@group@i}{1}{% + \ifnum\numspell@group@max=1% + \numspell@fr@premier% + \else% + \numspell@{uni\`{e}me}% + \fi% + }{}% + }% + \ifnum\numspell@group@max=0\numspell@{z\'{e}roi\`{e}me}\fi% +} + +%% ---------------------- +%% \numspell@uppercase@fr +%% ---------------------- +%% E.g. \def\thenumspell{un}\numspell@uppercase\thenumspell --> 'Un' +%% \MakeUppercase does not work on pdf bookmark (see hyperref), so using another effective macro. +%% +\def\numspell@uppercase@fr{% + \fullexpandarg% + \StrChar{\thenumspell}{1}[\numspell@firstletter]% + \expandarg% + \StrGobbleLeft{\thenumspell}{1}[\numspell@trunc]% + \fullexpandarg% + \def\numspell@the{}% + \IfStrEq{\numspell@firstletter}{z}{\g@addto@macro\numspell@the{Z}}{}% z\'{e}ro + \IfStrEq{\numspell@firstletter}{u}{\g@addto@macro\numspell@the{U}}{}% un + \IfStrEq{\numspell@firstletter}{p}{\g@addto@macro\numspell@the{P}}{}% premier + \IfStrEq{\numspell@firstletter}{d}{\g@addto@macro\numspell@the{D}}{}% deux + \IfStrEq{\numspell@firstletter}{t}{\g@addto@macro\numspell@the{T}}{}% trois + \IfStrEq{\numspell@firstletter}{q}{\g@addto@macro\numspell@the{Q}}{}% quatre + \IfStrEq{\numspell@firstletter}{c}{\g@addto@macro\numspell@the{C}}{}% cinq + \IfStrEq{\numspell@firstletter}{s}{\g@addto@macro\numspell@the{S}}{}% six + \IfStrEq{\numspell@firstletter}{h}{\g@addto@macro\numspell@the{H}}{}% huit + \IfStrEq{\numspell@firstletter}{n}{\g@addto@macro\numspell@the{N}}{}% neuf + \IfStrEq{\numspell@firstletter}{v}{\g@addto@macro\numspell@the{V}}{}% vingt + \IfStrEq{\numspell@firstletter}{m}{\g@addto@macro\numspell@the{M}}{}% mille + \ifx\numspell@the\@empty\@latexerr{'numspell.sty' error! There is not '\numspell@firstletter' in uppercase!}{}\fi% + \g@addto@macro\numspell@the{\numspell@trunc}% + \def\thenumspell{\numspell@the}% +} + +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-german.sty b/Master/texmf-dist/tex/latex/numspell/numspell-german.sty new file mode 100644 index 00000000000..bd100313f88 --- /dev/null +++ b/Master/texmf-dist/tex/latex/numspell/numspell-german.sty @@ -0,0 +1,262 @@ +%% +%% `numspell-german.sty' German language package for 'numspell.sty' +%% +%% Copyright 2017- by Tibor Tomacs +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Tibor Tomacs. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{numspell-german}[2017/02/09 v1.0 German language package for numspell] + +%% GROUP NAMES +\def\numspell@group@ii@de@name{\numspell@{tausend}} +\def\numspell@group@iii@de@name{\numspell@{Million}} +\def\numspell@group@iv@de@name{\numspell@{Milliarde}} +\def\numspell@group@v@de@name{\numspell@{Billion}} +\def\numspell@group@vi@de@name{\numspell@{Billiarde}} +\def\numspell@group@vii@de@name{\numspell@{Trillion}} +\def\numspell@group@viii@de@name{\numspell@{Trilliarde}} +\def\numspell@group@ix@de@name{\numspell@{Quadrillion}} +\def\numspell@group@x@de@name{\numspell@{Quadrilliarde}} +\def\numspell@group@xi@de@name{\numspell@{Quintillion}} +\def\numspell@group@xii@de@name{\numspell@{Quintilliarde}} +\def\numspell@group@xiii@de@name{\numspell@{Sextillion}} +\def\numspell@group@xiv@de@name{\numspell@{Sextilliarde}} +\def\numspell@group@xv@de@name{\numspell@{Septillion}} +\def\numspell@group@xvi@de@name{\numspell@{Septilliarde}} +\def\numspell@group@xvii@de@name{\numspell@{Oktillion}} +\def\numspell@group@xviii@de@name{\numspell@{Oktilliarde}} +\def\numspell@group@xix@de@name{\numspell@{Nonillion}} +\def\numspell@group@xx@de@name{\numspell@{Nonilliarde}} +\def\numspell@group@xxi@de@name{\numspell@{Dezillion}} +\def\numspell@group@xxii@de@name{\numspell@{Dezilliarde}} + +%% ORDINAL GROUP NAMES +\def\numspell@ordgroup@iii@de@name{\numspell@{millionste}} +\def\numspell@ordgroup@iv@de@name{\numspell@{milliardste}} +\def\numspell@ordgroup@v@de@name{\numspell@{billionste}} +\def\numspell@ordgroup@vi@de@name{\numspell@{billiardste}} +\def\numspell@ordgroup@vii@de@name{\numspell@{trillionste}} +\def\numspell@ordgroup@viii@de@name{\numspell@{trilliardste}} +\def\numspell@ordgroup@ix@de@name{\numspell@{quadrillionste}} +\def\numspell@ordgroup@x@de@name{\numspell@{quadrilliardste}} +\def\numspell@ordgroup@xi@de@name{\numspell@{quintillionste}} +\def\numspell@ordgroup@xii@de@name{\numspell@{quintilliardste}} +\def\numspell@ordgroup@xiii@de@name{\numspell@{sextillionste}} +\def\numspell@ordgroup@xiv@de@name{\numspell@{sextilliardste}} +\def\numspell@ordgroup@xv@de@name{\numspell@{septillionste}} +\def\numspell@ordgroup@xvi@de@name{\numspell@{septilliardste}} +\def\numspell@ordgroup@xvii@de@name{\numspell@{oktillionste}} +\def\numspell@ordgroup@xviii@de@name{\numspell@{oktilliardste}} +\def\numspell@ordgroup@xix@de@name{\numspell@{nonillionste}} +\def\numspell@ordgroup@xx@de@name{\numspell@{nonilliardste}} +\def\numspell@ordgroup@xxi@de@name{\numspell@{dezillionste}} +\def\numspell@ordgroup@xxii@de@name{\numspell@{dezilliardste}} + +%% SPELLING CARDINAL NUMBER GROUP +%% --------------------------------- +%% \numspell@group@spell@de{<group>} (<group>=000,001,...,999) +%% --------------------------------- +%% \numspell@group@digits{<group>} +%% Adding the <group> spelling to \thenumspell +%% +\def\numspell@group@spell@de#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\numspell@{ein}\or\numspell@{zwei}\or\numspell@{drei}\or\numspell@{vier}\or\numspell@{f\"{u}nf}% + \or\numspell@{sechs}\or\numspell@{sieben}\or\numspell@{acht}\or\numspell@{neun}% + \fi% + \ifnum\numspell@group@digit@i>0% + \numspell@{hundert}% + \fi% + \ifnum\number\numexpr100*\numspell@group@digit@i+10*\numspell@group@digit@ii+\numspell@group@digit@iii>1% + \ifcase\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii% + \or\numspell@{eins}\or\numspell@{zwei}\or\numspell@{drei}\or\numspell@{vier}\or\numspell@{f\"{u}nf}% + \or\numspell@{sechs}\or\numspell@{sieben}\or\numspell@{acht}\or\numspell@{neun}% + \or\numspell@{zehn}\or\numspell@{elf}\or\numspell@{zw\"{o}lf}\or\numspell@{dreizehn}% + \or\numspell@{vierzehn}\or\numspell@{f\"{u}nfzehn}\or\numspell@{sechzehn}\or\numspell@{siebzehn}% + \or\numspell@{achtzehn}\or\numspell@{neunzehn}% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>19% + \ifcase\numspell@group@digit@iii% + \or\numspell@{ein}\or\numspell@{zwei}\or\numspell@{drei}\or\numspell@{vier}\or\numspell@{f\"{u}nf}% + \or\numspell@{sechs}\or\numspell@{sieben}\or\numspell@{acht}\or\numspell@{neun}% + \fi% + \fi% + \ifnum\number\numexpr\numspell@group@digit@ii*\numspell@group@digit@iii>0% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>20% + \numspell@{und}% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>19% + \ifcase\numspell@group@digit@ii% + \or\or\numspell@{zwanzig}\or\numspell@{drei\ss{}ig}\or\numspell@{vierzig}\or\numspell@{f\"{u}nfzig}% + \or\numspell@{sechzig}\or\numspell@{siebzig}\or\numspell@{achtzig}\or\numspell@{neunzig}% + \fi% + \fi% +} + +%% SPELLING ORDINAL NUMBER GROUP +%% ------------------------------------ +%% \numspell@ordgroup@spell@de{<group>} (<group>=000,001,...,999) +%% ------------------------------------ +%% \numspell@group@digits{<group>} +%% Adding the <group> ordinal spelling to \thenumspell +%% +\def\numspell@ordgroup@spell@de#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\numspell@{ein}\or\numspell@{zwei}\or\numspell@{drei}\or\numspell@{vier}\or\numspell@{f\"{u}nf}% + \or\numspell@{sechs}\or\numspell@{sieben}\or\numspell@{acht}\or\numspell@{neun}% + \fi% + \ifnum\numspell@group@digit@i>0% + \ifnum\number\numexpr\numspell@group@digit@ii+\numspell@group@digit@iii=0% + \numspell@{hundertste}% + \else% + \numspell@{hundert}% + \fi% + \fi% + \ifnum\number\numexpr100*\numspell@group@digit@i+10*\numspell@group@digit@ii+\numspell@group@digit@iii>1% + \ifcase\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii% + \or\numspell@{erste}\or\numspell@{zweite}\or\numspell@{dritte}\or\numspell@{vierte}\or\numspell@{f\"{u}nfte}% + \or\numspell@{sechste}\or\numspell@{siebte}\or\numspell@{achte}\or\numspell@{neunte}% + \or\numspell@{zehnte}\or\numspell@{elfte}\or\numspell@{zw\"{o}lfte}\or\numspell@{dreizehnte}% + \or\numspell@{vierzehnte}\or\numspell@{f\"{u}nfzehnte}\or\numspell@{sechzehnte}\or\numspell@{siebzehnte}% + \or\numspell@{achtzehnte}\or\numspell@{neunzehnte}% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>19% + \ifcase\numspell@group@digit@iii% + \or\numspell@{ein}\or\numspell@{zwei}\or\numspell@{drei}\or\numspell@{vier}\or\numspell@{f\"{u}nf}% + \or\numspell@{sechs}\or\numspell@{sieben}\or\numspell@{acht}\or\numspell@{neun}% + \fi% + \fi% + \ifnum\number\numexpr\numspell@group@digit@ii*\numspell@group@digit@iii>0% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>20% + \numspell@{und}% + \fi% + \fi% + \ifnum\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii>19% + \ifcase\numspell@group@digit@ii% + \or\or\numspell@{zwanzigste}\or\numspell@{drei\ss{}igste}\or\numspell@{vierzigste}\or\numspell@{f\"{u}nfzigste}% + \or\numspell@{sechzigste}\or\numspell@{siebzigste}\or\numspell@{achtzigste}\or\numspell@{neunzigste}% + \fi% + \fi% +} + +%% SPELLING CARDINAL NUMBER +%% -------------------------------------- +%% \numspell@num@spell@de{<num1>}{<num2>} +%% -------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num spelling to \thenumspell +%% +\def\numspell@num@spell@de#1#2{% + \gdef\thenumspell{}% + \numspell@groups{#1}{#2}% + \setcounter{numspell@groupcount}{22}% + \@whilenum\value{numspell@groupcount}>2% + \do{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{0}{}{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{\numspell@{eine}}{}% + \numspell@group@spell@de{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \numspell@{ }% + \csname numspell@group@\roman{numspell@groupcount}@de@name\endcsname% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{}{\ifodd\value{numspell@groupcount}\numspell@{e}\fi}% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{}{\numspell@{n}}% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname>0\numspell@{ }\fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \IfEq{\numspell@group@ii}{1}{\numspell@{ein}}{}% + \numspell@group@spell@de{\numspell@group@ii}% + \numspell@group@ii@de@name% + }% + \IfEq{\numspell@group@i}{0}{}{% + \IfEq{\numspell@group@i}{1}{\numspell@{eins}}{}% + \numspell@group@spell@de{\numspell@group@i}% + }% + \ifnum\numspell@group@max=0\numspell@{null}\fi% +} + +%% SPELLING ORDINAL NUMBER +%% ----------------------------------------- +%% \numspell@ordnum@spell@de{<num1>}{<num2>} +%% ----------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num ordinal spelling to \thenumspell +%% +\def\numspell@ordnum@spell@de#1#2{% + \gdef\thenumspell{}% + \numspell@groups{#1}{#2}% + \setcounter{numspell@groupcount}{22}% + \@whilenum\value{numspell@groupcount}>2% + \do{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{0}{}{% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname>0% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{\numspell@{eine}}{}% + \numspell@group@spell@de{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \numspell@{ }% + \csname numspell@group@\roman{numspell@groupcount}@de@name\endcsname% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{}{\ifodd\value{numspell@groupcount}\numspell@{e}\fi}% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{}{\numspell@{n}}\numspell@{ }% + \else% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}{\numspell@{ein}}{}% + \numspell@group@spell@de{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \csname numspell@ordgroup@\roman{numspell@groupcount}@de@name\endcsname% + \fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \IfEq{\numspell@group@ii}{1}{\numspell@{ein}}{}% + \numspell@group@spell@de{\numspell@group@ii}% + \numspell@group@ii@de@name% + \ifnum\numspell@group@ii@before=0\numspell@{ste}\fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \IfEq{\numspell@group@i}{1}{\numspell@{erste}}{}% + \numspell@ordgroup@spell@de{\numspell@group@i}% + }% + \ifnum\numspell@group@max=0\numspell@{nullte}\fi% +} + +%% ---------------------- +%% \numspell@uppercase@de +%% ---------------------- +%% E.g. \def\thenumspell{ein}\numspell@uppercase\thenumspell --> 'Ein' +%% \MakeUppercase does not work on pdf bookmark (see hyperref), so using another effective macro. +%% +\def\numspell@uppercase@de{% + \fullexpandarg% + \StrChar{\thenumspell}{1}[\numspell@firstletter]% + \expandarg% + \StrGobbleLeft{\thenumspell}{1}[\numspell@trunc]% + \fullexpandarg% + \def\numspell@the{}% + \IfStrEq{\numspell@firstletter}{e}{\g@addto@macro\numspell@the{E}}{}% ein + \IfStrEq{\numspell@firstletter}{z}{\g@addto@macro\numspell@the{Z}}{}% zwei + \IfStrEq{\numspell@firstletter}{d}{\g@addto@macro\numspell@the{D}}{}% drei + \IfStrEq{\numspell@firstletter}{v}{\g@addto@macro\numspell@the{V}}{}% vier + \IfStrEq{\numspell@firstletter}{f}{\g@addto@macro\numspell@the{F}}{}% f\"{u}nf + \IfStrEq{\numspell@firstletter}{s}{\g@addto@macro\numspell@the{S}}{}% sechs + \IfStrEq{\numspell@firstletter}{a}{\g@addto@macro\numspell@the{A}}{}% acht + \IfStrEq{\numspell@firstletter}{n}{\g@addto@macro\numspell@the{N}}{}% neun + \ifx\numspell@the\@empty\@latexerr{'numspell.sty' error! There is not '\numspell@firstletter' in uppercase!}{}\fi% + \g@addto@macro\numspell@the{\numspell@trunc}% + \def\thenumspell{\numspell@the}% +} + +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-magyar.sty b/Master/texmf-dist/tex/latex/numspell/numspell-magyar.sty new file mode 100644 index 00000000000..ce4c1d2442e --- /dev/null +++ b/Master/texmf-dist/tex/latex/numspell/numspell-magyar.sty @@ -0,0 +1,398 @@ +%% +%% `numspell-magyar.sty' Hungarian language package for 'numspell.sty' +%% +%% Copyright 2017- by Tibor Tomacs +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Tibor Tomacs. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{numspell-magyar}[2017/02/09 v1.0 Hungarian language package for numspell] + +%% Automatic Hungarian definite article ('a' or 'az') +%% --------------- +%% \numspell@az@hu +%% --------------- +%% E.g. \def\thenumspell{egy}\numspell@az@hu\thenumspell --> 'az egy' +%% \def\thenumspell{hat}\numspell@az@hu\thenumspell --> 'a hat' +%% +\def\numspell@az@hu{% + \fullexpandarg% + \StrChar{\thenumspell}{1}[\numspell@firstletter]% + \expandarg% + \StrGobbleLeft{\thenumspell}{0}[\numspell@original]% + \fullexpandarg% + \def\numspell@the{}% + \IfStrEq{\numspell@firstletter}{e}{\g@addto@macro\numspell@the{az }}{% az egy, az ezer + \IfStrEq{\numspell@firstletter}{{\"{o}}}{\g@addto@macro\numspell@the{az }}{% az \"{o}t + \g@addto@macro\numspell@the{a }}}% a hat + \g@addto@macro\numspell@the{\numspell@original}% + \def\thenumspell{\numspell@the}% +} + +%% Automatic Hungarian definite article ('A' or 'Az') +%% --------------- +%% \numspell@Az@hu +%% --------------- +%% E.g. \def\thenumspell{egy}\numspell@Az@hu\thenumspell --> 'Az egy' +%% \def\thenumspell{hat}\numspell@Az@hu\thenumspell --> 'A hat' +%% +\def\numspell@Az@hu{% + \fullexpandarg% + \StrChar{\thenumspell}{1}[\numspell@firstletter]% + \expandarg% + \StrGobbleLeft{\thenumspell}{0}[\numspell@original]% + \fullexpandarg% + \def\numspell@the{}% + \IfStrEq{\numspell@firstletter}{e}{\g@addto@macro\numspell@the{Az }}{% Az egy, Az ezer + \IfStrEq{\numspell@firstletter}{{\"{o}}}{\g@addto@macro\numspell@the{Az }}{% Az \"{o}t + \g@addto@macro\numspell@the{A }}}% A hat, A nyolc,... + \g@addto@macro\numspell@the{\numspell@original}% + \def\thenumspell{\numspell@the}% +} + +%% -------------------------- +%% \anumspell[<num2>]{<num1>} (Default <num2> is 0) +%% -------------------------- +%% \numspell@num@spell@hu{<num1>}{<num2>} +%% \numspell@az@hu +%% \thenumspell +%% +%% --------------------------- +%% \anumspell*[<num2>]{<num1>} works like \anumspell, but \thenumspell will not be expanded. +%% --------------------------- +%% +\newcommand{\anumspell@output}[2][0]{\numspell@num@spell@hu{#2}{#1}\numspell@az@hu\thenumspell} +\newcommand{\anumspell@@output}[2][0]{\numspell@num@spell@hu{#2}{#1}\numspell@az@hu\ignorespaces} +\DeclareRobustCommand*{\anumspell}{% + \ifnum\pdf@strcmp{\languagename}{magyar}=\z@\else\@latexerr{'numspell.sty' error! \protect\anumspell\space supported only in 'magyar' language}{}\fi% + \@ifstar{\anumspell@@output}{\anumspell@output}% +} + +%% -------------------------- +%% \Anumspell[<num2>]{<num1>} (Default <num2> is 0) +%% -------------------------- +%% \numspell@num@spell@hu{<num1>}{<num2>} +%% \numspell@Az@hu +%% \thenumspell +%% +%% --------------------------- +%% \Anumspell*[<num2>]{<num1>} works like \Anumspell, but \thenumspell will not be expanded. +%% --------------------------- +%% +\newcommand{\Anumspell@output}[2][0]{\numspell@num@spell@hu{#2}{#1}\numspell@Az@hu\thenumspell} +\newcommand{\Anumspell@@output}[2][0]{\numspell@num@spell@hu{#2}{#1}\numspell@Az@hu\ignorespaces} +\DeclareRobustCommand*{\Anumspell}{% + \ifnum\pdf@strcmp{\languagename}{magyar}=\z@\else\@latexerr{'numspell.sty' error! \protect\Anumspell\space supported only in 'magyar' language}{}\fi% + \@ifstar{\Anumspell@@output}{\Anumspell@output}% +} + +%% ----------------------------- +%% \aordnumspell[<num2>]{<num1>} (Default <num2> is 0) +%% ----------------------------- +%% \numspell@ordnum@spell@hu{<num1>}{<num2>} +%% \numspell@az@hu +%% \thenumspell +%% +%% ------------------------------ +%% \aordnumspell*[<num2>]{<num1>} works like \aordnumspell, but \thenumspell will not be expanded. +%% ------------------------------ +%% +\newcommand{\aordnumspell@output}[2][0]{\numspell@ordnum@spell@hu{#2}{#1}\numspell@az@hu\thenumspell} +\newcommand{\aordnumspell@@output}[2][0]{\numspell@ordnum@spell@hu{#2}{#1}\numspell@az@hu\ignorespaces} +\DeclareRobustCommand*{\aordnumspell}{% + \ifnum\pdf@strcmp{\languagename}{magyar}=\z@\else\@latexerr{'numspell.sty' error! \protect\aordnumspell\space supported only in 'magyar' language}{}\fi% + \@ifstar{\aordnumspell@@output}{\aordnumspell@output}% +} + +%% ----------------------------- +%% \Aordnumspell[<num2>]{<num1>} (Default <num2> is 0) +%% ----------------------------- +%% \numspell@ordnum@spell@hu{<num1>}{<num2>} +%% \numspell@Az@hu +%% \thenumspell +%% +%% ------------------------------ +%% \Aordnumspell*[<num2>]{<num1>} works like \Aordnumspell, but \thenumspell will not be expanded. +%% ------------------------------ +%% +\newcommand{\Aordnumspell@output}[2][0]{\numspell@ordnum@spell@hu{#2}{#1}\numspell@Az@hu\thenumspell} +\newcommand{\Aordnumspell@@output}[2][0]{\numspell@ordnum@spell@hu{#2}{#1}\numspell@Az@hu\ignorespaces} +\DeclareRobustCommand*{\Aordnumspell}{% + \ifnum\pdf@strcmp{\languagename}{magyar}=\z@\else\@latexerr{'numspell.sty' error! \protect\Aordnumspell\space supported only in 'magyar' language}{}\fi% + \@ifstar{\Aordnumspell@@output}{\Aordnumspell@output}% +} + +%% GROUP NAMES +\def\numspell@group@ii@hu@name{\numspell@{ezer}} +\def\numspell@group@iii@hu@name{\numspell@{milli\'{o}}} +\def\numspell@group@iv@hu@name{\numspell@{milli\'{a}rd}} +\def\numspell@group@v@hu@name{\numspell@{billi\'{o}}} +\def\numspell@group@vi@hu@name{\numspell@{billi\'{a}rd}} +\def\numspell@group@vii@hu@name{\numspell@{trilli\'{o}}} +\def\numspell@group@viii@hu@name{\numspell@{trilli\'{a}rd}} +\def\numspell@group@ix@hu@name{\numspell@{kvadrilli\'{o}}} +\def\numspell@group@x@hu@name{\numspell@{kvadrilli\'{a}rd}} +\def\numspell@group@xi@hu@name{\numspell@{kvintilli\'{o}}} +\def\numspell@group@xii@hu@name{\numspell@{kvintilli\'{a}rd}} +\def\numspell@group@xiii@hu@name{\numspell@{szextilli\'{o}}} +\def\numspell@group@xiv@hu@name{\numspell@{szextilli\'{a}rd}} +\def\numspell@group@xv@hu@name{\numspell@{szeptilli\'{o}}} +\def\numspell@group@xvi@hu@name{\numspell@{szeptilli\'{a}rd}} +\def\numspell@group@xvii@hu@name{\numspell@{oktilli\'{o}}} +\def\numspell@group@xviii@hu@name{\numspell@{oktilli\'{a}rd}} +\def\numspell@group@xix@hu@name{\numspell@{nonilli\'{o}}} +\def\numspell@group@xx@hu@name{\numspell@{nonilli\'{a}rd}} +\def\numspell@group@xxi@hu@name{\numspell@{decilli\'{o}}} +\def\numspell@group@xxii@hu@name{\numspell@{decilli\'{a}rd}} + +%% ORDINAL GROUP NAMES +\def\numspell@ordgroup@ii@hu@name{\numspell@{ezredik}} +\def\numspell@ordgroup@iii@hu@name{\numspell@{milliomodik}} +\def\numspell@ordgroup@iv@hu@name{\numspell@{milli\'{a}rdodik}} +\def\numspell@ordgroup@v@hu@name{\numspell@{billiomodik}} +\def\numspell@ordgroup@vi@hu@name{\numspell@{billi\'{a}rdodik}} +\def\numspell@ordgroup@vii@hu@name{\numspell@{trilliomodik}} +\def\numspell@ordgroup@viii@hu@name{\numspell@{trilli\'{a}rdodik}} +\def\numspell@ordgroup@ix@hu@name{\numspell@{kvadrilliomodik}} +\def\numspell@ordgroup@x@hu@name{\numspell@{kvadrilli\'{a}rdodik}} +\def\numspell@ordgroup@xi@hu@name{\numspell@{kvintilliomodik}} +\def\numspell@ordgroup@xii@hu@name{\numspell@{kvintilli\'{a}rdodik}} +\def\numspell@ordgroup@xiii@hu@name{\numspell@{szextilliomodik}} +\def\numspell@ordgroup@xiv@hu@name{\numspell@{szextilli\'{a}rdodik}} +\def\numspell@ordgroup@xv@hu@name{\numspell@{szeptilliomodik}} +\def\numspell@ordgroup@xvi@hu@name{\numspell@{szeptilli\'{a}rdodik}} +\def\numspell@ordgroup@xvii@hu@name{\numspell@{oktilliomodik}} +\def\numspell@ordgroup@xviii@hu@name{\numspell@{oktilli\'{a}rdodik}} +\def\numspell@ordgroup@xix@hu@name{\numspell@{nonilliomodik}} +\def\numspell@ordgroup@xx@hu@name{\numspell@{nonilli\'{a}rdodik}} +\def\numspell@ordgroup@xxi@hu@name{\numspell@{decilliomodik}} +\def\numspell@ordgroup@xxii@hu@name{\numspell@{decilli\'{a}rdodik}} + +%% SPELLING CARDINAL NUMBER GROUP +%% --------------------------------- +%% \numspell@group@spell@hu{<group>} (<group>=000,001,...,999) +%% --------------------------------- +%% \numspell@group@digits{<group>} +%% Adding the <group> spelling to \thenumspell +%% +\def\numspell@group@spell@hu#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\or\numspell@{k\'{e}t}\or\numspell@{h\'{a}rom}\or\numspell@{n\'{e}gy}\or\numspell@{{\"{o}}t}% 1 --> 'ezeregysz\'{a}z' but 'sz\'{a}z' + \or\numspell@{hat}\or\numspell@{h\'{e}t}\or\numspell@{nyolc}\or\numspell@{kilenc}% + \fi% + \ifnum\numspell@group@digit@i>0% + \numspell@{sz\'{a}z}% + \fi% + \ifnum\numspell@group@digit@iii>0% + \ifcase\numspell@group@digit@ii% + \or\numspell@{tizen}\or\numspell@{huszon}% + \fi% + \else% + \ifcase\numspell@group@digit@ii% + \or\numspell@{t\'{i}z}\or\numspell@{h\'{u}sz}% + \fi% + \fi% + \ifcase\numspell@group@digit@ii% + \or\or\or\numspell@{harminc}\or\numspell@{negyven}\or\numspell@{{\"{o}}tven}\or\numspell@{hatvan}% + \or\numspell@{hetven}\or\numspell@{nyolcvan}\or\numspell@{kilencven}% + \fi% + \ifcase\numspell@group@digit@iii% + \or\numspell@{egy}\or\or\numspell@{h\'{a}rom}\or\numspell@{n\'{e}gy}\or\numspell@{{\"{o}}t}% 2 --> 'k\'{e}t' or 'kett\H{o}' + \or\numspell@{hat}\or\numspell@{h\'{e}t}\or\numspell@{nyolc}\or\numspell@{kilenc}% + \fi% +} + +%% SPELLING ORDINAL NUMBER GROUP +%% ------------------------------------ +%% \numspell@ordgroup@spell@hu{<group>} (<group>=000,001,...,999) +%% ------------------------------------ +%% \numspell@group@digits{<group>} +%% Adding the <group> ordinal spelling to \thenumspell +%% +\def\numspell@ordgroup@spell@hu#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\or\numspell@{k\'{e}t}\or\numspell@{h\'{a}rom}\or\numspell@{n\'{e}gy}\or\numspell@{{\"{o}}t}% 1 --> 'ezeregysz\'{a}z' but 'sz\'{a}z' + \or\numspell@{hat}\or\numspell@{h\'{e}t}\or\numspell@{nyolc}\or\numspell@{kilenc}% + \fi% + \ifnum\numspell@group@digit@i>0% + \ifnum\number\numexpr\numspell@group@digit@i*(\numspell@group@digit@ii+\numspell@group@digit@iii)>0% + \numspell@{sz\'{a}z}% + \else% + \numspell@{sz\'{a}zadik}% + \fi% + \fi% + \ifnum\numspell@group@digit@iii>0% + \ifcase\numspell@group@digit@ii% + \or\numspell@{tizen}\or\numspell@{huszon}\or\numspell@{harminc}\or\numspell@{negyven}\or\numspell@{{\"{o}}tven}% + \or\numspell@{hatvan}\or\numspell@{hetven}\or\numspell@{nyolcvan}\or\numspell@{kilencven}% + \fi% + \else% + \ifcase\numspell@group@digit@ii% + \or\numspell@{tizedik}\or\numspell@{huszadik}\or\numspell@{harmincadik}\or\numspell@{negyvenedik}% + \or\numspell@{{\"{o}}tvenedik}\or\numspell@{hatvanadik}\or\numspell@{hetvenedik}% + \or\numspell@{nyolcvanadik}\or\numspell@{kilencvenedik}% + \fi% + \fi% + \ifcase\numspell@group@digit@iii% + \or\or\or\numspell@{harmadik}\or\numspell@{negyedik}\or\numspell@{{\"{o}}t\"{o}dik}% 1 --> 'els\H{o}' or 'egyedik' 2 --> 'm\'{a}sodik' or 'kettedik' + \or\numspell@{hatodik}\or\numspell@{hetedik}\or\numspell@{nyolcadik}\or\numspell@{kilencedik}% + \fi% +} + +%% SPELLING CARDINAL NUMBER +%% -------------------------------------- +%% \numspell@num@spell@hu{<num1>}{<num2>} +%% -------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num spelling to \thenumspell +%% +\def\numspell@num@spell@hu#1#2{% + \gdef\thenumspell{}% + \numspell@groups{#1}{#2}% + \setcounter{numspell@groupcount}{22}% + \@whilenum\value{numspell@groupcount}>2% + \do{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{0}{}{% + \numspell@group@digits{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \ifnum\numspell@group@max>\value{numspell@groupcount}% + \ifcase\numspell@group@digit@i\or\numspell@{egy}\fi% + \fi% + \numspell@group@spell@hu{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \ifcase\numspell@group@digit@iii\or\or\numspell@{k\'{e}t}\fi% + \csname numspell@group@\roman{numspell@groupcount}@hu@name\endcsname% + \ifnum\numspell@group@min<\value{numspell@groupcount}\numspell@dash@\fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \numspell@group@digits{\numspell@group@ii}% + \ifnum\numspell@group@max>2% + \ifcase\numspell@group@digit@i\or\numspell@{egy}\fi% + \fi% + \IfEq{\numspell@group@ii}{1}{% + \ifnum\numspell@group@max>2% + \numspell@group@spell@hu{\numspell@group@ii}% + \fi}% + {\numspell@group@spell@hu{\numspell@group@ii}}% + \ifcase\numspell@group@digit@iii\or\or\numspell@{k\'{e}t}\fi% + \numspell@group@ii@hu@name% + \ifnum\numspell@group@min<2% + \IfEq{\numspell@group@ii}{1}{}{\numspell@dash@}% + \fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \numspell@group@digits{\numspell@group@i}% + \ifnum\numspell@group@max>1% + \ifcase\numspell@group@digit@i\or\numspell@{egy}\fi% + \fi% + \numspell@group@spell@hu{\numspell@group@i}% + \ifcase\numspell@group@digit@iii\or\or\numspell@{kett\H{o}}\fi% + }% + \ifnum\numspell@group@max=0\numspell@{nulla}\fi% +} + +%% SPELLING ORDINAL NUMBER +%% ----------------------------------------- +%% \numspell@ordnum@spell@hu{<num1>}{<num2>} +%% ----------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num ordinal spelling to \thenumspell +%% +\def\numspell@ordnum@spell@hu#1#2{% + \gdef\thenumspell{}% + \numspell@groups{#1}{#2}% + \setcounter{numspell@groupcount}{22}% + \@whilenum\value{numspell@groupcount}>2% + \do{% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{0}{}{% + \numspell@group@digits{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \ifnum\numspell@group@max>\value{numspell@groupcount}% + \ifcase\numspell@group@digit@i\or\numspell@{egy}\fi% + \fi% + \numspell@group@spell@hu{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \ifcase\numspell@group@digit@iii\or\or\numspell@{k\'{e}t}\fi% + \ifnum\numspell@group@min<\value{numspell@groupcount}% + \csname numspell@group@\roman{numspell@groupcount}@hu@name\endcsname% + \numspell@dash@% + \else% + \csname numspell@ordgroup@\roman{numspell@groupcount}@hu@name\endcsname% + \fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \numspell@group@digits{\numspell@group@ii}% + \ifnum\numspell@group@max>2% + \ifcase\numspell@group@digit@i\or\numspell@{egy}\fi% + \fi% + \IfEq{\numspell@group@ii}{1}{% + \ifnum\numspell@group@max>2% + \numspell@group@spell@hu{\numspell@group@ii}% + \fi}% + {\numspell@group@spell@hu{\numspell@group@ii}}% + \ifcase\numspell@group@digit@iii\or\or\numspell@{k\'{e}t}\fi% + \ifnum\numspell@group@min<2% + \numspell@group@ii@hu@name% + \IfEq{\numspell@group@ii}{1}{}{\numspell@dash@}% + \else% + \numspell@ordgroup@ii@hu@name% + \fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \numspell@group@digits{\numspell@group@i}% + \ifnum\numspell@group@max>1% + \ifcase\numspell@group@digit@i\or\numspell@{egy}\fi% + \fi% + \numspell@ordgroup@spell@hu{\numspell@group@i}% + \ifnum\numspell@numlength>1% + \ifcase\numspell@group@digit@iii% + \or\numspell@{egyedik}\or\numspell@{kettedik}% + \fi% + \else% + \ifcase\numspell@group@digit@iii% + \or\numspell@{els\H{o}}\or\numspell@{m\'{a}sodik}% + \fi% + \fi% + }% + \ifnum\numspell@group@max=0\numspell@{nulladik}\fi% +} + +%% ---------------------- +%% \numspell@uppercase@hu +%% ---------------------- +%% E.g. \def\thenumspell{egy}\numspell@uppercase\thenumspell --> 'Egy' +%% \MakeUppercase does not work on pdf bookmark (see hyperref), so using another effective macro. +%% +\def\numspell@uppercase@hu{% + \fullexpandarg% + \StrChar{\thenumspell}{1}[\numspell@firstletter]% + \expandarg% + \StrGobbleLeft{\thenumspell}{1}[\numspell@trunc]% + \fullexpandarg% + \def\numspell@the{}% + \IfStrEq{\numspell@firstletter}{e}{\g@addto@macro\numspell@the{E}}{}% egy + \IfStrEq{\numspell@firstletter}{k}{\g@addto@macro\numspell@the{K}}{}% kett\H{o} + \IfStrEq{\numspell@firstletter}{m}{\g@addto@macro\numspell@the{M}}{}% m\'{a}sodik + \IfStrEq{\numspell@firstletter}{h}{\g@addto@macro\numspell@the{H}}{}% h\'{a}rom + \IfStrEq{\numspell@firstletter}{n}{\g@addto@macro\numspell@the{N}}{}% n\'{e}gy + \IfStrEq{\numspell@firstletter}{{\"{o}}}{\g@addto@macro\numspell@the{\"{O}}}{}% \"{o}t + \IfStrEq{\numspell@firstletter}{t}{\g@addto@macro\numspell@the{T}}{}% t\'{i}z + \IfStrEq{\numspell@firstletter}{s}{\g@addto@macro\numspell@the{S}}{}% sz\'{a}z + \ifx\numspell@the\@empty\@latexerr{'numspell.sty' error! There is not '\numspell@firstletter' in uppercase!}{}\fi% + \g@addto@macro\numspell@the{\numspell@trunc}% + \def\thenumspell{\numspell@the}% +} + +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/numspell/numspell.sty b/Master/texmf-dist/tex/latex/numspell/numspell.sty new file mode 100644 index 00000000000..a4167f80854 --- /dev/null +++ b/Master/texmf-dist/tex/latex/numspell/numspell.sty @@ -0,0 +1,295 @@ +%% +%% `numspell.sty' +%% +%% Package for spelling the non-negative cardinal and ordinal numbers (maximum 66 digits). +%% +%% Copyright 2017- by Tibor Tomacs +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Tibor Tomacs. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{numspell}[2017/02/09 v1.0 Package for spelling cardinal and ordinal numbers] + +\RequirePackage{xstring} +\RequirePackage{pdftexcmds} +\RequirePackage{etoolbox} + +\newcounter{numspell@counter@tempa} +\newcounter{numspell@counter@tempb} +\newcounter{numspell@counter@tempc} +\newcounter{numspell@groupcount} + +%% ------------------------------- +%% \numspell@group@digits{<group>} (<group>=000,001,...,999) +%% ------------------------------- +%% It generates the following parameters: +%% +%% \numspell@group@digit@i = 1st digit +%% \numspell@group@digit@ii = 2nd digit +%% \numspell@group@digit@iii = 3rd digit +%% +\def\numspell@group@digits#1{% + \StrChar{#1}{1}[\numspell@group@digit@i]% + \StrChar{#1}{2}[\numspell@group@digit@ii]% + \StrChar{#1}{3}[\numspell@group@digit@iii]% +} + +%% -------------------------------- +%% \numspell@groups{<num1>}{<num2>} (<num1>*10^<num2>=0,1,...,999999999999...9 (66 digits)=10^67-1) +%% -------------------------------- +%% It generates the following parameters: +%% +%% \numspell@num = <num1>*10^<num2> +%% \numspell@numlength = number of \numspell@num digits +%% \numspell@fullnum = (66-\numspell@numlength) pieces 0, then \numspell@num +%% \numspell@group@i = 64th, 65th and 66th digits of \numspell@fullnum --> [group1] +%% \numspell@group@ii = 61th, 62th and 63th digits of \numspell@fullnum --> [group2] +%% \numspell@group@iii = 58th, 59th and 60th digits of \numspell@fullnum --> [group3] +%% ... ... ... +%% \numspell@group@xxii = 1st, 2nd and 3rd digits of \numspell@fullnum --> [group22] +%% \numspell@group@max = maximum <number>, which such that, [group<number>] is positive +%% \numspell@group@min = minimum <number>, which such that, [group<number>] is positive +%% \numspell@group@<num>@before = number of positive groups, whose serial number is less then <num> (<num>=ii,iii,...,xxii) +%% +\def\numspell@groups#1#2{% + \def\numspell@num{#1}% + \setcounter{numspell@counter@tempa}{0}% + \@whilenum\value{numspell@counter@tempa}<#2% + \do{% + \stepcounter{numspell@counter@tempa}% + \g@addto@macro\numspell@num{0}% + }% + \def\numspell@fullnum{}% + \StrLen{\numspell@num}[\numspell@numlength]% + \ifnum\numspell@numlength>66\@latexerr{Number too big (\numspell@numlength\space digits). Maximum 66 digits}{}\fi% + \setcounter{numspell@counter@tempa}{66}% + \addtocounter{numspell@counter@tempa}{-\numspell@numlength}% + \setcounter{numspell@counter@tempb}{0}% + \@whilenum\value{numspell@counter@tempb}<\value{numspell@counter@tempa}% + \do{% + \stepcounter{numspell@counter@tempb}% + \g@addto@macro\numspell@fullnum{0}% + }% + \g@addto@macro\numspell@fullnum{\numspell@num}% + \StrMid{\numspell@fullnum}{64}{66}[\numspell@group@i]% + \StrMid{\numspell@fullnum}{61}{63}[\numspell@group@ii]% + \StrMid{\numspell@fullnum}{58}{60}[\numspell@group@iii]% + \StrMid{\numspell@fullnum}{55}{57}[\numspell@group@iv]% + \StrMid{\numspell@fullnum}{52}{54}[\numspell@group@v]% + \StrMid{\numspell@fullnum}{49}{51}[\numspell@group@vi]% + \StrMid{\numspell@fullnum}{46}{48}[\numspell@group@vii]% + \StrMid{\numspell@fullnum}{43}{45}[\numspell@group@viii]% + \StrMid{\numspell@fullnum}{40}{42}[\numspell@group@ix]% + \StrMid{\numspell@fullnum}{37}{39}[\numspell@group@x]% + \StrMid{\numspell@fullnum}{34}{36}[\numspell@group@xi]% + \StrMid{\numspell@fullnum}{31}{33}[\numspell@group@xii]% + \StrMid{\numspell@fullnum}{28}{30}[\numspell@group@xiii]% + \StrMid{\numspell@fullnum}{25}{27}[\numspell@group@xiv]% + \StrMid{\numspell@fullnum}{22}{24}[\numspell@group@xv]% + \StrMid{\numspell@fullnum}{19}{21}[\numspell@group@xvi]% + \StrMid{\numspell@fullnum}{16}{18}[\numspell@group@xvii]% + \StrMid{\numspell@fullnum}{13}{15}[\numspell@group@xviii]% + \StrMid{\numspell@fullnum}{10}{12}[\numspell@group@xix]% + \StrMid{\numspell@fullnum}{7}{9}[\numspell@group@xx]% + \StrMid{\numspell@fullnum}{4}{6}[\numspell@group@xxi]% + \StrMid{\numspell@fullnum}{1}{3}[\numspell@group@xxii]% + \def\numspell@group@max{0}% + \setcounter{numspell@counter@tempa}{0}% + \@whilenum\value{numspell@counter@tempa}<22% + \do{% + \stepcounter{numspell@counter@tempa}% + \ifnum\csname numspell@group@\roman{numspell@counter@tempa}\endcsname>0% + \edef\numspell@group@max{\thenumspell@counter@tempa}% + \fi% + }% + \def\numspell@group@min{0}% + \setcounter{numspell@counter@tempa}{23}% + \@whilenum\value{numspell@counter@tempa}>1% + \do{% + \addtocounter{numspell@counter@tempa}{-1}% + \ifnum\csname numspell@group@\roman{numspell@counter@tempa}\endcsname>0% + \edef\numspell@group@min{\thenumspell@counter@tempa}% + \fi% + }% + \setcounter{numspell@counter@tempa}{1}% + \@whilenum\value{numspell@counter@tempa}<22% + \do{% + \stepcounter{numspell@counter@tempa}% + \setcounter{numspell@counter@tempb}{1}% + \setcounter{numspell@counter@tempc}{0}% + \@whilenum\value{numspell@counter@tempb}<\value{numspell@counter@tempa}% + \do{% + \ifnum\csname numspell@group@\roman{numspell@counter@tempb}\endcsname>0% + \stepcounter{numspell@counter@tempc}% + \fi% + \stepcounter{numspell@counter@tempb}% + }% + \expandafter\protected@edef\csname numspell@group@\roman{numspell@counter@tempa}@before\endcsname{\thenumspell@counter@tempc}% + }% +} + +%% -------------------- +%% \numspell@{<string>} +%% -------------------- +%% E.g. \def\thenumspell{}\numspell@{one}\numspell@{ hundred}\thenumspell --> 'one hundred' +%% +\def\thenumspell{} +\def\numspell@#1{\g@addto@macro\thenumspell{#1}} + +%% --------------------- +%% \numspellsave{<name>} +%% --------------------- +%% E.g. \def\thenumspell{one}\numspellsave{foo}\thenumspellfoo --> 'one' +%% +\DeclareRobustCommand*{\numspellsave}[1]{\expandafter\protected@xdef\csname thenumspell#1\endcsname{\thenumspell}\ignorespaces} + +%% ------------------------------- +%% \numspelldashspace{<length>} +%% ------------------------------- +%% It determinates the maximal flexibility of the spaces around the dashes. Default: 2pt +%% E.g. \numspelldashspace{5pt} --> \numspell@dash@ = \numspell@{\nobreak\hskip0pt plus5pt-\hskip0pt plus5pt} +%% +\def\numspell@dash@@#1{\leavevmode\nobreak\hskip0pt plus#1-\hskip0pt plus#1\relax} +\def\numspelldashspace#1{\def\numspell@dash@{\numspell@{\numspell@dash@@{#1}}}\ignorespaces} +\numspelldashspace{2pt} + +%% ------------------------- +%% \numspell[<num2>]{<num1>} (Default <num2> is 0) +%% ------------------------- +%% \numspell@num@spell@<lang>{<num1>}{<num2>}\thenumspell +%% +%% -------------------------- +%% \numspell*[<num2>]{<num1>} +%% -------------------------- +%% It works like \numspell, but \thenumspell will not be expanded. +%% +\newcommand{\numspell@output}[2][0]{\csname numspell@num@spell@\numspell@langname\endcsname{#2}{#1}\thenumspell} +\newcommand{\numspell@@output}[2][0]{\csname numspell@num@spell@\numspell@langname\endcsname{#2}{#1}\ignorespaces} +\DeclareRobustCommand*{\numspell}{\numspell@lang@check\@ifstar{\numspell@@output}{\numspell@output}} + +%% ------------------------- +%% \Numspell[<num2>]{<num1>} (Default <num2> is 0) +%% ------------------------- +%% \numspell@num@spell@<lang>{<num1>}{<num2>}\numspell@uppercase\thenumspell +%% +%% -------------------------- +%% \Numspell*[<num2>]{<num1>} +%% -------------------------- +%% It works like \Numspell, but \thenumspell will not be expanded. +%% +\newcommand{\Numspell@output}[2][0]{\csname numspell@num@spell@\numspell@langname\endcsname{#2}{#1}% + \csname numspell@uppercase@\numspell@langname\endcsname\thenumspell} +\newcommand{\Numspell@@output}[2][0]{\csname numspell@num@spell@\numspell@langname\endcsname{#2}{#1}% + \csname numspell@uppercase@\numspell@langname\endcsname\ignorespaces} +\DeclareRobustCommand*{\Numspell}{\numspell@lang@check\@ifstar{\Numspell@@output}{\Numspell@output}} + +%% ---------------------------- +%% \ordnumspell[<num2>]{<num1>} (Default <num2> is 0) +%% ---------------------------- +%% \numspell@ordnum@spell@<lang>{<num1>}{<num2>}\thenumspell +%% +%% ----------------------------- +%% \ordnumspell*[<num2>]{<num1>} +%% ----------------------------- +%% It works like \ordnumspell, but \thenumspell will not be expanded. +%% +\newcommand{\ordnumspell@output}[2][0]{\csname numspell@ordnum@spell@\numspell@langname\endcsname{#2}{#1}\thenumspell} +\newcommand{\ordnumspell@@output}[2][0]{\csname numspell@ordnum@spell@\numspell@langname\endcsname{#2}{#1}\ignorespaces} +\DeclareRobustCommand*{\ordnumspell}{\numspell@lang@check\@ifstar{\ordnumspell@@output}{\ordnumspell@output}} + +%% ---------------------------- +%% \Ordnumspell[<num2>]{<num1>} (Default <num2> is 0) +%% ---------------------------- +%% \numspell@ordnum@spell@<lang>{<num1>}{<num2>}\numspell@uppercase\thenumspell +%% +%% ----------------------------- +%% \Ordnumspell*[<num2>]{<num1>} +%% ----------------------------- +%% It works like \Ordnumspell, but \thenumspell will not be expanded. +%% +\newcommand{\Ordnumspell@output}[2][0]{\csname numspell@ordnum@spell@\numspell@langname\endcsname{#2}{#1}% + \csname numspell@uppercase@\numspell@langname\endcsname\thenumspell} +\newcommand{\Ordnumspell@@output}[2][0]{\csname numspell@ordnum@spell@\numspell@langname\endcsname{#2}{#1}% + \csname numspell@uppercase@\numspell@langname\endcsname\ignorespaces} +\DeclareRobustCommand*{\Ordnumspell}{\numspell@lang@check\@ifstar{\Ordnumspell@@output}{\Ordnumspell@output}} + +%% -------------------- +%% \numspell@lang@check +%% -------------------- +%% If english is active, then \numspell@langname will be 'en'. +%% If magyar is active, then \numspell@langname will be 'hu'. +%% If german is active, then \numspell@langname will be 'de'. +%% If french is active, then \numspell@langname will be 'fr'. +%% Otherwise error. +%% +\newif\if@numspell@lang@notsupported@ +\def\numspell@lang@check{% + \@numspell@lang@notsupported@true% + \ifnum\pdf@strcmp{\languagename}{english}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{en}\fi% + \ifnum\pdf@strcmp{\languagename}{magyar}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{hu}\fi% + \ifnum\pdf@strcmp{\languagename}{german}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{de}\fi% + \ifnum\pdf@strcmp{\languagename}{french}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{fr}\fi% + \if@numspell@lang@notsupported@\@latexerr{'numspell.sty' error! Not supported language: \languagename}{}\fi% +} + +%% ------------------------- +%% Loading language packages +%% ------------------------- +%% If babel or polyglossia loads english, then numspell loads numspell-english.sty. +%% If babel or polyglossia loads magyar, then numspell loads numspell-magyar.sty. +%% If babel or polyglossia loads german, then numspell loads numspell-german.sty. +%% If babel or polyglossia loads german, then numspell loads numspell-french.sty. +%% Otherwise numspell loads numspell-english.sty. +%% +\AtEndPreamble{% +\newif\if@numspell@lang@loaded@ +\bbl@iflanguage\languagename{\expandafter\ifx\csname dateenglish\endcsname\relax\else\RequirePackage{numspell-english}\@numspell@lang@loaded@true\fi}% +\bbl@iflanguage\languagename{\expandafter\ifx\csname datemagyar\endcsname\relax\else\RequirePackage{numspell-magyar}\@numspell@lang@loaded@true\fi}% +\bbl@iflanguage\languagename{\expandafter\ifx\csname dategerman\endcsname\relax\else\RequirePackage{numspell-german}\@numspell@lang@loaded@true\fi}% +\bbl@iflanguage\languagename{\expandafter\ifx\csname datefrench\endcsname\relax\else\RequirePackage{numspell-french}\@numspell@lang@loaded@true\fi}% +\if@numspell@lang@loaded@\else\RequirePackage{numspell-english}\fi% +} + +%% --------------------------------- +%% Instructions for language package +%% --------------------------------- +%% +%% If the language name is <language> in babel or polyglossia, +%% then the name of the language package file will be numspell-<language>.sty (e.g. numspell-english.sty). +%% +%% Extend the following commands in the numspell.sty: +%% \AtEndPreamble +%% \numspell@lang@check (Use the \def\numspell@langname{<lang>}, where <lang> is abbreviation of the <language>, e.g. 'en' in case 'english'.) +%% +%% Define the following commands in numspell-<language>.sty: +%% \numspell@uppercase@<lang> +%% \numspell@group@<num>@<lang>@name +%% \numspell@ordgroup@<num>@<lang>@name +%% \numspell@group@spell@<lang> +%% \numspell@ordgroup@spell@<lang> +%% \numspell@num@spell@<lang> +%% \numspell@ordnum@spell@<lang> +%% (See <lang> at \numspell@lang@check.) +%% +%% Put into the \numspell@{...} command the words of the spelling (e.g. \numspell@{one}). +%% +%% Type the non-ascii characters as LaTeX-commands: \'{a}, \'{e}, \ss{}, etc. +%% +%% If the first character is non-ascii, then place it within braces (see \numspell@uppercase@<lang>) (e.g. {\"{o}}t). +%% +%% Do not use \numspell@{-} as dash! Instead of it: \numspell@dash@ (see \numspelldashspace). +%% +%% Do not use the following form: \def\foo{text} ... \numspell@{\foo} +%% Instead of it: \def\numspell@foo@<lang>{\numspell@{text}} ... \numspell@foo@<lang> + +\endinput
\ No newline at end of file |