texlive[69056] Master: decimalcomma (7dec23)

commits+karl at tug.org commits+karl at tug.org
Thu Dec 7 21:32:19 CET 2023


Revision: 69056
          https://tug.org/svn/texlive?view=revision&revision=69056
Author:   karl
Date:     2023-12-07 21:32:19 +0100 (Thu, 07 Dec 2023)
Log Message:
-----------
decimalcomma (7dec23)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/decimalcomma/
    trunk/Master/texmf-dist/doc/latex/decimalcomma/README.md
    trunk/Master/texmf-dist/doc/latex/decimalcomma/decimalcomma.pdf
    trunk/Master/texmf-dist/source/latex/decimalcomma/
    trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx
    trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.ins
    trunk/Master/texmf-dist/tex/latex/decimalcomma/
    trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty
    trunk/Master/tlpkg/tlpsrc/decimalcomma.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/decimalcomma/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/decimalcomma/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/decimalcomma/README.md	2023-12-07 20:32:19 UTC (rev 69056)
@@ -0,0 +1,33 @@
+# The decimalcomma package
+
+
+## Presentation
+
+Many countries use a comma instead of a dot as a decimal separator.
+This small package offers a new definition of the comma `,` as an active character.
+It ensures the correct spacing in mathematical mode when using the comma either
+as decimal separator or as list separator.
+
+What's the difference compared to the well-known icomma or ncccomma packages? 
+With decimalcomma, the comma behaves similarly to ncccomma, but the code is lighter, 
+and several compatibility issues have been fixed.
+
+
+## Installation
+
+- run LaTeX on decimalcomma.ins, you obtain the file decimalcomma.sty,
+- if then you run pdfLaTeX on decimalcomma.dtx you get the file decimalcomma.pdf which is also in the archive,
+- put the files decimalcomma.sty and decimalcomma.pdf in your TeX Directory Structure.
+
+
+## Author
+
+Antoine Missier 
+
+Email: antoine.missier at ac-toulouse.fr
+
+
+## License
+
+Released under the LaTeX Project Public License v1.3 or later. 
+See http://www.latex-project.org/lppl.txt


Property changes on: trunk/Master/texmf-dist/doc/latex/decimalcomma/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/decimalcomma/decimalcomma.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/decimalcomma/decimalcomma.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/decimalcomma/decimalcomma.pdf	2023-12-07 00:43:46 UTC (rev 69055)
+++ trunk/Master/texmf-dist/doc/latex/decimalcomma/decimalcomma.pdf	2023-12-07 20:32:19 UTC (rev 69056)

