diff options
author | Karl Berry <karl@freefriends.org> | 2017-02-10 23:31:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-02-10 23:31:15 +0000 |
commit | f55680bd0ff263586a423e55926277b7f6c19b7a (patch) | |
tree | 03d72eb76f9bda118675759e3990d74e625889c9 /Master | |
parent | 10e97945f3c4d2cea1d52090ee5f038652e2b9d2 (diff) |
numspell (9feb17)
git-svn-id: svn://tug.org/texlive/trunk@43189 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/numspell/README | 28 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/numspell/numspell.pdf | bin | 0 -> 220505 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/numspell/numspell.tex | 555 | ||||
-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 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 2 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/numspell.tlpsrc | 0 |
11 files changed, 2125 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/numspell/README b/Master/texmf-dist/doc/latex/numspell/README new file mode 100644 index 00000000000..36738e13361 --- /dev/null +++ b/Master/texmf-dist/doc/latex/numspell/README @@ -0,0 +1,28 @@ +numspell.sty package + +Copyright 2017- by Tibor Tomacs + +Package for spelling cardinal and ordinal numbers. +Supported languages are English, German, French and Hungarian. + +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. + +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-magyar.sty (Hungarian 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 differnew file mode 100644 index 00000000000..2ccf9708c59 --- /dev/null +++ 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 new file mode 100644 index 00000000000..28423466ccf --- /dev/null +++ b/Master/texmf-dist/doc/latex/numspell/numspell.tex @@ -0,0 +1,555 @@ +%% +%% `numspell.tex' documentation of the numspell package +%% +%% 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. +%% +\documentclass{article} +\usepackage[a4paper,margin=25mm]{geometry} +\usepackage[pdfstartview=FitH,colorlinks,allcolors=black,bookmarksnumbered]{hyperref} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{numspell} +\usepackage[magyar,german,french,english]{babel} +\usepackage{listings,xcolor,amsmath,upquote} +\usepackage[group-separator={,}]{siunitx} +\flushbottom +\setlength{\labelsep}{0pt} +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt} + +\lstnewenvironment{examplelst}{\lstset{ +belowskip=\bigskipamount, +basicstyle=\ttfamily, +backgroundcolor=\color{black!10}, +columns=fullflexible, +keepspaces}}{} + +\newcommand{\commandinline}{\lstinline[ +literate={<}{{$\langle$}}1{>}{{$\rangle$}}1, +delim={[is][\color{green!50!black}\normalfont\itshape]{!}{!}}, +basicstyle=\color{blue!80!black}\ttfamily, +columns=fullflexible, +keepspaces]} + +\newcommand{\verbinline}{\lstinline[ +literate={<}{{$\langle$}}1{>}{{$\rangle$}}1, +delim={[is][\color{green!50!black}\normalfont\itshape]{!}{!}}, +basicstyle=\ttfamily, +columns=fullflexible, +keepspaces]} + +\begin{document} + +\title{The {\bfseries\sffamily numspell} package\\{\large v1.0 (2017/02/09)}} +\author{Tibor Tómács\\{\normalsize\url{tomacs.tibor@uni-eszterhazy.hu}}} +\date{} +\maketitle + +\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. +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}. + +Load the package as usual, with +\begin{flushleft} +\commandinline|\usepackage{numspell}| +\end{flushleft} + +\section{Commands} +\begin{description} +\item\commandinline|\numspell[!<zeros>!]{!<num>!}|\\ +Spelling the cardinal number $n=\text{\color{green!50!black}\itshape$\langle$num$\rangle$}\cdot10^{\text{\color{green!50!black}\itshape$\langle$zeros$\rangle$}}$, where $0\leq n\leq 10^{67}-1$. The default value of \commandinline|!<zeros>!| is \texttt{0}. For example +\begin{flushleft} +\verb|\numspell{12000}| $\to$ \numspell{12000}\\ +\verb|\numspell[3]{12}| $\to$ \numspell[3]{12}\\ +\verb|\numspell[6]{12}| $\to$ \numspell[6]{12}\\ +\verb|\numspell[63]{1}| $\to$ \numspell[63]{1} +\end{flushleft} + +\item\commandinline|\thenumspell|\\ +The \verb|\numspell| stores the result in this command. For example +\begin{flushleft} +\verb|\numspell{12000}; \thenumspell| $\to$ \numspell{12000}; \thenumspell\\ +\verb|\numspell{1}; \numspell{2}; \thenumspell| $\to$ \numspell{1}; \numspell{2}; \thenumspell +\end{flushleft} + +\item\commandinline|\numspellsave{!<name>!}|\\ +It generates the \commandinline|\thenumspell!<name>!| command, which saves the current \verb|\thenumspell|. For example +\begin{verbatim} +\numspell{1}; +\numspellsave{MyNum} +\numspell{2}; +\thenumspell; +\thenumspellMyNum +\end{verbatim} +\numspell{1}; +\numspellsave{MyNum} +\numspell{2}; +\thenumspell; +\thenumspellMyNum + +\item\commandinline|\numspelldashspace{!<length>!}|\\ +In the number spelling, the spaces around the dashes are flexibility for the optimal hyphenation. Its value is \texttt{0pt plus} \commandinline|!<length>!|. +The default value of \commandinline|!<length>!| is \texttt{2pt}. For example +\begin{verbatim} +\selectlanguage{magyar} +\numspell{6512312354762547162546254756}\\[2mm] +\numspelldashspace{10pt} +\numspell{6512312354762547162546254756} +\end{verbatim} +{\selectlanguage{magyar} +\numspell{6512312354762547162546254756}\\[2mm] +\numspelldashspace{10pt} +\numspell{6512312354762547162546254756}} + +\item\commandinline|\numspell*[!<zeros>!]{!<num>!}|\\ +It works like \verb|\numspell|, but the number spelling will not be printed. +In other words, the following two lines are equivalent: +\begin{flushleft} +\verbinline|\numspell[!<zeros>!]{!<num>!}|\\ +\verbinline|\numspell*[!<zeros>!]{!<num>!}\thenumspell| +\end{flushleft} +For example +\begin{verbatim} +\numspell*{1} +\numspellsave{MyNum} +\numspell*{2} +\thenumspell; +\thenumspellMyNum +\end{verbatim} +\numspell*{1} +\numspellsave{MyNum} +\numspell*{2} +\thenumspell; +\thenumspellMyNum + +\item\commandinline|\Numspell[!<zeros>!]{!<num>!}|\\ +It works like \verb|\numspell|, but the first letter will be capital. For example +\begin{flushleft} +\verb|\Numspell{12000}| $\to$ \Numspell{12000}\\ +\verb|\Numspell[3]{12}| $\to$ \Numspell[3]{12}\\ +\verb|\Numspell[6]{12}| $\to$ \Numspell[6]{12}\\ +\verb|\Numspell[63]{1}| $\to$ \Numspell[63]{1} +\end{flushleft} + +\item\commandinline|\Numspell*[!<zeros>!]{!<num>!}|\\ +It works like \verb|\Numspell|, but the number spelling will not be printed. +In other words, the following two lines are equivalent: +\begin{flushleft} +\verbinline|\Numspell[!<zeros>!]{!<num>!}|\\ +\verbinline|\Numspell*[!<zeros>!]{!<num>!}\thenumspell| +\end{flushleft} +For example +\begin{verbatim} +\Numspell*{1} +\numspellsave{MyNum} +\Numspell*{2} +\thenumspell; +\thenumspellMyNum +\end{verbatim} +\Numspell*{1} +\numspellsave{MyNum} +\Numspell*{2} +\thenumspell; +\thenumspellMyNum + +\item\commandinline|\ordnumspell[!<zeros>!]{!<num>!}|\\ +Spelling the ordinal number +$n=\text{\color{green!50!black}\itshape$\langle$num$\rangle$}\cdot10^{\text{\color{green!50!black}\itshape$\langle$zeros$\rangle$}}$, +where $0\leq n\leq 10^{67}-1$. The default value of \commandinline|!<zeros>!| is \texttt{0}. For example +\begin{flushleft} +\verb|\ordnumspell{12000}| $\to$ \ordnumspell{12000}\\ +\verb|\ordnumspell[3]{12}| $\to$ \ordnumspell[3]{12}\\ +\verb|\ordnumspell[6]{12}| $\to$ \ordnumspell[6]{12}\\ +\verb|\ordnumspell[63]{1}| $\to$ \ordnumspell[63]{1} +\end{flushleft} + +\item\commandinline|\ordnumspell*[!<zeros>!]{!<num>!}|\\ +It works like \verb|\ordnumspell|, but the number spelling will not be printed. +In other words, the following two lines are equivalent: +\begin{flushleft} +\verbinline|\ordnumspell[!<zeros>!]{!<num>!}|\\ +\verbinline|\ordnumspell*[!<zeros>!]{!<num>!}\thenumspell| +\end{flushleft} +For example +\begin{verbatim} +\ordnumspell*{1} +\numspellsave{MyNum} +\ordnumspell*{2} +\thenumspell; +\thenumspellMyNum +\end{verbatim} +\ordnumspell*{1} +\numspellsave{MyNum} +\ordnumspell*{2} +\thenumspell; +\thenumspellMyNum + +\item\commandinline|\Ordnumspell[!<zeros>!]{!<num>!}|\\ +It works like \verb|\ordnumspell|, but the first letter will be capital. For example +\begin{flushleft} +\verb|\Ordnumspell{12000}| $\to$ \Ordnumspell{12000}\\ +\verb|\Ordnumspell[3]{12}| $\to$ \Ordnumspell[3]{12}\\ +\verb|\Ordnumspell[6]{12}| $\to$ \Ordnumspell[6]{12}\\ +\verb|\Ordnumspell[63]{1}| $\to$ \Ordnumspell[63]{1} +\end{flushleft} + +\item\commandinline|\Ordnumspell*[!<zeros>!]{!<num>!}|\\ +It works like \verb|\Ordnumspell|, but the number spelling will not be printed. +In other words, the following two lines are equivalent: +\begin{flushleft} +\verbinline|\Ordnumspell[!<zeros>!]{!<num>!}|\\ +\verbinline|\Ordnumspell*[!<zeros>!]{!<num>!}\thenumspell| +\end{flushleft} +For example +\begin{verbatim} +\Ordnumspell*{1} +\numspellsave{MyNum} +\Ordnumspell*{2} +\thenumspell; +\thenumspellMyNum +\end{verbatim} +\Ordnumspell*{1} +\numspellsave{MyNum} +\Ordnumspell*{2} +\thenumspell; +\thenumspellMyNum +\end{description} + +\section{Commands for English language} +\begin{description} +\item\commandinline|\numspellUS|\\ +By default, the number spelling will happen in British English, if the \texttt{english} language is active. +This command changes it to American English. For example +\begin{flushleft} +\verb|\numspellUS\numspell{1012345}| $\to$ \numspellUS\numspell{1012345}\numspellGB +\end{flushleft} + +\item\commandinline|\numspellGB|\\ +Using the \verb|\numspellUS| command, you can rechange it to British English by this command. For example +\begin{verbatim} +\numspellUS\numspell{1012345}\\ +\numspellGB\numspell{1012345} +\end{verbatim} +\numspellUS\numspell{1012345}\\ +\numspellGB\numspell{1012345} +\end{description} + +\section{Commands for French language} +The following commands only work, if \texttt{french} language is active. +\begin{description} +\selectlanguage{french} +\item\commandinline|\numspellpremiere|\\ +By default, \verb|\ordnumspell{1}| $\to$ \ordnumspell{1},\\ +but \verb|\numspellpremiere\ordnumspell{1}| $\to$ {\numspellpremiere\ordnumspell{1}} + +\item\commandinline|\numspellpremier| (default)\\ +\verb|\numspellpremiere\ordnumspell{1};|\\ +\verb|\numspellpremier\ordnumspell{1}|\\[2mm] +{\numspellpremiere\ordnumspell{1}}; {\numspellpremier\ordnumspell{1}} +\end{description} + +\section{Commands for Hungarian language} +The following commands only work, if \texttt{magyar} language is active. +\begin{description} +\item\commandinline|\anumspell[!<zeros>!]{!<num>!}|\\ +It works like \verb|\numspell|, but the number spelling will start with Hungarian definite article. For example +\begin{flushleft} +{\selectlanguage{magyar} +\verb|\anumspell{1}| $\to$ \anumspell{1}\\ +\verb|\anumspell{2}| $\to$ \anumspell{2}} +\end{flushleft} + +\item\commandinline|\anumspell*[!<zeros>!]{!<num>!}|\\ +It works like \verb|\anumspell|, but the number spelling will not be printed. +In other words, the following two lines are equivalent: +\begin{flushleft} +\verbinline|\anumspell[!<zeros>!]{!<num>!}|\\ +\verbinline|\anumspell*[!<zeros>!]{!<num>!}\thenumspell| +\end{flushleft} +For example +\begin{verbatim} +\anumspell*{1} +\numspellsave{MyNum} +\anumspell*{2} +\thenumspell; +\thenumspellMyNum +\end{verbatim} +{\selectlanguage{magyar} +\anumspell*{1} +\numspellsave{MyNum} +\anumspell*{2} +\thenumspell; +\thenumspellMyNum} + +\item\commandinline|\Anumspell[!<zeros>!]{!<num>!}|\\ +It works like \verb|\anumspell|, but the first letter will be capital. For example +\begin{flushleft} +{\selectlanguage{magyar} +\verb|\Anumspell{1}| $\to$ \Anumspell{1}\\ +\verb|\Anumspell{2}| $\to$ \Anumspell{2}} +\end{flushleft} + +\item\commandinline|\Anumspell*[!<zeros>!]{!<num>!}|\\ +It works like \verb|\Anumspell|, but the number spelling will not be printed. +In other words, the following two lines are equivalent: +\begin{flushleft} +\verbinline|\Anumspell[!<zeros>!]{!<num>!}|\\ +\verbinline|\Anumspell*[!<zeros>!]{!<num>!}\thenumspell| +\end{flushleft} +For example +\begin{verbatim} +\Anumspell*{1} +\numspellsave{MyNum} +\Anumspell*{2} +\thenumspell; +\thenumspellMyNum +\end{verbatim} +{\selectlanguage{magyar} +\Anumspell*{1} +\numspellsave{MyNum} +\Anumspell*{2} +\thenumspell; +\thenumspellMyNum} + +\item\commandinline|\aordnumspell[!<zeros>!]{!<num>!}|\\ +It works like \verb|\ordnumspell|, but the number spelling will start with Hungarian definite article. For example +\begin{flushleft} +{\selectlanguage{magyar} +\verb|\aordnumspell{1}| $\to$ \aordnumspell{1}\\ +\verb|\aordnumspell{2}| $\to$ \aordnumspell{2}} +\end{flushleft} + +\item\commandinline|\aordnumspell*[!<zeros>!]{!<num>!}|\\ +It works like \verb|\aordnumspell|, but the number spelling will not be printed. +In other words, the following two lines are equivalent: +\begin{flushleft} +\verbinline|\aordnumspell[!<zeros>!]{!<num>!}|\\ +\verbinline|\aordnumspell*[!<zeros>!]{!<num>!}\thenumspell| +\end{flushleft} +For example +\begin{verbatim} +\aordnumspell*{1} +\numspellsave{MyNum} +\aordnumspell*{2} +\thenumspell; +\thenumspellMyNum +\end{verbatim} +{\selectlanguage{magyar} +\aordnumspell*{1} +\numspellsave{MyNum} +\aordnumspell*{2} +\thenumspell; +\thenumspellMyNum} + +\item\commandinline|\Aordnumspell[!<zeros>!]{!<num>!}|\\ +It works like \verb|\aordnumspell|, but the first letter will be capital. For example +\begin{flushleft} +{\selectlanguage{magyar} +\verb|\Aordnumspell{1}| $\to$ \Aordnumspell{1}\\ +\verb|\Aordnumspell{2}| $\to$ \Aordnumspell{2}} +\end{flushleft} + +\item\commandinline|\Aordnumspell*[!<zeros>!]{!<num>!}|\\ +It works like \verb|\Aordnumspell|, but the number spelling will not be printed. +In other words, the following two lines are equivalent: +\begin{flushleft} +\verbinline|\Aordnumspell[!<zeros>!]{!<num>!}|\\ +\verbinline|\Aordnumspell*[!<zeros>!]{!<num>!}\thenumspell| +\end{flushleft} +For example +\begin{verbatim} +\Aordnumspell*{1} +\numspellsave{MyNum} +\Aordnumspell*{2} +\thenumspell; +\thenumspellMyNum +\end{verbatim} +{\selectlanguage{magyar} +\Aordnumspell*{1} +\numspellsave{MyNum} +\Aordnumspell*{2} +\thenumspell; +\thenumspellMyNum} +\end{description} + +\section{Examples} +\subsection*{Example \stepcounter{subsection}\arabic{subsection}} +\begin{examplelst} +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[magyar,german,french,english]{babel} +\usepackage{numspell} +\usepackage[group-separator={,}]{siunitx} +\begin{document} + +\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{german}\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}''}}. + +\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{german}\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}''}}. + +\bigskip +\subsection*{Example \stepcounter{subsection}\arabic{subsection}} +\begin{examplelst} +\documentclass{article} +\usepackage{numspell} +\usepackage[group-separator={,}]{siunitx} +\begin{document} + +\def\mynum{123456789012345678901234567890123456789012345678901234567890123456} +\Numspell{\mynum}, that is \num{\mynum}. + +\end{document} +\end{examplelst} + +\def\mynum{123456789012345678901234567890123456789012345678901234567890123456} +\Numspell{\mynum}, that is \num{\mynum}. + +\bigskip +\subsection*{Example \stepcounter{subsection}\arabic{subsection}} +\begin{examplelst} +\documentclass{article} +\usepackage{numspell} +\newcounter{mycount} +\makeatletter +\begin{document} + +The +\@whilenum\value{mycount}<31 +\do{\ordnumspell{\themycount}\stepcounter{mycount},\ }\dots + +\end{document} +\end{examplelst} + +\makeatletter +\newcounter{mycount} +The +\@whilenum\value{mycount}<31 +\do{\ordnumspell{\themycount}\stepcounter{mycount},\ }\dots +\makeatother + +\bigskip +\subsection*{Example \stepcounter{subsection}\arabic{subsection}} +\begin{examplelst} +\documentclass{article} +\usepackage{numspell} +\newcounter{mycount} +\def\themycount{\numspell{\arabic{mycount}}} +\makeatletter +\begin{document} + +\Numspell{0}, +\@whilenum\value{mycount}<30 +\do{\stepcounter{mycount}\themycount,\ }\dots + +\end{document} +\end{examplelst} + +\def\themycount{\numspell{\arabic{mycount}}} +\setcounter{mycount}{0} +\makeatletter +\Numspell{0}, +\@whilenum\value{mycount}<30 +\do{\stepcounter{mycount}\themycount,\ }\dots +\makeatother + +\bigskip +\section{Limitations} +Do not use the \verb|\numspell|, \verb|\numspell*|, \verb|\Numspell|, \verb|\Numspell*|, etc.\ commands inside \verb|\MakeUppercase| and sectioning commands. +An example for the illustration of the problem: +\begin{examplelst} +\documentclass{article} +\usepackage{hyperref,numspell} +\pagestyle{headings} +\begin{document} + +\section{The \ordnumspell{123} factor} +\MakeUppercase{\numspell{123}} +\newpage +Text + +\end{document} +\end{examplelst} +\noindent +The bugs: +\begin{enumerate} +\setlength{\labelsep}{5pt} +\item +You can see it on the page 1: ``\numspell{123}''\\ +Required: \numspell*{123}\MakeUppercase{``\thenumspell''} + +\item +You can see it on the heading: \emph{``THE \ordnumspell{123} FACTOR''}\\ +Required: \ordnumspell*{123}\MakeUppercase{\em``The \thenumspell\ factor''} + +\item +You can see it on the pdf bookmark: ``The 123 factor''\\ +Required: ``The \ordnumspell{123} factor'' +\end{enumerate} +\noindent +The solution is very easy: +\begin{examplelst} +\ordnumspell*{123} +\section{The \thenumspell\ factor} +\numspell*{123} +\MakeUppercase{\thenumspell} +\end{examplelst} + +\end{document}
\ No newline at end of file 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 diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index a930c68413a..b97d2cb4be5 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -438,7 +438,7 @@ my @TLP_working = qw( nomencl nomentbl nonfloat nonumonpart nopageno norasi-c90 normalcolor nostarch notes notes2bib notespages notex-bst noto notoccite nowidow nox nrc ntgclass ntheorem ntheorem-vn nuc nucleardata - numberedblock numericplots numname numprint nwejm + numberedblock numericplots numname numprint numspell nwejm oberdiek objectz obnov ocg-p ocgx ocgx2 ocherokee ocr-b ocr-b-outline ocr-latex octavo odsfile ofs diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index d2fb2c4f769..d2c02652b4c 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -727,6 +727,7 @@ depend ntheorem depend numberedblock depend numname depend numprint +depend numspell depend ocg-p depend ocgx depend ocgx2 diff --git a/Master/tlpkg/tlpsrc/numspell.tlpsrc b/Master/tlpkg/tlpsrc/numspell.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/numspell.tlpsrc |