texlive[45441] Master/texmf-dist: numspell (30sep17)

commits+karl at tug.org commits+karl at tug.org
Sun Oct 1 01:09:21 CEST 2017


Revision: 45441
          http://tug.org/svn/texlive?view=revision&revision=45441
Author:   karl
Date:     2017-10-01 01:09:21 +0200 (Sun, 01 Oct 2017)
Log Message:
-----------
numspell (30sep17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/numspell/README
    trunk/Master/texmf-dist/doc/latex/numspell/numspell.pdf
    trunk/Master/texmf-dist/doc/latex/numspell/numspell.tex
    trunk/Master/texmf-dist/tex/latex/numspell/numspell.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty

Modified: trunk/Master/texmf-dist/doc/latex/numspell/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/numspell/README	2017-09-30 23:08:42 UTC (rev 45440)
+++ trunk/Master/texmf-dist/doc/latex/numspell/README	2017-09-30 23:09:21 UTC (rev 45441)
@@ -2,8 +2,8 @@
 
 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 @@
 README (this file)
 numspell.sty (main package file)
 numspell-english.sty (English package for numspell)
+numspell-french.sty (French package for numspell)
 numspell-german.sty (German package for numspell)
-numspell-french.sty (French 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

Modified: trunk/Master/texmf-dist/doc/latex/numspell/numspell.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/numspell/numspell.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/numspell/numspell.tex	2017-09-30 23:08:42 UTC (rev 45440)
+++ trunk/Master/texmf-dist/doc/latex/numspell/numspell.tex	2017-09-30 23:09:21 UTC (rev 45441)
@@ -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 @@
 
 \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 at uni-eszterhazy.hu}}}
 \date{}
 \maketitle
@@ -60,7 +60,7 @@
 \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,6 +388,21 @@
 \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}
@@ -394,7 +409,7 @@
 \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,12 +417,16 @@
 \def\mynum{123456789}
 
 \noindent
+In American English the spelling of \num{\mynum} is
+{\numspellUS\emph{``\numspell{\mynum}''}}.
+
+\smallskip\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}''}}.
+In French the spelling of \num{\mynum} is
+{\selectlanguage{french}\emph{``\numspell{\mynum}''}}.
 
 \smallskip\noindent
 In German the spelling of \num{\mynum} is
@@ -414,13 +433,13 @@
 {\selectlanguage{ngerman}\emph{``\numspell{\mynum}''}}.
 
 \smallskip\noindent
-In French the spelling of \num{\mynum} is
-{\selectlanguage{french}\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}
 
@@ -427,15 +446,11 @@
 \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
