texlive[69236] Master/texmf-dist: decimalcomma (29dec23)

commits+karl at tug.org commits+karl at tug.org
Fri Dec 29 23:19:06 CET 2023


Revision: 69236
          https://tug.org/svn/texlive?view=revision&revision=69236
Author:   karl
Date:     2023-12-29 23:19:05 +0100 (Fri, 29 Dec 2023)
Log Message:
-----------
decimalcomma (29dec23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/decimalcomma/decimalcomma.pdf
    trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx
    trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty

Modified: trunk/Master/texmf-dist/doc/latex/decimalcomma/decimalcomma.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx	2023-12-29 22:18:55 UTC (rev 69235)
+++ trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx	2023-12-29 22:19:05 UTC (rev 69236)
@@ -20,10 +20,12 @@
 %<*package> 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{decimalcomma}
-    [2023/12/20 v1.2 .dtx decimalcomma file]
+    [2023/12/28 v1.3 .dtx Comma for decimal numbers]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
+%\usepackage{doc}
+%\MakeShortVerb|
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
 \usepackage[english]{babel}
@@ -58,7 +60,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{36}
+% \CheckSum{24}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -79,6 +81,7 @@
 % \changes{v1.0}{2023/12/06}{Initial version}
 % \changes{v1.1}{2023/12/19}{Error message when unicode-math loaded after decimalcomma}
 % \changes{v1.2}{2023/12/20}{Bug correction: bad typo for the boolean DC at unicodemath}
+% \changes{v1.3}{2023/12/28}{Loading icomma to avoid babel-french + numprint problems}
 %
 % \GetFileInfo{decimalcomma.sty}
 %
@@ -89,7 +92,7 @@
 %
 % \section{Why this package?}
 %
-% In many countries, except notably in Anglo-Saxon countries, 
+% In many countries, except notably in the English-speaking countries, 
 % the comma is used as the decimal separator for numbers. 
 % However, in the math mode of \LaTeX, the comma is always, by default, 
 % treated as a punctuation symbol and therefore is followed by a space. 
@@ -150,7 +153,7 @@
 %
 % \section{Implementation}
 %
-% This first peace of code aims to generate an appropriate error message, if you load
+% This first piece of code aims to generate an appropriate error message, if you load
 % \textsf{unicode-math} \emph{after} \textsf{decimalcomma}.
 % To achieve this, first we check if \textsf{unicode-math} has been loaded before.
 % In that case, the boolean "DC at unicodemath" will be set to true.
@@ -174,36 +177,56 @@
 }
 
 %    \end{macrocode}
-% We have taken up Walter Schmidt's fundamental idea for looking up the next character,
+% We have taken up Walter Schmidt's code for looking up the next character,
+% and define the comma as active in math mode,
 % but with an execution loop to test all the digits from 0 to 9 instead of "\space".
 % We could have also used ten nested "\if" \ldots "\else" \ldots "\fi" structures 
 % and that works very well.
-% 
-% At |\begin{document}|, we store the original "\mathcode" of the comma,
-% in the |\mathcomma| macro, and then we make the comma active in math mode.
+%
+%We chose to directly load \textsf{icomma} instead of transcribing 
+% the beginning portion of its code.
+% This avoids potential conflicts with an extension 
+% that also uses \textsf{icomma}\footnote{The loading of \textsf{icomma} ensures also
+% proper functioning when using \textsf{babel-french} and \textsf{numprint} 
+% with its \texttt{autolanguage} option 
+% (an issue that does not arise with \textsf{babel-spanish}, for example).}. 
 %    \begin{macrocode}
-\AtBeginDocument{%
-  \mathchardef\mathcomma\mathcode`\,%
-  \mathcode`\,="8000%
-}
+\RequirePackage{icomma}  
 
 %    \end{macrocode}
-% The active comma checks the next input character. If the next character is in
-% the list 0123456789,
+%
+% First we introduce what \textsf{icomma} does. 
+% At |\begin{document}|, the original "\mathcode" of the comma is stored,
+% in the |\mathcomma| macro, and then the comma is defined as active in math mode.
+% The active comma checks the next input character. 
+% \begin{verbatim}
+%\AtBeginDocument{%
+%  \mathchardef\mathcomma\mathcode`\,%
+%  \mathcode`\,="8000 %
+%}
+%{\catcode`,=\active
+%  \gdef,{\futurelet\@let at token\sm at rtcomma}
+%}
+% \end{verbatim}
+%
+% Then \textsf{icomma} defines the |\sm at rtcomma| macro, but this macro
+% is redefined here to match the expected behavior.
+% If the next character is in the list 0123456789,
 % the active comma returns |\mathord| with the saved |\mathcomma|,
 % so that no space will be added after the comma.
 % Otherwise, |\mathcomma| is returned without |\mathord|, thus the comma behaves
 % by default as a |\mathpunct|.
+% Note that |\@decimal at digit| must be called before |\@let at token| after |\ifx|.
 %    \begin{macrocode}
-{\catcode`,=\active
-  \gdef,{\futurelet\@next\sm at rtcomma}}
-  
 \def\sm at rtcomma{%
-  \@tfor\@let at token:=0123456789%
-  \do{\expandafter\ifx\@let at token\@next\mathord\@break at tfor\fi}%
+  \@tfor\decimal at digit:=0123456789%
+  \do{\expandafter\ifx\decimal at digit\@let at token\mathord%
+    \@break at tfor\fi}%
   \mathcomma}
 
 %    \end{macrocode}
+% Special thanks to J.F. Burnol for his insightful remarks and valuable advice
+% and let us pay tribute to Walter Schmidt, who is regrettably deceased.
 %
 % \begin{thebibliography}{5}
 % % \begin{raggedright}

Modified: trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty	2023-12-29 22:18:55 UTC (rev 69235)
+++ trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty	2023-12-29 22:19:05 UTC (rev 69236)
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{decimalcomma}
-    [2023/12/20 v1.2 .dtx decimalcomma file]
+    [2023/12/28 v1.3 .dtx Comma for decimal numbers]
 
 \newif\ifDC at unicodemath
 \@ifpackageloaded{unicode-math}{\DC at unicodemathtrue}
@@ -35,17 +35,12 @@
     }{}
 }
 
-\AtBeginDocument{%
-  \mathchardef\mathcomma\mathcode`\,%
-  \mathcode`\,="8000%
-}
+\RequirePackage{icomma}
 
-{\catcode`,=\active
-  \gdef,{\futurelet\@next\sm at rtcomma}}
-
 \def\sm at rtcomma{%
-  \@tfor\@let at token:=0123456789%
-  \do{\expandafter\ifx\@let at token\@next\mathord\@break at tfor\fi}%
+  \@tfor\decimal at digit:=0123456789%
+  \do{\expandafter\ifx\decimal at digit\@let at token\mathord%
+    \@break at tfor\fi}%
   \mathcomma}
 
 \endinput



More information about the tex-live-commits mailing list.