diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/itnumpar/itnumpar.sty | 222 |
1 files changed, 222 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/itnumpar/itnumpar.sty b/Master/texmf-dist/tex/latex/itnumpar/itnumpar.sty new file mode 100644 index 00000000000..00cc4bc2ad1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/itnumpar/itnumpar.sty @@ -0,0 +1,222 @@ +%% +%% This is file `itnumpar.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% itnumpar.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2007 by Enrico Gregorio <Enrico dot Gregorio (at) univr dot it> +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version +%% 1999/12/01 or later. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{itnumpar} + [2007/04/03 v1.0 Numbers in words for Italian] + +\def\numeroinparole#1{\expandafter\@numeroinparole\csname c@#1\endcsname} +\def\Numeroinparole#1{\expandafter\@Numeroinparole\csname c@#1\endcsname} +\def\ordinalem#1{\expandafter\@ordinalem\csname c@#1\endcsname} +\def\ordinalef#1{\expandafter\@ordinalef\csname c@#1\endcsname} +\def\Ordinalem#1{\expandafter\@Ordinalem\csname c@#1\endcsname} +\def\Ordinalef#1{\expandafter\@Ordinalef\csname c@#1\endcsname} +\begingroup +\def\np@doprintdef#1{% + \expandafter\xdef\csname print#1\endcsname##1{% + {\count@=##1\relax\csname @#1\endcsname{\count@}}}} + \np@doprintdef{numeroinparole} + \np@doprintdef{Numeroinparole} + \np@doprintdef{ordinalem} + \np@doprintdef{ordinalef} + \np@doprintdef{Ordinalem} + \np@doprintdef{Ordinalef} +\endgroup +\def\np@oa{o} +\let\@printnumeroinparole\printnumeroinparole +\def\printnumeroinparole{% + \@ifstar{\@printnumeroinparolef}{\@printnumeroinparole}% +} +\def\@printnumeroinparolef#1{{\def\np@oa{a}\printnumeroinparole{#1}}} +\def\@numeroinparole#1{% + \ifnum#1=0 zero% Exception + \else + \ifnum#1=3 tre% Exception + \else + \np@numeroinparole{#1}{}% + \fi\fi} +\def\@Numeroinparole#1{% + \ifnum#1=0 Zero% Exception + \else + \ifnum#1=3 Tre% Exception + \else + \np@Numeroinparole{#1}{}% + \fi\fi} +\def\np@numeroinparole#1#2{% + \ifnum#1>9999 + \@ctrerr + \else + \ifnum#1>999 + \expandafter\np@thousand\number#1 \np@del + \else + \ifnum#1>99 + \expandafter\np@hundred\number#1 \np@del + \else + \ifnum#1<30 + \np@small{#1}{#2}% + \else + \expandafter\np@large\number#1{#2}% + \fi\fi\fi\fi} +\def\np@Numeroinparole#1#2{% + \ifnum#1>9999 + \@ctrerr + \else + \ifnum#1>999 + \expandafter\np@Thousand\number#1 \np@del + \else + \ifnum#1>99 + \expandafter\np@Hundred\number#1 \np@del + \else + \ifnum#1<30 + \np@Small{#1}{#2}% + \else + \expandafter\np@Large\number#1{#2}% + \fi\fi\fi\fi} +\def\np@small#1#2{#2\ifcase#1 \or + un\np@oa\or due\or tr\'e\or quattro\or cinque\or + sei\or sette\or otto\or nove\or dieci\or + undici\or dodici\or tredici\or quattordici\or quindici\or + sedici\or diciassette\or diciotto\or diciannove\or venti\or + ventuno\or ventidue\or ventitr\'e\or ventiquattro\or venticinque\or + ventisei\or ventisette\or ventotto\or ventinove\fi} +\def\np@Small#1#2{\ifcase#1 \or + Uno\or Due\or\or Quattro\or Cinque\or Sei\or Sette\or + Otto\or Nove\or Dieci\or Undici\or Dodici\or Tredici\or + Quattordici\or Quindici\or Sedici\or Diciassette\or Diciotto\or + Diciannove\or Venti\or Ventuno\or Ventidue\or Ventitr\'e\or + Ventiquattro\or Venticinque\or Ventisei\or Ventisette\or + Ventotto\or Ventinove\fi} +\def\np@large#1#2#3{% + \ifcase#1 \or\or\or #3trent\or #3quarant\or #3cinquant\or + #3sessant\or #3settant\or ottant\or #3novant\fi + \ifcase#2 a\or un\np@oa\or adue\or atr\'e\or aquattro\or + acinque\or asei\or asette\or otto\or anove\fi} +\def\np@Large#1#2#3{% + \ifcase#1 \or\or\or Trent\or Quarant\or Cinquant\or + Sessant\or Settant\or Ottant\or Novant\fi + \ifcase#2 a\or uno\or adue\or atr\'e\or aquattro\or + acinque\or asei\or asette\or otto\or anove\fi} +\def\np@hundred#1#2\np@del{% + \ifcase#1 \or\or due\or tre\or quattro\or cinque\or + sei\or sette\or otto\or nove\fi cent% + \ifnum#2=0 o\else\np@numeroinparole{#2}{o}\fi} +\def\np@Hundred#1#2\np@del{% + \ifcase#1 \or Cent\or Duecent\or Trecent\or Quattrocent\or + Cinquecent\or Seicent\or Settecent\or Ottocent\or Novecent\fi + \ifnum#2=0 o\else\np@numeroinparole{#2}{o}\fi} +\def\np@thousand#1#2\np@del{% + \ifnum#1=1 mille\else + \ifcase#1 \or\or due\or tre\or quattro\or cinque\or + sei\or sette\or otto\or nove\fi mila\fi + \ifnum#2=0 \else\np@numeroinparole{#2}{}\fi} +\def\np@Thousand#1#2\np@del{% + \ifnum#1=1 + Mille% + \else + \ifcase#1 \or\or Due\or Tre\or Quattro\or Cinque\or + Sei\or Sette\or Otto\or Nove\fi + mila\fi + \ifnum#2=0 \else\np@numeroinparole{#2}{}\fi} +\def\@ordinalem#1{\np@ordinal{#1}{}o} +\def\@ordinalef#1{\np@ordinal{#1}{}a} +\def\@Ordinalem#1{\np@Ordinal{#1}{}o} +\def\@Ordinalef#1{\np@Ordinal{#1}{}a} +\def\np@ordinal#1#2{% + \ifnum#1=0 + \expandafter\@gobble + \else + \ifnum#1<11 + \ifcase#1 \or prim\or second\or terz\or quart\or quint\or + sest\or settim\or ottav\or non\or decim\fi + \else + \np@ordinall{#1}{#2}% + \fi\fi} +\def\np@ordinall#1#2{% + \ifnum#1>999 + \@ctrerr + \else + \ifnum#1>99 + \expandafter\np@hundredord\number#1 \np@del + \else + \ifnum#1<30 + \np@smallord{#1}{#2}% + \else + \expandafter\np@largeord\number#1{#2}% + \fi\fi\fi} +\def\np@Ordinal#1#2{% + \ifnum#1=0 + \expandafter\@gobble + \else + \ifnum#1<11 + \ifcase#1 \or Prim\or Second\or Terz\or Quart\or Quint\or + Sest\or Settim\or Ottav\or Non\or Decim\fi + \else\np@Ordinall{#1}{#2}\fi\fi} +\def\np@Ordinall#1#2{% + \ifnum#1>999 + \@ctrerr + \else + \ifnum#1>99 + \expandafter\np@hundredOrd\number#1 \np@del + \else + \ifnum#1<30 + \np@smallOrd{#1}{#2}% + \else + \expandafter\np@largeOrd\number#1{#2}% + \fi\fi\fi} +\def\np@smallord#1#2{% + \ifcase#1 \or un\or #2du\or #2tre\or #2quattr\or #2cinqu\or + #2sei\or #2sett\or ott\or #2nov\or \or #2undic\or + #2dodic\or #2tredic\or #2quattordic\or #2quindic\or + #2sedic\or #2diciassett\or #2diciott\or #2diciannov\or + #2vent\or #2ventun\or #2ventidu\or #2ventitre\or + #2ventiquattr\or #2venticinqu\or #2ventisei\or + #2ventisett\or #2ventott\or #2ventinov% + \fi esim} +\def\np@largeord#1#2#3{% + \ifcase#1 \or\or\or #3trent\or #3quarant\or #3cinquant\or + #3sessant\or #3settant\or ottant\or #3novant\fi + \ifcase#2 \or un\or adu\or atre\or aquattr\or + acinqu\or asei\or asett\or ott\or anov\fi esim} +\def\np@hundredord#1#2\np@del{% + \ifcase#1 \or\or due\or tre\or quattro\or cinque\or + sei\or sette\or otto\or nove\fi cent% + \ifnum#2=0 esim\else\np@ordinall{#2}{o}\fi} +\def\np@smallOrd#1{% + \ifcase#1 \or \or \or \or \or \or \or \or \or \or \or + Undicesim\or Dodicesim\or Tredicesim\or Quattordicesim\or + Quindicesim\or Sedicesim\or Diciassettesim\or Diciottesim\or + Diciannovesim\or Ventesim\or Ventunesim\or Ventiduesim\or + Ventitreesim\or Ventiquattresim\or Venticinquesim\or + Ventiseiesim\or Ventisettesim\or Ventottesim\or Ventinovesim% + \fi} +\def\np@largeOrd#1#2{% + \ifcase#1 \or\or\or Trent\or Quarant\or Cinquant\or + Sessant\or Settant\or Ottant\or Novant\fi + \ifcase#2 \or un\or adu\or atre\or aquattr\or + acinqu\or asei\or asett\or ott\or anov\fi esim} +\def\np@hundredOrd#1#2\np@del{% + \ifcase#1 \or C\or Duec\or Trec\or Quattroc\or Cinquec\or + Seic\or Settec\or Ottoc\or Novec\fi ent% + \ifnum#2=0 esim\else\np@ordinall{#2}{o}\fi} +\endinput +%% +%% End of file `itnumpar.sty'. |