From 6e8258ca7f0c5584a4f9919cf65ac0fa093f0e2f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 7 Nov 2020 22:02:36 +0000 Subject: numspell (7nov20) git-svn-id: svn://tug.org/texlive/trunk@56875 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/numspell/README | 2 +- Master/texmf-dist/doc/latex/numspell/numspell.pdf | Bin 222065 -> 234703 bytes Master/texmf-dist/doc/latex/numspell/numspell.tex | 145 +++++---------------- .../tex/latex/numspell/numspell-english.sty | 6 +- .../tex/latex/numspell/numspell-french.sty | 2 +- .../tex/latex/numspell/numspell-german.sty | 2 +- .../tex/latex/numspell/numspell-italian.sty | 2 +- .../tex/latex/numspell/numspell-magyar.sty | 2 +- Master/texmf-dist/tex/latex/numspell/numspell.sty | 59 +++++---- 9 files changed, 75 insertions(+), 145 deletions(-) diff --git a/Master/texmf-dist/doc/latex/numspell/README b/Master/texmf-dist/doc/latex/numspell/README index 9afd9185e2f..8a3bd49fecd 100644 --- a/Master/texmf-dist/doc/latex/numspell/README +++ b/Master/texmf-dist/doc/latex/numspell/README @@ -1,6 +1,6 @@ numspell.sty package -Copyright 2017- by Tibor Tomacs +Copyright 2017-2020 by Tibor Tomacs This package supports the spelling of cardinal and ordinal numbers. Supported languages are English, French, German, Hungarian and Italian. diff --git a/Master/texmf-dist/doc/latex/numspell/numspell.pdf b/Master/texmf-dist/doc/latex/numspell/numspell.pdf index 60ea99893fc..76152b5074a 100644 Binary files a/Master/texmf-dist/doc/latex/numspell/numspell.pdf and b/Master/texmf-dist/doc/latex/numspell/numspell.pdf differ diff --git a/Master/texmf-dist/doc/latex/numspell/numspell.tex b/Master/texmf-dist/doc/latex/numspell/numspell.tex index 5c8186fe483..c28766044db 100644 --- a/Master/texmf-dist/doc/latex/numspell/numspell.tex +++ b/Master/texmf-dist/doc/latex/numspell/numspell.tex @@ -1,7 +1,7 @@ %% %% `numspell.tex' documentation of the numspell package %% -%% Copyright 2017- by Tibor Tomacs +%% Copyright 2017-2020 by Tibor Tomacs %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -16,7 +16,7 @@ %% The Current Maintainer of this work is Tibor Tomacs. %% \documentclass{article} -\usepackage[a4paper,margin=25mm]{geometry} +\usepackage[a4paper]{geometry} \usepackage[pdfstartview=FitH,colorlinks,allcolors=black,bookmarksnumbered]{hyperref} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} @@ -52,7 +52,7 @@ keepspaces]} \begin{document} -\title{The {\bfseries\sffamily numspell} package\\{\large v1.2 (2017/09/30)}} +\title{The {\bfseries\sffamily numspell} package\\{\large v1.3 (2020/11/07)}} \author{Tibor Tómács\\{\normalsize\url{tomacs.tibor@uni-eszterhazy.hu}}} \date{} \maketitle @@ -60,10 +60,10 @@ keepspaces]} \section{Introduction} The aim of the \texttt{numspell} package is to spell the cardinal and ordinal numbers from 0 to $10^{67}-1$ (i.e.~maximum 66 digits). -Currently, the supported languages are English, French, German, Hungarian and Italian. +The supported languages are English (British and American), French, German, Hungarian and Italian. The spelling will happen in the current language. -The \texttt{numspell} package requires the services of the following packages: \texttt{xstring}, \texttt{etoolbox}, \texttt{pdftexcmds}. +The \texttt{numspell} package requires the services of the following packages: \texttt{xstring}, \texttt{etoolbox}, \texttt{iflang}. Load the package as usual, with \begin{flushleft} @@ -231,25 +231,6 @@ For example \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} @@ -298,34 +279,10 @@ For example \thenumspellMyNum} \item\commandinline|\Anumspell[!!]{!!}|\\ -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} +It works like \verb|\anumspell|, but the first letter will be capital. \item\commandinline|\Anumspell*[!!]{!!}|\\ -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[!!]{!!}|\\ -\verbinline|\Anumspell*[!!]{!!}\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} +It works like \verb|\anumspell*|, but the first letter will be capital. \item\commandinline|\aordnumspell[!!]{!!}|\\ It works like \verb|\ordnumspell|, but the number spelling will start with Hungarian definite article. For example @@ -358,34 +315,10 @@ For example \thenumspellMyNum} \item\commandinline|\Aordnumspell[!!]{!!}|\\ -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} +It works like \verb|\aordnumspell|, but the first letter will be capital. \item\commandinline|\Aordnumspell*[!!]{!!}|\\ -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[!!]{!!}|\\ -\verbinline|\Aordnumspell*[!!]{!!}\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} +It works like \verb|\aordnumspell*|, but the first letter will be capital. \end{description} \section{Commands for Italian language} @@ -413,44 +346,37 @@ The ordinal numbers will be printed in feminine form. For example\\ \usepackage{numspell} \usepackage[group-separator={,}]{siunitx} \begin{document} - \def\mynum{123456789} - \noindent -In American English the spelling of \num{\mynum} is -{\numspellUS\emph{``\numspell{\mynum}''}}. - -\smallskip\noindent In British English the spelling of \num{\mynum} is \emph{``\numspell{\mynum}''}. - -\smallskip\noindent +\par\smallskip\noindent +In American English the spelling of \num{\mynum} is +{\selectlanguage{american}\emph{``\numspell{\mynum}''}}. +\par\smallskip\noindent In French the spelling of \num{\mynum} is {\selectlanguage{french}\emph{``\numspell{\mynum}''}}. - -\smallskip\noindent +\par\smallskip\noindent In German the spelling of \num{\mynum} is {\selectlanguage{ngerman}\emph{``\numspell{\mynum}''}}. - -\smallskip\noindent +\par\smallskip\noindent In Hungarian the spelling of \num{\mynum} is {\selectlanguage{magyar}\emph{`'\numspell{\mynum}''}}. - -\smallskip\noindent +\par\smallskip\noindent In Italian the spelling of \num{\mynum} is {\selectlanguage{italian}\emph{``\numspell{\mynum}''}}. - \end{document} \end{examplelst} \def\mynum{123456789} \noindent -In American English the spelling of \num{\mynum} is -{\numspellUS\emph{``\numspell{\mynum}''}}. +In British English the spelling of \num{\mynum} is +\emph{``\numspell{\mynum}''}. \smallskip\noindent -In British English the spelling of \num{\mynum} is \emph{``\numspell{\mynum}''}. +In American English the spelling of \num{\mynum} is +{\selectlanguage{american}\emph{``\numspell{\mynum}''}}. \smallskip\noindent In French the spelling of \num{\mynum} is @@ -475,10 +401,8 @@ In Italian the spelling of \num{\mynum} is \usepackage{numspell} \usepackage[group-separator={,}]{siunitx} \begin{document} - \def\mynum{123456789012345678901234567890123456789012345678901234567890123456} \Numspell{\mynum}, that is \num{\mynum}. - \end{document} \end{examplelst} @@ -493,11 +417,9 @@ In Italian the spelling of \num{\mynum} is \newcounter{mycount} \makeatletter \begin{document} - The \@whilenum\value{mycount}<51 \do{\ordnumspell{\themycount}\stepcounter{mycount},\ }\dots - \end{document} \end{examplelst} @@ -517,11 +439,9 @@ The \def\themycount{\numspell{\arabic{mycount}}} \makeatletter \begin{document} - \Numspell{0}, \@whilenum\value{mycount}<30 \do{\stepcounter{mycount}\themycount,\ }\dots - \end{document} \end{examplelst} @@ -535,44 +455,51 @@ The \bigskip \section{Limitations} -Do not use the \verb|\numspell|, \verb|\numspell*|, \verb|\Numspell|, \verb|\Numspell*|, etc.\ commands inside \verb|\MakeUppercase| and sectioning commands. +Do not use the \verb|\numspell|, \verb|\numspell*|, \verb|\Numspell|, \verb|\Numspell*|, etc.\ commands inside sectioning commands and \verb|\MakeUppercase|. An example for the illustration of the problem: \begin{examplelst} \documentclass{article} -\usepackage{hyperref,numspell} +\usepackage{hyperref} +\usepackage{numspell} \pagestyle{headings} \begin{document} - \section{The \ordnumspell{123} factor} \MakeUppercase{\numspell{123}} \newpage Text - \end{document} \end{examplelst} \noindent -The bugs: +\textbf{The bugs} \begin{enumerate} \setlength{\labelsep}{5pt} \item -You can see it on the page 1: ``\numspell{123}''\\ +On the page 1: ``\numspell{123}''\\ Required: \numspell*{123}\MakeUppercase{``\thenumspell''} \item -You can see it on the heading: \emph{``THE \ordnumspell{123} FACTOR''}\\ +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''\\ +On the pdf bookmark: ``The 123 factor''\\ Required: ``The \ordnumspell{123} factor'' \end{enumerate} \noindent -The solution is very easy: +\textbf{The solution} \begin{examplelst} +\documentclass{article} +\usepackage{hyperref} +\usepackage{numspell} +\pagestyle{headings} +\begin{document} \ordnumspell*{123} \section{The \thenumspell\ factor} \numspell*{123} \MakeUppercase{\thenumspell} +\newpage +Text +\end{document} \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 index 2bf2f69bbf3..a3120e3ca85 100644 --- a/Master/texmf-dist/tex/latex/numspell/numspell-english.sty +++ b/Master/texmf-dist/tex/latex/numspell/numspell-english.sty @@ -1,7 +1,7 @@ %% %% `numspell-english.sty' English language package for 'numspell.sty' %% -%% Copyright 2017- by Tibor Tomacs +%% Copyright 2017-2020 by Tibor Tomacs %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -16,7 +16,7 @@ %% 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] +\ProvidesPackage{numspell-english}[2020/11/07 v1.1 English language package for numspell] %% ----------- %% \numspellGB (Default) @@ -25,7 +25,7 @@ %% \def\numspellGB{% \def\numspell@and@en{\numspell@{ and }}% - \def\numspell@and@@en{\numspell@{ and }}% + \def\numspell@and@@en{\numspell@{, }}% It was 'and' in v1.0 } \numspellGB diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-french.sty b/Master/texmf-dist/tex/latex/numspell/numspell-french.sty index 00426043bf5..8f9f1350b9b 100644 --- a/Master/texmf-dist/tex/latex/numspell/numspell-french.sty +++ b/Master/texmf-dist/tex/latex/numspell/numspell-french.sty @@ -1,7 +1,7 @@ %% %% `numspell-french.sty' French language package for 'numspell.sty' %% -%% Copyright 2017- by Tibor Tomacs +%% Copyright 2017-2020 by Tibor Tomacs %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-german.sty b/Master/texmf-dist/tex/latex/numspell/numspell-german.sty index bd100313f88..068b7deee94 100644 --- a/Master/texmf-dist/tex/latex/numspell/numspell-german.sty +++ b/Master/texmf-dist/tex/latex/numspell/numspell-german.sty @@ -1,7 +1,7 @@ %% %% `numspell-german.sty' German language package for 'numspell.sty' %% -%% Copyright 2017- by Tibor Tomacs +%% Copyright 2017-2020 by Tibor Tomacs %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty b/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty index da1f9dc1780..db519e4974b 100644 --- a/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty +++ b/Master/texmf-dist/tex/latex/numspell/numspell-italian.sty @@ -1,7 +1,7 @@ %% %% `numspell-italian.sty' Italian language package for 'numspell.sty' %% -%% Copyright 2017- by Tibor Tomacs +%% Copyright 2017-2020 by Tibor Tomacs %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/tex/latex/numspell/numspell-magyar.sty b/Master/texmf-dist/tex/latex/numspell/numspell-magyar.sty index ce4c1d2442e..7634b64f909 100644 --- a/Master/texmf-dist/tex/latex/numspell/numspell-magyar.sty +++ b/Master/texmf-dist/tex/latex/numspell/numspell-magyar.sty @@ -1,7 +1,7 @@ %% %% `numspell-magyar.sty' Hungarian language package for 'numspell.sty' %% -%% Copyright 2017- by Tibor Tomacs +%% Copyright 2017-2020 by Tibor Tomacs %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/tex/latex/numspell/numspell.sty b/Master/texmf-dist/tex/latex/numspell/numspell.sty index 3fd2fcc1788..c74912b8d15 100644 --- a/Master/texmf-dist/tex/latex/numspell/numspell.sty +++ b/Master/texmf-dist/tex/latex/numspell/numspell.sty @@ -3,7 +3,7 @@ %% %% Package for spelling the non-negative cardinal and ordinal numbers (maximum 66 digits). %% -%% Copyright 2017- by Tibor Tomacs +%% Copyright 2017-2020 by Tibor Tomacs %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -18,10 +18,10 @@ %% The Current Maintainer of this work is Tibor Tomacs. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{numspell}[2017/09/30 v1.2 Package for spelling cardinal and ordinal numbers] +\ProvidesPackage{numspell}[2020/11/07 v1.3 Package for spelling cardinal and ordinal numbers] \RequirePackage{xstring} -\RequirePackage{pdftexcmds} +\RequirePackage{iflang} \RequirePackage{etoolbox} \newcounter{numspell@counter@tempa} @@ -226,43 +226,46 @@ %% -------------------- %% \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 or ngerman is active, then \numspell@langname will be 'de'. -%% If french is active, then \numspell@langname will be 'fr'. -%% If italian is active, then \numspell@langname will be 'it'. -%% Otherwise error. %% \newif\if@numspell@lang@notsupported@ \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}{ngerman}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{de}\fi% - \ifnum\pdf@strcmp{\languagename}{french}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{fr}\fi% - \ifnum\pdf@strcmp{\languagename}{italian}=\z@\@numspell@lang@notsupported@false\def\numspell@langname{it}\fi% - \if@numspell@lang@notsupported@\@latexerr{'numspell.sty' error! Not supported language: \languagename}{}\fi% + \def\numspell@langname{en}% + \IfLanguageName{english}{\@numspell@lang@notsupported@false}{}% + \IfLanguageName{british}{\@numspell@lang@notsupported@false}{}% + \IfLanguageName{ukenglish}{\@numspell@lang@notsupported@false}{}% + \IfLanguageName{UKenglish}{\@numspell@lang@notsupported@false}{}% + \IfLanguageName{american}{\@numspell@lang@notsupported@false\numspellUS}{}% + \IfLanguageName{usenglish}{\@numspell@lang@notsupported@false\numspellUS}{}% + \IfLanguageName{USenglish}{\@numspell@lang@notsupported@false\numspellUS}{}% + \IfLanguageName{magyar}{\@numspell@lang@notsupported@false\def\numspell@langname{hu}}{}% + \IfLanguageName{hungarian}{\@numspell@lang@notsupported@false\def\numspell@langname{hu}}{}% + \IfLanguageName{german}{\@numspell@lang@notsupported@false\def\numspell@langname{de}}{}% + \IfLanguageName{ngerman}{\@numspell@lang@notsupported@false\def\numspell@langname{de}}{}% + \IfLanguageName{french}{\@numspell@lang@notsupported@false\def\numspell@langname{fr}}{}% + \IfLanguageName{italian}{\@numspell@lang@notsupported@false\def\numspell@langname{it}}{}% + \if@numspell@lang@notsupported@\PackageWarning{numspell}{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 or ngerman, then numspell loads numspell-german.sty. -%% If babel or polyglossia loads french, then numspell loads numspell-french.sty. -%% If babel or polyglossia loads italian, then numspell loads numspell-italian.sty. -%% Otherwise numspell loads numspell-english.sty. %% \AtEndPreamble{% \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 datengerman\endcsname\relax\else\RequirePackage{numspell-german}\@numspell@lang@loaded@true\fi}% -\bbl@iflanguage\languagename{\expandafter\ifx\csname datefrench\endcsname\relax\else\RequirePackage{numspell-french}\@numspell@lang@loaded@true\fi}% -\bbl@iflanguage\languagename{\expandafter\ifx\csname dateitalian\endcsname\relax\else\RequirePackage{numspell-italian}\@numspell@lang@loaded@true\fi}% +\ifdefined\dateenglish\RequirePackage{numspell-english}\@numspell@lang@loaded@true\fi% +\ifdefined\datebritish\RequirePackage{numspell-english}\@numspell@lang@loaded@true\fi% +\ifdefined\dateukenglish\RequirePackage{numspell-english}\@numspell@lang@loaded@true\fi% +\ifdefined\dateUKenglish\RequirePackage{numspell-english}\@numspell@lang@loaded@true\fi% +\ifdefined\dateamerican\RequirePackage{numspell-english}\@numspell@lang@loaded@true\fi% +\ifdefined\dateusenglish\RequirePackage{numspell-english}\@numspell@lang@loaded@true\fi% +\ifdefined\dateUSenglish\RequirePackage{numspell-english}\@numspell@lang@loaded@true\fi% +\ifdefined\datemagyar\RequirePackage{numspell-magyar}\@numspell@lang@loaded@true\fi% +\ifdefined\datehungarian\RequirePackage{numspell-magyar}\@numspell@lang@loaded@true\fi% +\ifdefined\dategerman\RequirePackage{numspell-german}\@numspell@lang@loaded@true\fi% +\ifdefined\datengerman\RequirePackage{numspell-german}\@numspell@lang@loaded@true\fi% +\ifdefined\datefrench\RequirePackage{numspell-french}\@numspell@lang@loaded@true\fi% +\ifdefined\dateitalian\RequirePackage{numspell-italian}\@numspell@lang@loaded@true\fi% \if@numspell@lang@loaded@\else\RequirePackage{numspell-english}\fi% } -- cgit v1.2.3