@@ -442,9 +457,17 @@
 {\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 @@
 \begin{document}
 
 The
-\@whilenum\value{mycount}<31
+\@whilenum\value{mycount}<51
 \do{\ordnumspell{\themycount}\stepcounter{mycount},\ }\dots
 
 \end{document}
@@ -481,7 +504,7 @@
 \makeatletter
 \newcounter{mycount}
 The
-\@whilenum\value{mycount}<31
+\@whilenum\value{mycount}<51
 \do{\ordnumspell{\themycount}\stepcounter{mycount},\ }\dots
 \makeatother
 

Added: trunk/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty	2017-09-30 23:09:21 UTC (rev 45441)
@@ -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 at group@ii at it@name{\numspell@{mille}}
+\def\numspell at group@iii at it@name{\numspell@{milione}}
+\def\numspell at group@iv at it@name{\numspell@{miliardo}}
+\def\numspell at group@v at it@name{\numspell@{bilione}}
+\def\numspell at group@vi at it@name{\numspell@{biliardo}}
+\def\numspell at group@vii at it@name{\numspell@{trilione}}
+\def\numspell at group@viii at it@name{\numspell@{triliardo}}
+\def\numspell at group@ix at it@name{\numspell@{quadrilione}}
+\def\numspell at group@x at it@name{\numspell@{quadriliardo}}
+\def\numspell at group@xi at it@name{\numspell@{quintilione}}
+\def\numspell at group@xii at it@name{\numspell@{quintiliardo}}
+\def\numspell at group@xiii at it@name{\numspell@{sextilione}}
+\def\numspell at group@xiv at it@name{\numspell@{sextiliardo}}
+\def\numspell at group@xv at it@name{\numspell@{septilione}}
+\def\numspell at group@xvi at it@name{\numspell@{septiliardo}}
+\def\numspell at group@xvii at it@name{\numspell@{octilione}}
+\def\numspell at group@xviii at it@name{\numspell@{octiliardo}}
+\def\numspell at group@xix at it@name{\numspell@{nonilione}}
+\def\numspell at group@xx at it@name{\numspell@{noniliardo}}
+\def\numspell at group@xxi at it@name{\numspell@{decilione}}
+\def\numspell at group@xxii at it@name{\numspell@{deciliardo}}
+
+%% GROUP NAMES (PLURAL)
+\def\numspell at group@ii at it@name at plural{\numspell@{mila}}
+\def\numspell at group@iii at it@name at plural{\numspell@{milioni}}
+\def\numspell at group@iv at it@name at plural{\numspell@{miliardi}}
+\def\numspell at group@v at it@name at plural{\numspell@{bilioni}}
+\def\numspell at group@vi at it@name at plural{\numspell@{biliardi}}
+\def\numspell at group@vii at it@name at plural{\numspell@{trilioni}}
+\def\numspell at group@viii at it@name at plural{\numspell@{triliardi}}
+\def\numspell at group@ix at it@name at plural{\numspell@{quadrilioni}}
+\def\numspell at group@x at it@name at plural{\numspell@{quadriliardi}}
+\def\numspell at group@xi at it@name at plural{\numspell@{quintilioni}}
+\def\numspell at group@xii at it@name at plural{\numspell@{quintiliardi}}
+\def\numspell at group@xiii at it@name at plural{\numspell@{sextilioni}}
+\def\numspell at group@xiv at it@name at plural{\numspell@{sextiliardi}}
+\def\numspell at group@xv at it@name at plural{\numspell@{septilioni}}
+\def\numspell at group@xvi at it@name at plural{\numspell@{septiliardi}}
+\def\numspell at group@xvii at it@name at plural{\numspell@{octilioni}}
+\def\numspell at group@xviii at it@name at plural{\numspell@{octiliardi}}
+\def\numspell at group@xix at it@name at plural{\numspell@{nonilioni}}
+\def\numspell at group@xx at it@name at plural{\numspell@{noniliardi}}
+\def\numspell at group@xxi at it@name at plural{\numspell@{decilioni}}
+\def\numspell at group@xxii at it@name at plural{\numspell@{deciliardi}}
+
+%% ORDINAL GROUP NAMES
+\def\numspell at ordgroup@ii at it@name{\numspell@{millesim}}
+\def\numspell at ordgroup@iii at it@name{\numspell@{milionesim}}
+\def\numspell at ordgroup@iv at it@name{\numspell@{miliardesim}}
+\def\numspell at ordgroup@v at it@name{\numspell@{bilionesim}}
+\def\numspell at ordgroup@vi at it@name{\numspell@{biliardesim}}
+\def\numspell at ordgroup@vii at it@name{\numspell@{trilionesim}}
+\def\numspell at ordgroup@viii at it@name{\numspell@{triliardesim}}
+\def\numspell at ordgroup@ix at it@name{\numspell@{quadrilionesim}}
+\def\numspell at ordgroup@x at it@name{\numspell@{quadriliardesim}}
+\def\numspell at ordgroup@xi at it@name{\numspell@{quintilionesim}}
+\def\numspell at ordgroup@xii at it@name{\numspell@{quintiliardesim}}
+\def\numspell at ordgroup@xiii at it@name{\numspell@{sextilionesim}}
+\def\numspell at ordgroup@xiv at it@name{\numspell@{sextiliardesim}}
+\def\numspell at ordgroup@xv at it@name{\numspell@{septilionesim}}
+\def\numspell at ordgroup@xvi at it@name{\numspell@{septiliardesim}}
+\def\numspell at ordgroup@xvii at it@name{\numspell@{octilionesim}}
+\def\numspell at ordgroup@xviii at it@name{\numspell@{octiliardesim}}
+\def\numspell at ordgroup@xix at it@name{\numspell@{nonilionesim}}
+\def\numspell at ordgroup@xx at it@name{\numspell@{noniliardesim}}
+\def\numspell at ordgroup@xxi at it@name{\numspell@{decilionesim}}
+\def\numspell at ordgroup@xxii at it@name{\numspell@{deciliardesim}}
+
+%% GENDER
+\def\numspellitmasculine{\def\numspell at it@gender{\numspell@{o}}}
+\def\numspellitfeminine{\def\numspell at it@gender{\numspell@{a}}}
+\numspellitmasculine
+
+%% SPELLING CARDINAL NUMBER GROUP
+%% ---------------------------------
+%% \numspell at group@spell at it{<group>} (<group>=000,001,...,999)
+%% ---------------------------------
+%% \numspell at group@digits{<group>}
+%% Adding the <group> spelling to \thenumspell
+%%
+\def\numspell at group@spell at it#1{%
+    \numspell at group@digits{#1}%
+    \ifcase\numspell at group@digit at 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 at group@digit at i>0%
+        \numspell@{cent}%
+        \ifnum\numspell at group@digit at ii=8\else%
+            \numspell@{o}%
+        \fi%
+    \fi%
+    \ifcase\number\numexpr10*\numspell at group@digit at ii+\numspell at group@digit at 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 at group@digit at 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 at group@digit at ii>2%
+        \ifcase\numspell at group@digit at 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 at group@digit at i>0%
+        \ifnum\numspell at group@digit at ii=0%
+            \ifcase\numspell at group@digit at iii%
+                \or\numspell@{uno}\or\or\numspell@{tr\'{e}}%
+            \fi%
+        \fi%
+    \fi%
+    \ifnum\number\numexpr\numspell at group@digit at i+\numspell at group@digit at ii=0%
+        \ifcase\numspell at group@digit at iii%
+            \or\or\or\numspell@{tre}%
+        \fi%
+    \fi%
+}
+
+%% SPELLING ORDINAL NUMBER GROUP
+%% ------------------------------------
+%% \numspell at ordgroup@spell at it{<group>} (<group>=000,001,...,999)
+%% ------------------------------------
+%% \numspell at group@digits{<group>}
+%% Adding the <group> ordinal spelling to \thenumspell
+%%
+\def\numspell at ordgroup@spell at it#1{%
+    \numspell at group@digits{#1}%
+    \ifcase\numspell at group@digit at 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 at group@digit at i>0%
+        \numspell@{cent}%
+        \ifnum\numspell at group@digit at ii=8\else%
+            \ifnum\number\numexpr\numspell at group@digit at ii+\numspell at group@digit at iii>0\numspell@{o}\fi%
+        \fi%
+    \fi%
+    \ifcase\number\numexpr10*\numspell at group@digit at ii+\numspell at group@digit at 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 at group@digit at 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 at group@digit at ii>2%
+        \ifcase\numspell at group@digit at 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 at group@digit at i>0%
+        \ifnum\numspell at group@digit at ii=0%
+            \ifcase\numspell at group@digit at iii%
+                \or\numspell@{un}\or\or\numspell@{tre}%
+            \fi%
+        \fi%
+    \fi%
+    \ifnum\number\numexpr\numspell at group@digit at i+\numspell at group@digit at ii=0%
+        \ifcase\numspell at group@digit at iii%
+            \or\or\or\numspell@{tre}%
+        \fi%
+    \fi%
+}
+
+%% SPELLING CARDINAL NUMBER
+%% --------------------------------------
+%% \numspell at num@spell at it{<num1>}{<num2>}
+%% --------------------------------------
+%% \numspell at groups{<num1>}{<num2>}
+%% Adding the \numspell at num spelling to \thenumspell
+%%
+\def\numspell at num@spell at it#1#2{%
+    \gdef\thenumspell{}%
+    \numspell at groups{#1}{#2}%
+    \setcounter{numspell at groupcount}{22}%
+    \@whilenum\value{numspell at groupcount}>2%
+    \do{%
+        \IfEq{\csname numspell at group@\roman{numspell at groupcount}\endcsname}{0}{}{%
+            \IfEq{\csname numspell at group@\roman{numspell at groupcount}\endcsname}{1}{\numspell@{un}}{}%
+            \numspell at group@spell at it{\csname numspell at group@\roman{numspell at groupcount}\endcsname}%
+            \numspell@{ }%
+            \IfEq{\csname numspell at group@\roman{numspell at groupcount}\endcsname}{1}%
+                {\csname numspell at group@\roman{numspell at groupcount}@it at name\endcsname}%
+                {\csname numspell at group@\roman{numspell at groupcount}@it at name@plural\endcsname}%
+            \ifnum\csname numspell at group@\roman{numspell at groupcount}@before\endcsname>0\numspell@{ }\fi%
+        }%
+        \addtocounter{numspell at groupcount}{-1}%
+    }%
+    \IfEq{\numspell at group@ii}{0}{}{%
+        \numspell at group@spell at it{\numspell at group@ii}%
+        \IfEq{\numspell at group@ii}{1}{\numspell at group@ii at it@name}{\numspell at group@ii at it@name at plural}%
+        \numspell at group@digits{\numspell at group@ii}%
+        \ifnum\numspell at group@digit at i>0\ifnum\number\numexpr\numspell at group@digit at ii+\numspell at group@digit at iii>0%
+            \ifnum\numspell at group@ii at before>0\numspell@{ }\fi%
+        \fi\fi%
+    }%
+    \IfEq{\numspell at group@i}{0}{}{%
+        \IfEq{\numspell at group@i}{1}{\numspell@{uno}}{}%
+        \ifnum\numspell at group@max>1%
+            \IfEq{\numspell at group@i}{3}{\numspell@{tr\'{e}}}{\numspell at group@spell at it{\numspell at group@i}}%
+        \else%
+            \numspell at group@spell at it{\numspell at group@i}%
+        \fi%
+    }%
+    \ifnum\numspell at group@max=0\numspell@{zero}\fi%
+}
+
+%% SPELLING ORDINAL NUMBER
+%% -----------------------------------------
+%% \numspell at ordnum@spell at it{<num1>}{<num2>}
+%% -----------------------------------------
+%% \numspell at groups{<num1>}{<num2>}
+%% Adding the \numspell at num ordinal spelling to \thenumspell
+%%
+\def\numspell at ordnum@spell at it#1#2{%
+    \gdef\thenumspell{}%
+    \numspell at groups{#1}{#2}%
+    \setcounter{numspell at groupcount}{22}%
+    \@whilenum\value{numspell at groupcount}>2%
+    \do{%
+        \IfEq{\csname numspell at group@\roman{numspell at groupcount}\endcsname}{0}{}{%
+            \IfEq{\csname numspell at group@\roman{numspell at groupcount}\endcsname}{1}{\numspell@{un}}{}%
+            \numspell at group@spell at it{\csname numspell at group@\roman{numspell at groupcount}\endcsname}%
+            \numspell@{ }%
+            \ifnum\csname numspell at group@\roman{numspell at groupcount}@before\endcsname>0%
+                \IfEq{\csname numspell at group@\roman{numspell at groupcount}\endcsname}{1}%
+                    {\csname numspell at group@\roman{numspell at groupcount}@it at name\endcsname}%
+                    {\csname numspell at group@\roman{numspell at groupcount}@it at name@plural\endcsname}%
+                \numspell@{ }%
+            \else%
+                \csname numspell at ordgroup@\roman{numspell at groupcount}@it at name\endcsname%
+                \numspell at it@gender%
+            \fi%
+        }%
+        \addtocounter{numspell at groupcount}{-1}%
+    }%
+    \IfEq{\numspell at group@ii}{0}{}{%
+        \numspell at group@spell at it{\numspell at group@ii}%
+        \ifnum\numspell at group@ii at before>0%
+            \IfEq{\numspell at group@ii}{1}{\numspell at group@ii at it@name}{\numspell at group@ii at it@name at plural}%
+        \else%
+            \numspell at ordgroup@ii at it@name%
+            \numspell at it@gender%
+        \fi%
+        \numspell at group@digits{\numspell at group@ii}%
+        \ifnum\numspell at group@digit at i>0\ifnum\number\numexpr\numspell at group@digit at ii+\numspell at group@digit at iii>0%
+            \ifnum\numspell at group@ii at before>0\numspell@{ }\fi%
+        \fi\fi%
+    }%
+    \IfEq{\numspell at group@i}{0}{}{%
+        \ifnum\numspell at group@max>1%
+            \IfEq{\numspell at group@i}{1}{\numspell@{un}}{}%
+            \numspell at ordgroup@spell at it{\numspell at group@i}%
+            \numspell@{esim}%
+            \numspell at it@gender%
+        \else%
+            \ifcase\numspell at 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 at ordgroup@spell at it{\numspell at group@i}%
+                \numspell@{esim}%
+            \fi%
+            \numspell at it@gender%
+        \fi%
+    }%
+    \ifnum\numspell at group@max=0\numspell@{zeresim}\numspell at it@gender\fi%
+}
+
+%% ----------------------
+%% \numspell at uppercase@it
+%% ----------------------
+%% E.g. \def\thenumspell{uno}\numspell at uppercase\thenumspell --> 'Uno'
+%% \MakeUppercase does not work on pdf bookmark (see hyperref), so using another effective macro.
+%%
+\def\numspell at uppercase@it{%
+    \fullexpandarg%
+    \StrChar{\thenumspell}{1}[\numspell at firstletter]%
+    \expandarg%
+    \StrGobbleLeft{\thenumspell}{1}[\numspell at trunc]%
+    \fullexpandarg%
+    \def\numspell at the{}%
+    \IfStrEq{\numspell at firstletter}{u}{\g at addto@macro\numspell at the{U}}{}% uno
+    \IfStrEq{\numspell at firstletter}{d}{\g at addto@macro\numspell at the{D}}{}% due
+    \IfStrEq{\numspell at firstletter}{t}{\g at addto@macro\numspell at the{T}}{}% tre
+    \IfStrEq{\numspell at firstletter}{q}{\g at addto@macro\numspell at the{Q}}{}% quattro
+    \IfStrEq{\numspell at firstletter}{c}{\g at addto@macro\numspell at the{C}}{}% cinque
+    \IfStrEq{\numspell at firstletter}{s}{\g at addto@macro\numspell at the{S}}{}% sei
+    \IfStrEq{\numspell at firstletter}{o}{\g at addto@macro\numspell at the{O}}{}% otto
+    \IfStrEq{\numspell at firstletter}{n}{\g at addto@macro\numspell at the{N}}{}% nove
+    \IfStrEq{\numspell at firstletter}{v}{\g at addto@macro\numspell at the{V}}{}% venti
+    \IfStrEq{\numspell at firstletter}{m}{\g at addto@macro\numspell at the{M}}{}% mille
+    \IfStrEq{\numspell at firstletter}{z}{\g at addto@macro\numspell at the{Z}}{}% zero
+    \IfStrEq{\numspell at firstletter}{p}{\g at addto@macro\numspell at the{P}}{}% primo
+    \ifx\numspell at the\@empty\@latexerr{'numspell.sty' error! There is not '\numspell at firstletter' in uppercase!}{}\fi%
+    \g at addto@macro\numspell at the{\numspell at trunc}%
+    \def\thenumspell{\numspell at the}%
+}
+
+\endinput
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/numspell/numspell.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/numspell/numspell.sty	2017-09-30 23:08:42 UTC (rev 45440)
+++ trunk/Master/texmf-dist/tex/latex/numspell/numspell.sty	2017-09-30 23:09:21 UTC (rev 45441)
@@ -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 at langname will be 'hu'.
 %% If german or ngerman is active, then \numspell at langname will be 'de'.
 %% If french is active, then \numspell at langname will be 'fr'.
+%% If italian is active, then \numspell at langname will be 'it'.
 %% Otherwise error.
 %%
 \newif\if at numspell@lang at notsupported@
@@ -240,6 +241,7 @@
     \ifnum\pdf at strcmp{\languagename}{german}=\z@\@numspell at lang@notsupported at false\def\numspell at langname{de}\fi%
     \ifnum\pdf at strcmp{\languagename}{ngerman}=\z@\@numspell at lang@notsupported at false\def\numspell at langname{de}\fi%
     \ifnum\pdf at strcmp{\languagename}{french}=\z@\@numspell at lang@notsupported at false\def\numspell at langname{fr}\fi%
+    \ifnum\pdf at strcmp{\languagename}{italian}=\z@\@numspell at lang@notsupported at false\def\numspell at langname{it}\fi%
     \if at numspell@lang at 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 at iflanguage\languagename{\expandafter\ifx\csname dategerman\endcsname\relax\else\RequirePackage{numspell-german}\@numspell at lang@loaded at true\fi}%
 \bbl at iflanguage\languagename{\expandafter\ifx\csname datengerman\endcsname\relax\else\RequirePackage{numspell-german}\@numspell at lang@loaded at true\fi}%
 \bbl at iflanguage\languagename{\expandafter\ifx\csname datefrench\endcsname\relax\else\RequirePackage{numspell-french}\@numspell at lang@loaded at true\fi}%
+\bbl at iflanguage\languagename{\expandafter\ifx\csname dateitalian\endcsname\relax\else\RequirePackage{numspell-italian}\@numspell at lang@loaded at true\fi}%
 \if at numspell@lang at loaded@\else\RequirePackage{numspell-english}\fi%
 }
 



More information about the tex-live-commits mailing list