diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-14 22:14:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-14 22:14:50 +0000 |
commit | a4799313350c8a85179bc99161cc49c0af3e1558 (patch) | |
tree | b45aead098aa82e9154ce3dd0edf304f5adc6cb8 /Master/texmf-dist/tex | |
parent | b8f42a200b795b59536092448f2bac94a76c0513 (diff) |
new latex package fnumprint (14sep12)
git-svn-id: svn://tug.org/texlive/trunk@27668 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/fnumprint/fnumprint.sty | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/fnumprint/fnumprint.sty b/Master/texmf-dist/tex/latex/fnumprint/fnumprint.sty new file mode 100644 index 00000000000..e20e228a486 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fnumprint/fnumprint.sty @@ -0,0 +1,60 @@ +%% See file 'fnumprint.dtx' for copyright and licence. +\NeedsTeXFormat{LaTeX2e}[1998/12/01] +\ProvidesPackage{fnumprint} + [2012/08/27 v1.1 Printing fancy numbers] +\RequirePackage{xifthen} +\RequirePackage[autolanguage]{numprint} +\newcounter{fnumprint@language} +\setcounter{fnumprint@language}{0} +\DeclareOption{german}{\setcounter{fnumprint@language}{1}} +\DeclareOption{ngerman}{\setcounter{fnumprint@language}{1}} +\DeclareOption{english}{\setcounter{fnumprint@language}{2}} +\DeclareOption{USenglish}{\setcounter{fnumprint@language}{2}} +\DeclareOption{american}{\setcounter{fnumprint@language}{2}} +\DeclareOption{UKenglish}{\setcounter{fnumprint@language}{2}} +\DeclareOption{british}{\setcounter{fnumprint@language}{2}} +\DeclareOption{canadian}{\setcounter{fnumprint@language}{2}} +\DeclareOption{australian}{\setcounter{fnumprint@language}{2}} +\DeclareOption{newzealand}{\setcounter{fnumprint@language}{2}} +\ProcessOptions\relax +\ifcase\value{fnumprint@language} + \PackageWarning{\@currname}{No supported language selected + \MessageBreak + This package supports only English and German + \MessageBreak + There will be no word names printed} +\or + \RequirePackage{zahl2string} +\or + \newcommand{\ns@en@neunzehn}[1]{% + \ifcase#1 zero\or one\or two\or three\or four\or five\or six\or% + seven\or eight\or nine\or ten\or eleven\or twelve\or thirteen\or% + fourteen\or fifteen\or sixteen\or seventeen\or% + eighteen\or nineteen\fi% + } +\fi +\DeclareRobustCommand{\fnumprint}[2][]{% + \ifthenelse{\NOT \(\isin{,}{#2} \OR \isin{.}{#2} \) + \AND -1 < #2 \AND #2 < 13}{% + \ifthenelse{\value{fnumprint@language} = 1}{% + \ifthenelse{\equal{#1}{ein} \AND #2 = 1}{ein}{\numstr{#2}}% + }{% + \ifthenelse{\value{fnumprint@language} = 2}{% + \ns@en@neunzehn{#2}% + }{\numprint{#2}}% + }% + }{\numprint{#2}}% +} +\DeclareRobustCommand{\fnumprintc}[2][]{% + \ifthenelse{-1 < \value{#2} \AND \value{#2} < 13}{% + \ifthenelse{\value{fnumprint@language} = 1}{% + \ifthenelse{\equal{#1}{ein} \AND \value{#2} = 1}{ein}{\numstring{#2}}}{% + \ifthenelse{\value{fnumprint@language} = 2}{% + \ns@en@neunzehn{\value{#2}}% + }{\cntprint{#2}}% + }% + }{\cntprint{#2}}% +} +\endinput +%% +%% End of file `fnumprint.sty'. |