diff options
author | Karl Berry <karl@freefriends.org> | 2017-09-30 23:09:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-09-30 23:09:21 +0000 |
commit | d45f700b1d4e5b74fe927d5247b61b2ccf84fc8a (patch) | |
tree | 6188b51ea2fa57011323a521b6ba584d7df6e78a /Master | |
parent | e34ba1cbe700c96794b9488ec6922ee328c722f0 (diff) |
numspell (30sep17)
git-svn-id: svn://tug.org/texlive/trunk@45441 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/numspell/README | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/numspell/numspell.pdf | bin | 220502 -> 222065 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/numspell/numspell.tex | 57 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/numspell/numspell-italian.sty | 332 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/numspell/numspell.sty | 6 |
5 files changed, 381 insertions, 21 deletions
diff --git a/Master/texmf-dist/doc/latex/numspell/README b/Master/texmf-dist/doc/latex/numspell/README index 36738e13361..9afd9185e2f 100644 --- a/Master/texmf-dist/doc/latex/numspell/README +++ b/Master/texmf-dist/doc/latex/numspell/README @@ -2,8 +2,8 @@ numspell.sty package Copyright 2017- by Tibor Tomacs -Package for spelling cardinal and ordinal numbers. -Supported languages are English, German, French and Hungarian. +This package supports the spelling of cardinal and ordinal numbers. +Supported languages are English, French, German, Hungarian and Italian. This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 @@ -22,7 +22,8 @@ This work consists of the files README (this file) numspell.sty (main package file) numspell-english.sty (English package for numspell) -numspell-german.sty (German package for numspell) numspell-french.sty (French package for numspell) +numspell-german.sty (German package for numspell) numspell-magyar.sty (Hungarian package for numspell) +numspell-italian.sty (Italian package for numspell) numspell.tex and the derived file numspell.pdf (documentation).
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/numspell/numspell.pdf b/Master/texmf-dist/doc/latex/numspell/numspell.pdf Binary files differindex 74ad6ce060e..60ea99893fc 100644 --- a/Master/texmf-dist/doc/latex/numspell/numspell.pdf +++ b/Master/texmf-dist/doc/latex/numspell/numspell.pdf diff --git a/Master/texmf-dist/doc/latex/numspell/numspell.tex b/Master/texmf-dist/doc/latex/numspell/numspell.tex index 6c8467b8213..5c8186fe483 100644 --- a/Master/texmf-dist/doc/latex/numspell/numspell.tex +++ b/Master/texmf-dist/doc/latex/numspell/numspell.tex @@ -21,7 +21,7 @@ \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{numspell} -\usepackage[magyar,ngerman,french,english]{babel} +\usepackage[magyar,italian,ngerman,french,english]{babel} \usepackage{listings,xcolor,amsmath,upquote} \usepackage[group-separator={,}]{siunitx} \flushbottom @@ -52,7 +52,7 @@ keepspaces]} \begin{document} -\title{The {\bfseries\sffamily numspell} package\\{\large v1.1 (2017/09/20)}} +\title{The {\bfseries\sffamily numspell} package\\{\large v1.2 (2017/09/30)}} \author{Tibor Tómács\\{\normalsize\url{tomacs.tibor@uni-eszterhazy.hu}}} \date{} \maketitle @@ -60,7 +60,7 @@ keepspaces]} \section{Introduction} The aim of the \texttt{numspell} package is to spell the cardinal and ordinal numbers from 0 to $10^{67}-1$ (i.e.~maximum 66 digits). -Currently, the supported languages are English, German, French and Hungarian. +Currently, the supported languages are English, French, German, Hungarian and Italian. The spelling will happen in the current language. The \texttt{numspell} package requires the services of the following packages: \texttt{xstring}, \texttt{etoolbox}, \texttt{pdftexcmds}. @@ -388,13 +388,28 @@ For example \thenumspellMyNum} \end{description} +\section{Commands for Italian language} +The following commands only work, if \texttt{italian} language is active. +\begin{description} +\selectlanguage{italian} +\item\commandinline|\numspellitmasculine| (default)\\ +The ordinal numbers will be printed in masculine form. For example\\ +\verb|\ordnumspell{1}| $\to$ \ordnumspell{1} + +\item\commandinline|\numspellitfeminine|\\ +The ordinal numbers will be printed in feminine form. For example\\ +\verb|\numspellitfeminine\ordnumspell{1};|\\ +\verb|\numspellitmasculine\ordnumspell{1}|\\[2mm] +{\numspellitfeminine\ordnumspell{1}}; {\numspellitmasculine\ordnumspell{1}} +\end{description} + \section{Examples} \subsection*{Example \stepcounter{subsection}\arabic{subsection}} \begin{examplelst} \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} -\usepackage[magyar,ngerman,french,english]{babel} +\usepackage[magyar,italian,ngerman,french,english]{babel} \usepackage{numspell} \usepackage[group-separator={,}]{siunitx} \begin{document} @@ -402,49 +417,57 @@ For example \def\mynum{123456789} \noindent -In British English the spelling of \num{\mynum} is -\emph{``\numspell{\mynum}''}. - -\smallskip\noindent In American English the spelling of \num{\mynum} is {\numspellUS\emph{``\numspell{\mynum}''}}. \smallskip\noindent -In German the spelling of \num{\mynum} is -{\selectlanguage{ngerman}\emph{``\numspell{\mynum}''}}. +In British English the spelling of \num{\mynum} is +\emph{``\numspell{\mynum}''}. \smallskip\noindent In French the spelling of \num{\mynum} is {\selectlanguage{french}\emph{``\numspell{\mynum}''}}. \smallskip\noindent +In German the spelling of \num{\mynum} is +{\selectlanguage{ngerman}\emph{``\numspell{\mynum}''}}. + +\smallskip\noindent In Hungarian the spelling of \num{\mynum} is {\selectlanguage{magyar}\emph{`'\numspell{\mynum}''}}. +\smallskip\noindent +In Italian the spelling of \num{\mynum} is +{\selectlanguage{italian}\emph{``\numspell{\mynum}''}}. + \end{document} \end{examplelst} \def\mynum{123456789} \noindent -In British English the spelling of \num{\mynum} is \emph{``\numspell{\mynum}''}. - -\smallskip\noindent In American English the spelling of \num{\mynum} is {\numspellUS\emph{``\numspell{\mynum}''}}. \smallskip\noindent -In German the spelling of \num{\mynum} is -{\selectlanguage{ngerman}\emph{``\numspell{\mynum}''}}. +In British English the spelling of \num{\mynum} is \emph{``\numspell{\mynum}''}. \smallskip\noindent In French the spelling of \num{\mynum} is {\selectlanguage{french}\emph{``\numspell{\mynum}''}}. \smallskip\noindent +In German the spelling of \num{\mynum} is +{\selectlanguage{ngerman}\emph{``\numspell{\mynum}''}}. + +\smallskip\noindent In Hungarian the spelling of \num{\mynum} is {\selectlanguage{magyar}\emph{`'\numspell{\mynum}''}}. +\smallskip\noindent +In Italian the spelling of \num{\mynum} is +{\selectlanguage{italian}\emph{``\numspell{\mynum}''}}. + \bigskip \subsection*{Example \stepcounter{subsection}\arabic{subsection}} \begin{examplelst} @@ -472,7 +495,7 @@ In Hungarian the spelling of \num{\mynum} is \begin{document} The -\@whilenum\value{mycount}<31 +\@whilenum\value{mycount}<51 \do{\ordnumspell{\themycount}\stepcounter{mycount},\ }\dots \end{document} @@ -481,7 +504,7 @@ The \makeatletter \newcounter{mycount} The -\@whilenum\value{mycount}<31 +\@whilenum\value{mycount}<51 \do{\ordnumspell{\themycount}\stepcounter{mycount},\ }\dots \makeatother diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty b/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty new file mode 100644 index 00000000000..da1f9dc1780 --- /dev/null +++ b/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty @@ -0,0 +1,332 @@ +%% +%% `numspell-italian.sty' Italian 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-italian}[2017/09/30 v1.0 Italian language package for numspell] + +%% GROUP NAMES +\def\numspell@group@ii@it@name{\numspell@{mille}} +\def\numspell@group@iii@it@name{\numspell@{milione}} +\def\numspell@group@iv@it@name{\numspell@{miliardo}} +\def\numspell@group@v@it@name{\numspell@{bilione}} +\def\numspell@group@vi@it@name{\numspell@{biliardo}} +\def\numspell@group@vii@it@name{\numspell@{trilione}} +\def\numspell@group@viii@it@name{\numspell@{triliardo}} +\def\numspell@group@ix@it@name{\numspell@{quadrilione}} +\def\numspell@group@x@it@name{\numspell@{quadriliardo}} +\def\numspell@group@xi@it@name{\numspell@{quintilione}} +\def\numspell@group@xii@it@name{\numspell@{quintiliardo}} +\def\numspell@group@xiii@it@name{\numspell@{sextilione}} +\def\numspell@group@xiv@it@name{\numspell@{sextiliardo}} +\def\numspell@group@xv@it@name{\numspell@{septilione}} +\def\numspell@group@xvi@it@name{\numspell@{septiliardo}} +\def\numspell@group@xvii@it@name{\numspell@{octilione}} +\def\numspell@group@xviii@it@name{\numspell@{octiliardo}} +\def\numspell@group@xix@it@name{\numspell@{nonilione}} +\def\numspell@group@xx@it@name{\numspell@{noniliardo}} +\def\numspell@group@xxi@it@name{\numspell@{decilione}} +\def\numspell@group@xxii@it@name{\numspell@{deciliardo}} + +%% GROUP NAMES (PLURAL) +\def\numspell@group@ii@it@name@plural{\numspell@{mila}} +\def\numspell@group@iii@it@name@plural{\numspell@{milioni}} +\def\numspell@group@iv@it@name@plural{\numspell@{miliardi}} +\def\numspell@group@v@it@name@plural{\numspell@{bilioni}} +\def\numspell@group@vi@it@name@plural{\numspell@{biliardi}} +\def\numspell@group@vii@it@name@plural{\numspell@{trilioni}} +\def\numspell@group@viii@it@name@plural{\numspell@{triliardi}} +\def\numspell@group@ix@it@name@plural{\numspell@{quadrilioni}} +\def\numspell@group@x@it@name@plural{\numspell@{quadriliardi}} +\def\numspell@group@xi@it@name@plural{\numspell@{quintilioni}} +\def\numspell@group@xii@it@name@plural{\numspell@{quintiliardi}} +\def\numspell@group@xiii@it@name@plural{\numspell@{sextilioni}} +\def\numspell@group@xiv@it@name@plural{\numspell@{sextiliardi}} +\def\numspell@group@xv@it@name@plural{\numspell@{septilioni}} +\def\numspell@group@xvi@it@name@plural{\numspell@{septiliardi}} +\def\numspell@group@xvii@it@name@plural{\numspell@{octilioni}} +\def\numspell@group@xviii@it@name@plural{\numspell@{octiliardi}} +\def\numspell@group@xix@it@name@plural{\numspell@{nonilioni}} +\def\numspell@group@xx@it@name@plural{\numspell@{noniliardi}} +\def\numspell@group@xxi@it@name@plural{\numspell@{decilioni}} +\def\numspell@group@xxii@it@name@plural{\numspell@{deciliardi}} + +%% ORDINAL GROUP NAMES +\def\numspell@ordgroup@ii@it@name{\numspell@{millesim}} +\def\numspell@ordgroup@iii@it@name{\numspell@{milionesim}} +\def\numspell@ordgroup@iv@it@name{\numspell@{miliardesim}} +\def\numspell@ordgroup@v@it@name{\numspell@{bilionesim}} +\def\numspell@ordgroup@vi@it@name{\numspell@{biliardesim}} +\def\numspell@ordgroup@vii@it@name{\numspell@{trilionesim}} +\def\numspell@ordgroup@viii@it@name{\numspell@{triliardesim}} +\def\numspell@ordgroup@ix@it@name{\numspell@{quadrilionesim}} +\def\numspell@ordgroup@x@it@name{\numspell@{quadriliardesim}} +\def\numspell@ordgroup@xi@it@name{\numspell@{quintilionesim}} +\def\numspell@ordgroup@xii@it@name{\numspell@{quintiliardesim}} +\def\numspell@ordgroup@xiii@it@name{\numspell@{sextilionesim}} +\def\numspell@ordgroup@xiv@it@name{\numspell@{sextiliardesim}} +\def\numspell@ordgroup@xv@it@name{\numspell@{septilionesim}} +\def\numspell@ordgroup@xvi@it@name{\numspell@{septiliardesim}} +\def\numspell@ordgroup@xvii@it@name{\numspell@{octilionesim}} +\def\numspell@ordgroup@xviii@it@name{\numspell@{octiliardesim}} +\def\numspell@ordgroup@xix@it@name{\numspell@{nonilionesim}} +\def\numspell@ordgroup@xx@it@name{\numspell@{noniliardesim}} +\def\numspell@ordgroup@xxi@it@name{\numspell@{decilionesim}} +\def\numspell@ordgroup@xxii@it@name{\numspell@{deciliardesim}} + +%% GENDER +\def\numspellitmasculine{\def\numspell@it@gender{\numspell@{o}}} +\def\numspellitfeminine{\def\numspell@it@gender{\numspell@{a}}} +\numspellitmasculine + +%% SPELLING CARDINAL NUMBER GROUP +%% --------------------------------- +%% \numspell@group@spell@it{<group>} (<group>=000,001,...,999) +%% --------------------------------- +%% \numspell@group@digits{<group>} +%% Adding the <group> spelling to \thenumspell +%% +\def\numspell@group@spell@it#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\or\numspell@{due}\or\numspell@{tre}\or\numspell@{quattro}\or\numspell@{cinque}% + \or\numspell@{sei}\or\numspell@{sette}\or\numspell@{otto}\or\numspell@{nove}% + \fi% + \ifnum\numspell@group@digit@i>0% + \numspell@{cent}% + \ifnum\numspell@group@digit@ii=8\else% + \numspell@{o}% + \fi% + \fi% + \ifcase\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii% + \or\or\numspell@{due}\or\or\numspell@{quattro}\or\numspell@{cinque}\or\numspell@{sei}\or\numspell@{sette}% + \or\numspell@{otto}\or\numspell@{nove}\or\numspell@{dieci}\or\numspell@{undici}\or\numspell@{dodici}% + \or\numspell@{tredici}\or\numspell@{quattordici}\or\numspell@{quindici}\or\numspell@{sedici}% + \or\numspell@{diciassette}\or\numspell@{diciotto}\or\numspell@{diciannove}\or\numspell@{venti}% + \or\numspell@{ventuno}\or\numspell@{ventidue}\or\numspell@{ventitr\'{e}}\or\numspell@{ventiquattro}% + \or\numspell@{venticinque}\or\numspell@{ventisei}\or\numspell@{ventisette}\or\numspell@{ventotto}\or\numspell@{ventinove}% + \fi% + \ifcase\numspell@group@digit@ii% + \or\or\or\numspell@{trent}\or\numspell@{quarant}\or\numspell@{cinquant}\or\numspell@{sessant}% + \or\numspell@{settant}\or\numspell@{ottant}\or\numspell@{novant}% + \fi% + \ifnum\numspell@group@digit@ii>2% + \ifcase\numspell@group@digit@iii% + \numspell@{a}\or\numspell@{uno}\or\numspell@{adue}\or\numspell@{atr\'{e}}\or\numspell@{aquattro}% + \or\numspell@{acinque}\or\numspell@{asei}\or\numspell@{asette}\or\numspell@{otto}\or\numspell@{anove}% + \fi% + \fi% + \ifnum\numspell@group@digit@i>0% + \ifnum\numspell@group@digit@ii=0% + \ifcase\numspell@group@digit@iii% + \or\numspell@{uno}\or\or\numspell@{tr\'{e}}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr\numspell@group@digit@i+\numspell@group@digit@ii=0% + \ifcase\numspell@group@digit@iii% + \or\or\or\numspell@{tre}% + \fi% + \fi% +} + +%% SPELLING ORDINAL NUMBER GROUP +%% ------------------------------------ +%% \numspell@ordgroup@spell@it{<group>} (<group>=000,001,...,999) +%% ------------------------------------ +%% \numspell@group@digits{<group>} +%% Adding the <group> ordinal spelling to \thenumspell +%% +\def\numspell@ordgroup@spell@it#1{% + \numspell@group@digits{#1}% + \ifcase\numspell@group@digit@i% + \or\or\numspell@{due}\or\numspell@{tre}\or\numspell@{quattro}\or\numspell@{cinque}% + \or\numspell@{sei}\or\numspell@{sette}\or\numspell@{otto}\or\numspell@{nove}% + \fi% + \ifnum\numspell@group@digit@i>0% + \numspell@{cent}% + \ifnum\numspell@group@digit@ii=8\else% + \ifnum\number\numexpr\numspell@group@digit@ii+\numspell@group@digit@iii>0\numspell@{o}\fi% + \fi% + \fi% + \ifcase\number\numexpr10*\numspell@group@digit@ii+\numspell@group@digit@iii% + \or\or\numspell@{du}\or\or\numspell@{quattr}\or\numspell@{cinqu}\or\numspell@{sei}\or\numspell@{sett}% + \or\numspell@{ott}\or\numspell@{nov}\or\numspell@{diec}\or\numspell@{undic}\or\numspell@{dodic}% + \or\numspell@{tredic}\or\numspell@{quattordic}\or\numspell@{quindic}\or\numspell@{sedic}% + \or\numspell@{diciassett}\or\numspell@{diciott}\or\numspell@{diciannov}\or\numspell@{vent}% + \or\numspell@{ventun}\or\numspell@{ventidu}\or\numspell@{ventitre}\or\numspell@{ventiquattr}% + \or\numspell@{venticinqu}\or\numspell@{ventisei}\or\numspell@{ventisett}\or\numspell@{ventott}\or\numspell@{ventinov}% + \fi% + \ifcase\numspell@group@digit@ii% + \or\or\or\numspell@{trent}\or\numspell@{quarant}\or\numspell@{cinquant}\or\numspell@{sessant}% + \or\numspell@{settant}\or\numspell@{ottant}\or\numspell@{novant}% + \fi% + \ifnum\numspell@group@digit@ii>2% + \ifcase\numspell@group@digit@iii% + \or\numspell@{un}\or\numspell@{adu}\or\numspell@{atre}\or\numspell@{aquattr}% + \or\numspell@{acinqu}\or\numspell@{asei}\or\numspell@{asett}\or\numspell@{ott}\or\numspell@{anov}% + \fi% + \fi% + \ifnum\numspell@group@digit@i>0% + \ifnum\numspell@group@digit@ii=0% + \ifcase\numspell@group@digit@iii% + \or\numspell@{un}\or\or\numspell@{tre}% + \fi% + \fi% + \fi% + \ifnum\number\numexpr\numspell@group@digit@i+\numspell@group@digit@ii=0% + \ifcase\numspell@group@digit@iii% + \or\or\or\numspell@{tre}% + \fi% + \fi% +} + +%% SPELLING CARDINAL NUMBER +%% -------------------------------------- +%% \numspell@num@spell@it{<num1>}{<num2>} +%% -------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num spelling to \thenumspell +%% +\def\numspell@num@spell@it#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@it{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \numspell@{ }% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}% + {\csname numspell@group@\roman{numspell@groupcount}@it@name\endcsname}% + {\csname numspell@group@\roman{numspell@groupcount}@it@name@plural\endcsname}% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname>0\numspell@{ }\fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \numspell@group@spell@it{\numspell@group@ii}% + \IfEq{\numspell@group@ii}{1}{\numspell@group@ii@it@name}{\numspell@group@ii@it@name@plural}% + \numspell@group@digits{\numspell@group@ii}% + \ifnum\numspell@group@digit@i>0\ifnum\number\numexpr\numspell@group@digit@ii+\numspell@group@digit@iii>0% + \ifnum\numspell@group@ii@before>0\numspell@{ }\fi% + \fi\fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \IfEq{\numspell@group@i}{1}{\numspell@{uno}}{}% + \ifnum\numspell@group@max>1% + \IfEq{\numspell@group@i}{3}{\numspell@{tr\'{e}}}{\numspell@group@spell@it{\numspell@group@i}}% + \else% + \numspell@group@spell@it{\numspell@group@i}% + \fi% + }% + \ifnum\numspell@group@max=0\numspell@{zero}\fi% +} + +%% SPELLING ORDINAL NUMBER +%% ----------------------------------------- +%% \numspell@ordnum@spell@it{<num1>}{<num2>} +%% ----------------------------------------- +%% \numspell@groups{<num1>}{<num2>} +%% Adding the \numspell@num ordinal spelling to \thenumspell +%% +\def\numspell@ordnum@spell@it#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@it{\csname numspell@group@\roman{numspell@groupcount}\endcsname}% + \numspell@{ }% + \ifnum\csname numspell@group@\roman{numspell@groupcount}@before\endcsname>0% + \IfEq{\csname numspell@group@\roman{numspell@groupcount}\endcsname}{1}% + {\csname numspell@group@\roman{numspell@groupcount}@it@name\endcsname}% + {\csname numspell@group@\roman{numspell@groupcount}@it@name@plural\endcsname}% + \numspell@{ }% + \else% + \csname numspell@ordgroup@\roman{numspell@groupcount}@it@name\endcsname% + \numspell@it@gender% + \fi% + }% + \addtocounter{numspell@groupcount}{-1}% + }% + \IfEq{\numspell@group@ii}{0}{}{% + \numspell@group@spell@it{\numspell@group@ii}% + \ifnum\numspell@group@ii@before>0% + \IfEq{\numspell@group@ii}{1}{\numspell@group@ii@it@name}{\numspell@group@ii@it@name@plural}% + \else% + \numspell@ordgroup@ii@it@name% + \numspell@it@gender% + \fi% + \numspell@group@digits{\numspell@group@ii}% + \ifnum\numspell@group@digit@i>0\ifnum\number\numexpr\numspell@group@digit@ii+\numspell@group@digit@iii>0% + \ifnum\numspell@group@ii@before>0\numspell@{ }\fi% + \fi\fi% + }% + \IfEq{\numspell@group@i}{0}{}{% + \ifnum\numspell@group@max>1% + \IfEq{\numspell@group@i}{1}{\numspell@{un}}{}% + \numspell@ordgroup@spell@it{\numspell@group@i}% + \numspell@{esim}% + \numspell@it@gender% + \else% + \ifcase\numspell@group@i% + \or\numspell@{prim}\or\numspell@{second}\or\numspell@{terz}\or\numspell@{quart}\or\numspell@{quint}% + \or\numspell@{sest}\or\numspell@{settim}\or\numspell@{ottav}\or\numspell@{non}\or\numspell@{decim}% + \else% + \numspell@ordgroup@spell@it{\numspell@group@i}% + \numspell@{esim}% + \fi% + \numspell@it@gender% + \fi% + }% + \ifnum\numspell@group@max=0\numspell@{zeresim}\numspell@it@gender\fi% +} + +%% ---------------------- +%% \numspell@uppercase@it +%% ---------------------- +%% E.g. \def\thenumspell{uno}\numspell@uppercase\thenumspell --> 'Uno' +%% \MakeUppercase does not work on pdf bookmark (see hyperref), so using another effective macro. +%% +\def\numspell@uppercase@it{% + \fullexpandarg% + \StrChar{\thenumspell}{1}[\numspell@firstletter]% + \expandarg% + \StrGobbleLeft{\thenumspell}{1}[\numspell@trunc]% + \fullexpandarg% + \def\numspell@the{}% + \IfStrEq{\numspell@firstletter}{u}{\g@addto@macro\numspell@the{U}}{}% uno + \IfStrEq{\numspell@firstletter}{d}{\g@addto@macro\numspell@the{D}}{}% due + \IfStrEq{\numspell@firstletter}{t}{\g@addto@macro\numspell@the{T}}{}% tre + \IfStrEq{\numspell@firstletter}{q}{\g@addto@macro\numspell@the{Q}}{}% quattro + \IfStrEq{\numspell@firstletter}{c}{\g@addto@macro\numspell@the{C}}{}% cinque + \IfStrEq{\numspell@firstletter}{s}{\g@addto@macro\numspell@the{S}}{}% sei + \IfStrEq{\numspell@firstletter}{o}{\g@addto@macro\numspell@the{O}}{}% otto + \IfStrEq{\numspell@firstletter}{n}{\g@addto@macro\numspell@the{N}}{}% nove + \IfStrEq{\numspell@firstletter}{v}{\g@addto@macro\numspell@the{V}}{}% venti + \IfStrEq{\numspell@firstletter}{m}{\g@addto@macro\numspell@the{M}}{}% mille + \IfStrEq{\numspell@firstletter}{z}{\g@addto@macro\numspell@the{Z}}{}% zero + \IfStrEq{\numspell@firstletter}{p}{\g@addto@macro\numspell@the{P}}{}% primo + \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 index 1b860796e25..3fd2fcc1788 100644 --- a/Master/texmf-dist/tex/latex/numspell/numspell.sty +++ b/Master/texmf-dist/tex/latex/numspell/numspell.sty @@ -18,7 +18,7 @@ %% The Current Maintainer of this work is Tibor Tomacs. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{numspell}[2017/09/20 v1.1 Package for spelling cardinal and ordinal numbers] +\ProvidesPackage{numspell}[2017/09/30 v1.2 Package for spelling cardinal and ordinal numbers] \RequirePackage{xstring} \RequirePackage{pdftexcmds} @@ -230,6 +230,7 @@ %% If magyar is active, then \numspell@langname will be 'hu'. %% If german or ngerman is active, then \numspell@langname will be 'de'. %% If french is active, then \numspell@langname will be 'fr'. +%% If italian is active, then \numspell@langname will be 'it'. %% Otherwise error. %% \newif\if@numspell@lang@notsupported@ @@ -240,6 +241,7 @@ \ifnum\pdf@strcmp{\languagename}{german}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{de}\fi% \ifnum\pdf@strcmp{\languagename}{ngerman}=\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% + \ifnum\pdf@strcmp{\languagename}{italian}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{it}\fi% \if@numspell@lang@notsupported@\@latexerr{'numspell.sty' error! Not supported language: \languagename}{}\fi% } @@ -250,6 +252,7 @@ %% If babel or polyglossia loads magyar, then numspell loads numspell-magyar.sty. %% If babel or polyglossia loads german or ngerman, then numspell loads numspell-german.sty. %% If babel or polyglossia loads french, then numspell loads numspell-french.sty. +%% If babel or polyglossia loads italian, then numspell loads numspell-italian.sty. %% Otherwise numspell loads numspell-english.sty. %% \AtEndPreamble{% @@ -259,6 +262,7 @@ \bbl@iflanguage\languagename{\expandafter\ifx\csname dategerman\endcsname\relax\else\RequirePackage{numspell-german}\@numspell@lang@loaded@true\fi}% \bbl@iflanguage\languagename{\expandafter\ifx\csname datengerman\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}% +\bbl@iflanguage\languagename{\expandafter\ifx\csname dateitalian\endcsname\relax\else\RequirePackage{numspell-italian}\@numspell@lang@loaded@true\fi}% \if@numspell@lang@loaded@\else\RequirePackage{numspell-english}\fi% } |