texlive[56912] Master/texmf-dist: numspell (11nov20)
commits+karl at tug.org
commits+karl at tug.org
Wed Nov 11 23:02:30 CET 2020
Revision: 56912
http://tug.org/svn/texlive?view=revision&revision=56912
Author: karl
Date: 2020-11-11 23:02:29 +0100 (Wed, 11 Nov 2020)
Log Message:
-----------
numspell (11nov20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/numspell/numspell.pdf
trunk/Master/texmf-dist/doc/latex/numspell/numspell.tex
trunk/Master/texmf-dist/tex/latex/numspell/numspell-english.sty
trunk/Master/texmf-dist/tex/latex/numspell/numspell.sty
Modified: trunk/Master/texmf-dist/doc/latex/numspell/numspell.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/numspell/numspell.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/numspell/numspell.tex 2020-11-11 22:02:16 UTC (rev 56911)
+++ trunk/Master/texmf-dist/doc/latex/numspell/numspell.tex 2020-11-11 22:02:29 UTC (rev 56912)
@@ -30,10 +30,14 @@
\setlength{\parskip}{6pt}
\lstnewenvironment{examplelst}{\lstset{
-belowskip=\bigskipamount,
+%belowskip=\bigskipamount,
basicstyle=\ttfamily,
backgroundcolor=\color{black!10},
+frame=trbl,
+framesep=3pt,
columns=fullflexible,
+xleftmargin=3.4pt,
+xrightmargin=3.4pt,
keepspaces}}{}
\newcommand{\commandinline}{\lstinline[
@@ -52,7 +56,7 @@
\begin{document}
-\title{The {\bfseries\sffamily numspell} package\\{\large v1.3 (2020/11/07)}}
+\title{The {\bfseries\sffamily numspell} package\\{\large v1.4 (2020/11/11)}}
\author{Tibor Tómács\\{\normalsize\url{tomacs.tibor at uni-eszterhazy.hu}}}
\date{}
\maketitle
@@ -63,7 +67,7 @@
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{iflang}.
+The \texttt{numspell} package requires the services of the \texttt{xstring} and \texttt{iflang} packages.
Load the package as usual, with
\begin{flushleft}
@@ -231,6 +235,15 @@
\thenumspellMyNum
\end{description}
+\section{Commands for English language}
+If the \texttt{english}, \texttt{british}, \texttt{ukenglish} or \texttt{UKenglish} language is active, then the number spelling will happen in British English. But it will be in American English, if the \texttt{american}, \texttt{usenglish} or \texttt{USenglish} language is active.
+\begin{description}
+\item\commandinline|\numspellUS|\\
+Using British English, you can rechange the number spelling to American English by this command.
+\item\commandinline|\numspellGB|\\
+Using American English, you can rechange the number spelling to British English by this command.
+\end{description}
+
\section{Commands for French language}
The following commands only work, if \texttt{french} language is active.
\begin{description}
@@ -246,7 +259,7 @@
\end{description}
\section{Commands for Hungarian language}
-The following commands only work, if \texttt{magyar} language is active.
+The following commands only work, if \texttt{magyar} or \texttt{hungarian} 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
@@ -337,10 +350,9 @@
\end{description}
\section{Examples}
-\subsection*{Example \stepcounter{subsection}\arabic{subsection}}
+
\begin{examplelst}
\documentclass{article}
-\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[magyar,italian,ngerman,french,english]{babel}
\usepackage{numspell}
@@ -349,80 +361,56 @@
\def\mynum{123456789}
\noindent
In British English the spelling of \num{\mynum} is
-\emph{``\numspell{\mynum}''}.
+\emph{\numspell{\mynum}}.
\par\smallskip\noindent
In American English the spelling of \num{\mynum} is
-{\selectlanguage{american}\emph{``\numspell{\mynum}''}}.
+\foreignlanguage{american}{\em\numspell{\mynum}}.
\par\smallskip\noindent
In French the spelling of \num{\mynum} is
-{\selectlanguage{french}\emph{``\numspell{\mynum}''}}.
+\foreignlanguage{french}{\em\numspell{\mynum}}.
\par\smallskip\noindent
In German the spelling of \num{\mynum} is
-{\selectlanguage{ngerman}\emph{``\numspell{\mynum}''}}.
+\foreignlanguage{ngerman}{\em\numspell{\mynum}}.
\par\smallskip\noindent
In Hungarian the spelling of \num{\mynum} is
-{\selectlanguage{magyar}\emph{`'\numspell{\mynum}''}}.
+\foreignlanguage{magyar}{\em\numspell{\mynum}}.
\par\smallskip\noindent
In Italian the spelling of \num{\mynum} is
-{\selectlanguage{italian}\emph{``\numspell{\mynum}''}}.
+\foreignlanguage{italian}{\em\numspell{\mynum}}.
\end{document}
\end{examplelst}
-
\def\mynum{123456789}
-
\noindent
In British English the spelling of \num{\mynum} is
-\emph{``\numspell{\mynum}''}.
-
-\smallskip\noindent
+\emph{\numspell{\mynum}}.
+\par\smallskip\noindent
In American English the spelling of \num{\mynum} is
-{\selectlanguage{american}\emph{``\numspell{\mynum}''}}.
-
-\smallskip\noindent
+\foreignlanguage{american}{\em\numspell{\mynum}}.
+\par\smallskip\noindent
In French the spelling of \num{\mynum} is
-{\selectlanguage{french}\emph{``\numspell{\mynum}''}}.
-
-\smallskip\noindent
+\foreignlanguage{french}{\em\numspell{\mynum}}.
+\par\smallskip\noindent
In German the spelling of \num{\mynum} is
-{\selectlanguage{ngerman}\emph{``\numspell{\mynum}''}}.
-
-\smallskip\noindent
+\foreignlanguage{ngerman}{\em\numspell{\mynum}}.
+\par\smallskip\noindent
In Hungarian the spelling of \num{\mynum} is
-{\selectlanguage{magyar}\emph{`'\numspell{\mynum}''}}.
-
-\smallskip\noindent
+\foreignlanguage{magyar}{\em\numspell{\mynum}}.
+\par\smallskip\noindent
In Italian the spelling of \num{\mynum} is
-{\selectlanguage{italian}\emph{``\numspell{\mynum}''}}.
+\foreignlanguage{italian}{\em\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
+\makeatletter
\@whilenum\value{mycount}<51
\do{\ordnumspell{\themycount}\stepcounter{mycount},\ }\dots
+\makeatother
\end{document}
\end{examplelst}
-
\makeatletter
\newcounter{mycount}
The
@@ -430,21 +418,19 @@
\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},
+\makeatletter
\@whilenum\value{mycount}<30
\do{\stepcounter{mycount}\themycount,\ }\dots
+\makeatother
\end{document}
\end{examplelst}
-
\def\themycount{\numspell{\arabic{mycount}}}
\setcounter{mycount}{0}
\makeatletter
@@ -453,7 +439,6 @@
\do{\stepcounter{mycount}\themycount,\ }\dots
\makeatother
-\bigskip
\section{Limitations}
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:
@@ -469,24 +454,20 @@
Text
\end{document}
\end{examplelst}
-\noindent
-\textbf{The bugs}
+
+The following mistakes occur:
\begin{enumerate}
\setlength{\labelsep}{5pt}
-\item
-On the page 1: ``\numspell{123}''\\
+\item On the page 1: ``\numspell{123}''\\
Required: \numspell*{123}\MakeUppercase{``\thenumspell''}
-
-\item
-On the heading: \emph{``THE \ordnumspell{123} FACTOR''}\\
+\item On the heading: \emph{``THE \ordnumspell{123} FACTOR''}\\
Required: \ordnumspell*{123}\MakeUppercase{\em``The \thenumspell\ factor''}
-
-\item
-On the pdf bookmark: ``The 123 factor''\\
+\item On the pdf bookmark: ``The 123 factor''\\
Required: ``The \ordnumspell{123} factor''
\end{enumerate}
-\noindent
-\textbf{The solution}
+
+\subsubsection*{The solution}
+
\begin{examplelst}
\documentclass{article}
\usepackage{hyperref}
Modified: trunk/Master/texmf-dist/tex/latex/numspell/numspell-english.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/numspell/numspell-english.sty 2020-11-11 22:02:16 UTC (rev 56911)
+++ trunk/Master/texmf-dist/tex/latex/numspell/numspell-english.sty 2020-11-11 22:02:29 UTC (rev 56912)
@@ -16,18 +16,21 @@
%% The Current Maintainer of this work is Tibor Tomacs.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{numspell-english}[2020/11/07 v1.1 English language package for numspell]
+\ProvidesPackage{numspell-english}[2020/11/11 v1.2 English language package for numspell]
+\def\numspell at and@en{\numspell@{ and }}
+\def\numspell at and@@en{\numspell@{, }}% It was 'and' in v1.0
+
%% -----------
-%% \numspellGB (Default)
+%% \numspellGB
%% -----------
%% It changes to British English
%%
\def\numspellGB{%
+ \def\numspell at US{}%
\def\numspell at and@en{\numspell@{ and }}%
\def\numspell at and@@en{\numspell@{, }}% It was 'and' in v1.0
}
-\numspellGB
%% -----------
%% \numspellUS
@@ -34,6 +37,10 @@
%% -----------
%% It changes to American English
%%
+\def\numspell at US{%
+ \def\numspell at and@en{\numspell@{ }}%
+ \def\numspell at and@@en{\numspell@{, }}%
+}
\def\numspellUS{%
\def\numspell at and@en{\numspell@{ }}%
\def\numspell at and@@en{\numspell@{, }}%
Modified: trunk/Master/texmf-dist/tex/latex/numspell/numspell.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/numspell/numspell.sty 2020-11-11 22:02:16 UTC (rev 56911)
+++ trunk/Master/texmf-dist/tex/latex/numspell/numspell.sty 2020-11-11 22:02:29 UTC (rev 56912)
@@ -17,12 +17,10 @@
%%
%% The Current Maintainer of this work is Tibor Tomacs.
%%
-\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{numspell}[2020/11/07 v1.3 Package for spelling cardinal and ordinal numbers]
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesPackage{numspell}[2020/11/11 v1.4 Package for spelling cardinal and ordinal numbers]
-\RequirePackage{xstring}
-\RequirePackage{iflang}
-\RequirePackage{etoolbox}
+\RequirePackage{xstring,iflang}
\newcounter{numspell at counter@tempa}
\newcounter{numspell at counter@tempb}
@@ -235,9 +233,9 @@
\IfLanguageName{british}{\@numspell at lang@notsupported at false}{}%
\IfLanguageName{ukenglish}{\@numspell at lang@notsupported at false}{}%
\IfLanguageName{UKenglish}{\@numspell at lang@notsupported at false}{}%
- \IfLanguageName{american}{\@numspell at lang@notsupported at false\numspellUS}{}%
- \IfLanguageName{usenglish}{\@numspell at lang@notsupported at false\numspellUS}{}%
- \IfLanguageName{USenglish}{\@numspell at lang@notsupported at false\numspellUS}{}%
+ \IfLanguageName{american}{\@numspell at lang@notsupported at false\numspell at US}{}%
+ \IfLanguageName{usenglish}{\@numspell at lang@notsupported at false\numspell at US}{}%
+ \IfLanguageName{USenglish}{\@numspell at lang@notsupported at false\numspell at US}{}%
\IfLanguageName{magyar}{\@numspell at lang@notsupported at false\def\numspell at langname{hu}}{}%
\IfLanguageName{hungarian}{\@numspell at lang@notsupported at false\def\numspell at langname{hu}}{}%
\IfLanguageName{german}{\@numspell at lang@notsupported at false\def\numspell at langname{de}}{}%
@@ -244,7 +242,7 @@
\IfLanguageName{ngerman}{\@numspell at lang@notsupported at false\def\numspell at langname{de}}{}%
\IfLanguageName{french}{\@numspell at lang@notsupported at false\def\numspell at langname{fr}}{}%
\IfLanguageName{italian}{\@numspell at lang@notsupported at false\def\numspell at langname{it}}{}%
- \if at numspell@lang at notsupported@\PackageWarning{numspell}{Not supported language: \languagename}\fi%
+ \if at numspell@lang at notsupported@\PackageWarning{numspell}{\languagename\space is not supported language in numspell}\fi%
}
%% -------------------------
@@ -251,22 +249,14 @@
%% Loading language packages
%% -------------------------
%%
-\AtEndPreamble{%
-\newif\if at numspell@lang at loaded@
-\ifdefined\dateenglish\RequirePackage{numspell-english}\@numspell at lang@loaded at true\fi%
-\ifdefined\datebritish\RequirePackage{numspell-english}\@numspell at lang@loaded at true\fi%
-\ifdefined\dateukenglish\RequirePackage{numspell-english}\@numspell at lang@loaded at true\fi%
-\ifdefined\dateUKenglish\RequirePackage{numspell-english}\@numspell at lang@loaded at true\fi%
-\ifdefined\dateamerican\RequirePackage{numspell-english}\@numspell at lang@loaded at true\fi%
-\ifdefined\dateusenglish\RequirePackage{numspell-english}\@numspell at lang@loaded at true\fi%
-\ifdefined\dateUSenglish\RequirePackage{numspell-english}\@numspell at lang@loaded at true\fi%
-\ifdefined\datemagyar\RequirePackage{numspell-magyar}\@numspell at lang@loaded at true\fi%
-\ifdefined\datehungarian\RequirePackage{numspell-magyar}\@numspell at lang@loaded at true\fi%
-\ifdefined\dategerman\RequirePackage{numspell-german}\@numspell at lang@loaded at true\fi%
-\ifdefined\datengerman\RequirePackage{numspell-german}\@numspell at lang@loaded at true\fi%
-\ifdefined\datefrench\RequirePackage{numspell-french}\@numspell at lang@loaded at true\fi%
-\ifdefined\dateitalian\RequirePackage{numspell-italian}\@numspell at lang@loaded at true\fi%
-\if at numspell@lang at loaded@\else\RequirePackage{numspell-english}\fi%
+\AddToHook{begindocument/before}{
+\RequirePackage{numspell-english}
+\ifdefined\datemagyar\RequirePackage{numspell-magyar}\fi%
+\ifdefined\datehungarian\RequirePackage{numspell-magyar}\fi%
+\ifdefined\dategerman\RequirePackage{numspell-german}\fi%
+\ifdefined\datengerman\RequirePackage{numspell-german}\fi%
+\ifdefined\datefrench\RequirePackage{numspell-french}\fi%
+\ifdefined\dateitalian\RequirePackage{numspell-italian}\fi%
}
%% ---------------------------------
More information about the tex-live-commits
mailing list.