Property changes on: trunk/Master/texmf-dist/doc/latex/decimalcomma/decimalcomma.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx	2023-12-07 20:32:19 UTC (rev 69056)
@@ -0,0 +1,189 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2023 by Antoine Missier <antoine.missier at ac-toulouse.fr>
+%
+% This file 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.
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{decimalcomma.dtx}
+%</driver>
+%<*package> 
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{decimalcomma}
+    [2023/12/06 v1.0 .dtx decimalcomma file]
+%</package>
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[english]{babel}
+\usepackage[charter]{mathdesign}
+\usepackage{decimalcomma}
+\usepackage{sectsty}
+\usepackage{xcolor}
+\usepackage{centeredline}
+
+\definecolor{darkbrown}{rgb}{0.5,0.1,0.1}
+\allsectionsfont{\color{darkbrown}}
+
+\DisableCrossrefs
+%\CodelineIndex
+%\RecordChanges
+\usepackage{hyperref}
+\hypersetup{%
+    colorlinks,
+    linkcolor=blue,
+    citecolor=red,
+    pdftitle={decimalcomma},
+    pdfsubject={LaTeX package},
+    pdfauthor={Antoine Missier}
+}
+\MakeShortVerb{"}
+\begin{document}
+\DocInput{decimalcomma.dtx}
+%\PrintChanges
+%\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{26}
+%
+% \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
+%   Lower-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
+%   Digits        \0\1\2\3\4\5\6\7\8\9
+%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%   Dollar        \$     Percent       \%     Ampersand     \&
+%   Acute accent  \'     Left paren    \(     Right paren   \)
+%   Asterisk      \*     Plus          \+     Comma         \,
+%   Minus         \-     Point         \.     Solidus       \/
+%   Colon         \:     Semicolon     \;     Less than     \<
+%   Equals        \=     Greater than  \>     Question mark \?
+%   Commercial at \@     Left bracket  \[     Backslash     \\
+%   Right bracket \]     Circumflex    \^     Underscore    \_
+%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%   Right brace   \}     Tilde         \~}
+%
+% \changes{v1.0}{2023/12/06}{Initial version}
+%
+% \GetFileInfo{decimalcomma.sty}
+%
+% \title{The \textsf{decimalcomma} package}
+% \author{Antoine Missier \\ \texttt{antoine.missier at ac-toulouse.fr}}
+% \date{\filedate, \fileversion}
+% \maketitle
+%
+% \section{Why this package?}
+%
+% In many countries, except notably in Anglo-Saxon countries, 
+% the comma is used as a 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. 
+% This is appropriate in intervals: "$[a,b]$" results in $[a,b]$,
+% but is not appropriate for numbers where the comma represents the decimal separator. 
+% For example, "$12,5$" is displayed as $12, 5$ instead of $12,5$.
+%
+% \medskip
+% Two very convenient packages allow handling the decimal comma. In math mode:
+% \begin{itemize}
+% \item With \textsf{icomma} (intelligent comma) by Walter Schmidt~\cite{ICOMMA}, 
+% the comma behaves as a punctuation character if it is followed by a space; 
+% otherwise, it is treated as an ordinary character.
+% \item With \textsf{ncccomma} by Alexander I.~Rozhenko~\cite{NCC}, 
+% the comma behaves as an ordinary character if it is followed by a digit 
+% (without a space); otherwise, it is considered a punctuation character.
+% \end{itemize}
+%
+% It appears that this second approach is preferable because unlike with icomma, 
+% you are not required to add a space after the comma when it's not followed by a digit;
+% however, \textsf{ncccomma} poses several compatibility issues, 
+% especially when used with \textsf{babel}
+% in conjunction with \textsf{numprint}~\cite{NUMP} and its \texttt{autolanguage} option 
+% (at least for certain languages such as French and Spanish). 
+% Another issue with \textsf{ncccomma} is that compiling with Lua\LaTeX, 
+% \textsf{unicode-math}, and "\setmathfont" fails.
+% 
+% Let it be noted that a code proposed by Claudio Beccari~\cite{BECC}, 
+% similar to that of \textsf{ncccomma}, presents the same type of issues.
+%
+% \medskip
+% Therefore, we propose a new package, functionally identical to that 
+% of \textsf{ncccomma} but with lighter code and without the 
+% aforementioned incompatibilities.
+% 
+% \section{Bugs and problems}
+% Here, we are revisiting what Walter Schmidt wrote in the documentation of his 
+% \textsf{icomma} package:
+% 
+% In case the \textsf{decimalcomma} is used together with the \textsf{dcolumn} package, 
+% a comma to be printed as the decimal separator in a column of type \texttt{D} 
+% is to be specified as "{\mathord\mathcomma}", rather than "{,}", 
+% since the latter leads to an error.
+% For instance: 
+% \centeredline{"\begin{tabular}{... D{,}{\mathord\mathcomma}{2} ...}"}
+%
+% \medskip
+% Note that specifying the comma as the related input character works as usual.
+% Generally, since the \textsf{decimalcomma} package makes the comma ‘active’, 
+% further problems are not unlikely.
+%
+% \StopEventually{}
+%
+% \section{Implementation}
+% We have taken up Walter Schmidt's fundamental idea for looking up the next character,
+% 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.
+%    \begin{macrocode}
+\AtBeginDocument{%
+  \mathchardef\mathcomma\mathcode`\,%
+  \mathcode`\,="8000%
+}
+
+%    \end{macrocode}
+% The active comma checks the next input character. 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|.
+%    \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}%
+  \mathcomma}
+
+%    \end{macrocode}
+%
+% \begin{thebibliography}{4}
+% % \begin{raggedright}
+% \bibitem{ICOMMA} \emph{The \textsf{icomma} package for \LaTeXe}. 
+% Walter Schmidt, CTAN, v2.0 2002/03/10.
+% \bibitem{NCC} \emph{The \textsf{ncccomma} package}. Alexander I.~Rozhenko, 
+% CTAN, v1.0 2005/02/10.
+% \bibitem{BECC} \emph{Intelligent commas}. Claudio Beccari, The Prac\TeX\ Journal, 
+% 2011, No.\@1.
+% \url{https://tug.org/pracjourn/2011-1/beccari/Intcomma.pdf}
+% \bibitem{NUMP} \emph{The \textsf{numprint} package}. Harald Harders,
+% CTAN, v1.39 2012/08/20.
+% \end{raggedright}
+% \end{thebibliography}
+% \Finale
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/decimalcomma/decimalcomma.ins	2023-12-07 20:32:19 UTC (rev 69056)
@@ -0,0 +1,55 @@
+%%
+%% Copyright (C) 2023 by Antoine Missier <antoine.missier at ac-toulouse.fr>
+%%
+%% This file 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.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/decimalcomma}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2023 by Antoine Missier <antoine.missier at ac-toulouse.fr>
+
+This file 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.
+
+\endpreamble
+
+\generate{\file{decimalcomma.sty}{\from{decimalcomma.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{*                                                           *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* files into a directory searched by TeX:                   *}
+\Msg{*                                                           *}
+\Msg{*     decimalcomma.sty                                      *}
+\Msg{*                                                           *}
+\Msg{* To produce the documentation run the file                 *}
+\Msg{* ibrackets.dtx through LaTeX.                              *}
+\Msg{*                                                           *}
+\Msg{* Happy TeXing!                                             *}
+\Msg{*                                                           *}
+\Msg{*************************************************************}
+
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty	2023-12-07 20:32:19 UTC (rev 69056)
@@ -0,0 +1,41 @@
+%%
+%% This is file `decimalcomma.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% decimalcomma.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (C) 2023 by Antoine Missier <antoine.missier at ac-toulouse.fr>
+%% 
+%% This file 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.
+%% 
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{decimalcomma}
+    [2023/12/06 v1.0 .dtx decimalcomma file]
+\AtBeginDocument{%
+  \mathchardef\mathcomma\mathcode`\,%
+  \mathcode`\,="8000%
+}
+
+{\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}%
+  \mathcomma}
+
+\endinput
+%%
+%% End of file `decimalcomma.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/decimalcomma/decimalcomma.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2023-12-07 00:43:46 UTC (rev 69055)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2023-12-07 20:32:19 UTC (rev 69056)
@@ -260,7 +260,7 @@
     datetime2-usorbian datetime2-welsh
     dblfloatfix dbshow dccpaper dcpic
     ddphonism
-    de-macro debate decimal decision-table decorule
+    de-macro debate decimal decimalcomma decision-table decorule
     defoldfonts dehyph dehyph-exptl
     dejavu dejavu-otf
     delim delimseasy delimset delimtxt democodetools denisbdoc derivative dhua

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2023-12-07 00:43:46 UTC (rev 69055)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2023-12-07 20:32:19 UTC (rev 69056)
@@ -351,6 +351,7 @@
 depend dbshow
 depend debate
 depend decimal
+depend decimalcomma
 depend decorule
 depend defoldfonts
 depend delimtxt

Added: trunk/Master/tlpkg/tlpsrc/decimalcomma.tlpsrc
===================================================================


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