texlive[72547] Master: numbersets (14oct24)

commits+karl at tug.org commits+karl at tug.org
Mon Oct 14 21:11:30 CEST 2024


Revision: 72547
          https://tug.org/svn/texlive?view=revision&revision=72547
Author:   karl
Date:     2024-10-14 21:11:30 +0200 (Mon, 14 Oct 2024)
Log Message:
-----------
numbersets (14oct24)

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

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/numbersets/
    trunk/Master/texmf-dist/doc/latex/numbersets/README.md
    trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.pdf
    trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.tex
    trunk/Master/texmf-dist/tex/latex/numbersets/
    trunk/Master/texmf-dist/tex/latex/numbersets/numbersets.sty
    trunk/Master/tlpkg/tlpsrc/numbersets.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/numbersets/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/numbersets/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/numbersets/README.md	2024-10-14 19:11:30 UTC (rev 72547)
@@ -0,0 +1,29 @@
+# The `numbersets` Package
+
+## Overview
+
+The `numbersets` package allows users to express mathematical concepts related to sets of numbers
+using meaningful commands rather than relying on visual representations.
+
+For example, using `\RealNumbers` clearly indicates the intention of denoting the set of all real numbers, 
+while `\mathbb{R}` focuses solely on the formatting without conveying the underlying concept.
+Therefore, using `\RealNumbers` is preferable because it provides more context and meaning. 
+
+### Key Features:
+- Command to specify typefaces for number sets.
+- Interface for defining typeface rules.
+- Interface for creating commands that represent number sets.
+- Several predefined presets for common number sets.
+
+## Contributing, Issue Reporting, and Repository Access
+
+The source code for the `numbersets` package is hosted on GitHub.
+
+[https://github.com/enunun/numbersets](https://github.com/enunun/numbersets)
+
+If you have any suggestions, feature requests, or bug reports, we encourage you to submit them via the repository’s issue tracker.
+This ensures that improvements and fixes are addressed efficiently. You can visit the Issues tab in the repository to create a new issue.
+
+## License
+
+This package is released under the MIT License, see [LICENSE](https://github.com/enunun/numbersets/blob/main/LICENSE).
\ No newline at end of file


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

Index: trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.pdf	2024-10-14 19:10:45 UTC (rev 72546)
+++ trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.pdf	2024-10-14 19:11:30 UTC (rev 72547)

Property changes on: trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.tex	2024-10-14 19:11:30 UTC (rev 72547)
@@ -0,0 +1,301 @@
+% configuration for llmk
+% +++
+% sequence = [ "latex", "makeindex", "latex", "latex" ]
+% latex = "lualatex"
+% makeindex = "mendex"
+% [programs.makeindex]
+% args = ["%B.idx", "-sgind.ist"]
+% +++
+
+\documentclass{l3doc}
+
+\usepackage{makeidx}
+
+% Documentation target
+\usepackage{numbersets} 
+
+\usepackage{booktabs}
+\usepackage{bxtexlogo}
+\usepackage{listings}
+\lstset{basicstyle=\ttfamily, escapeinside=||, tabsize=4, columns=fullflexible}
+\usepackage{unicode-math}
+\setmainfont{TeX Gyre Pagella}
+\setsansfont{TeX Gyre Heros}
+\setmonofont{Latin Modern Mono}
+\setmathfont{TeX Gyre Pagella Math}
+
+\NewDocumentCommand{\ThisPackageName}{}{\pkg{numbersets}}
+\NewDocumentCommand{\sourcecode}{m}{\texttt{#1}}
+
+\title{The \ThisPackageName{} Package}
+\author{Takumi Noguchi (enunun)}
+\date{2024-10-13}
+
+\begin{document}
+
+\maketitle
+
+\tableofcontents
+
+\section{Overview}
+
+The \ThisPackageName{} package provides an easy way to implement the common preference for using commands
+that represent the \emph{meaning} of concepts to be expressed,
+rather than focusing solely on their visual appearance.
+For example, using a command like ``\cs[no-index]{RealNumbers}'' to denote the set of all real numbers \(\RealNumbers[style=bb]\) is preferable
+to using a purely visual representation like ``\cs[no-index]{mathbb\{R\}}''.
+
+This package provides the following key features:
+\begin{itemize}
+	\item A command to apply the desired typeface for representing sets of numbers.
+	\item An interface for defining rules that specify the typefaces for these sets.
+	\item An interface for defining commands that represent sets of numbers.
+	\item Several predefined presets for common number sets.
+\end{itemize}
+
+Although the default configuration assumes the use of the \pkg{unicode-math} package for handling mathematical typefaces,
+the \ThisPackageName{} package itself does not load the \pkg{unicode-math} package.
+To use the package with default settings,
+it is required to import the \pkg{unicode-math} package \emph{explicitly} in your document.
+However, since the \pkg{unicode-math} package is not loaded automatically by the \ThisPackageName{} package,
+users can modify their configuration even if the \pkg{unicode-math} package cannot be used.
+See the section \ref{sec:withoutunicode-math} for more details.
+
+
+\section{Package Options}
+\label{sec:packageoptions}
+
+\DescribeOption{style}
+The \ThisPackageName{} package provides a single option for customization:
+the \sourcecode{style} option.
+This option allows users to specify the typeface to be used when displaying number sets,
+and it is defined using a key-value format.
+
+\begin{itemize}
+	\item \sourcecode{bb}: BlackBoard Bold (default), like \(\NumberSet[style = bb]{N}\).
+	\item \sourcecode{bfup}: Bold Upright, like \(\NumberSet[style = bfup]{N}\).
+	\item \sourcecode{bfit}: Bold Italic, like \(\NumberSet[style = bfit]{N}\)
+\end{itemize}
+
+
+\begin{function}{\SetupNumberSetsOptions}
+	\begin{syntax}
+		\cs[no-index]{SetupNumberSetsOptions}\marg{options}
+	\end{syntax}
+	Changes the global options for the \ThisPackageName{} package,
+	which can be applied after the package import or at any point in the document.
+\end{function}
+
+For example, to set the default style to Bold Upright, you would write:
+\begin{lstlisting}
+	\SetupNumberSetsOptions{style=bfup}
+\end{lstlisting}
+
+
+\section{Basic Usage}
+
+The \cs{NumberSet} command allows users to display number sets using the desired typeface.
+The command can be customized by passing an optional \sourcecode{style} argument to specify the typeface locally for the number set.
+While the \sourcecode{style} option of this command affects only the local instance, the values
+it accepts are the same as those used for the package-level \sourcecode{style} option in the Section \ref{sec:packageoptions}.
+
+
+\begin{function}{\NumberSet}
+	\begin{syntax}
+		\cs{NumberSet}\oarg{options}\marg{symbol}
+	\end{syntax}
+	This command displays the specified number set
+	with the typeface defined by the \sourcecode{style} option. If no style is specified, the default style is applied.
+
+	It should be noted that the \cs[no-index]{NumberSet} command is primarily intended for use within math mode,
+	similar to how the \cs[no-index]{mathbb} command is typically used in math mode to display sets like \cs[no-index]{mathbb\{N\}}.
+\end{function}
+
+In the above examples:
+\begin{itemize}
+	\item \cs[no-index]{NumberSet\{N\}}: will be displayed like $\NumberSet{N}$ in the default style.
+	\item \cs[no-index]{NumberSet[style=bb]\{Z\}}: will be displayed like $\NumberSet[style=bb]{Z}$ in the BlackBoard Bold style.
+	\item \cs[no-index]{NumberSet[style=bfup]\{R\}}: will be displayed like $\NumberSet[style=bfup]{R}$ in the Bold Upright style.
+	\item \cs[no-index]{NumberSet[style=bfit]\{C\}}: will be displayed like $\NumberSet[style=bfit]{C}$ in the Bold Italic style.
+\end{itemize}
+
+It is important to note that the \cs[no-index]{NumberSet} command,
+while versatile, is a more generic and less descriptive command.
+For clarity and better readability in the main text,
+it is recommended to use more descriptive commands such as \cs[no-index]{NaturalNumbers} for representing the set of natural numbers.
+These commands provide more context and meaning, making the content easier to understand.
+See the section \ref{sec:customcommand} for defining custom commands for sets of numbers,
+and some presets described in the section \ref{sec:predefinedpresets} are provided by this package.
+
+
+\section{Defining Custom Number Set Commands}
+\label{sec:customcommand}
+
+The \cs{DeclareNumberSetCommand} allows users to define new commands for representing number sets with specific names,
+enhancing readability and semantic clarity in documents. This command can be particularly useful
+when you want to create descriptive names for commonly used number sets.
+
+\begin{function}{\DeclareNumberSetCommand}
+	\begin{syntax}
+		\cs{DeclareNumberSetCommand}\marg{name}\marg{symbol}
+	\end{syntax}
+	This command defines a new number set command. The first argument \meta{name} specifies the name of the new command,
+	while the second argument \meta{symbol} represents the symbol that will be displayed.
+\end{function}
+
+For example, to define a command for the set of all quaternions by \(\NumberSet{H}\), you would write:
+\begin{lstlisting}
+	\DeclareNumberSetCommand{Quaternions}{H}
+\end{lstlisting}
+
+Once defined, you can use the new command \cs[no-index]{Quaternions} in your document to display the symbol for the set of all quaternions.
+In addition, you can use the optional argument \sourcecode{style} to specify the typeface locally,
+similar to the \cs[no-index]{NumberSet} command.
+To display the set of all quaternions that you just defined above, you would write:
+\begin{lstlisting}
+	\Quaternions[style=bfup]
+\end{lstlisting}
+
+Internally, the definition using \cs[no-index]{DeclareNumberSetCommand}\marg{name}\marg{symbol} is equivalent to the following definition:
+\begin{lstlisting}
+	\NewDocumentCommand\|\meta{name}|
+	{o}
+	{
+		\IfValueTF{#1}
+        {
+            \NumberSet[#1]{|\meta{symbol}|}
+        }
+        {
+            \NumberSet{|\meta{symbol}|}
+        }
+	}
+\end{lstlisting}
+
+\section{Defining Custom Number Set Styles}
+
+The \cs{DeclareNumberSetStyle} command allows users to define (or overwrite)
+new styles (or registered styles) for displaying number sets,
+giving users greater control over the typeface used.
+This command can be useful when the built-in styles are insufficient for specific design needs.
+
+\begin{function}{\DeclareNumberSetStyle}
+	\begin{syntax}
+		\cs{DeclareNumberSetStyle}\marg{style}\marg{command}
+	\end{syntax}
+	This command defines a new style for number sets. The first argument \meta{style} specifies the name of the style,
+	and the second argument \meta{command} indicates the typeface command that will be applied when this style is selected.
+\end{function}
+
+For example, to define a new style using a bold sans-serif font, you would write:
+\begin{lstlisting}
+	\DeclareNumberSetStyle{boldsans}{\symbfsfup}
+\end{lstlisting}
+Once defined, you can use the identifier ``\sourcecode{boldsans}'' for the value of \sourcecode{style} option
+in the following commands:
+\begin{itemize}
+	\item \cs[no-index]{NumberSet} command
+	\item \cs[no-index]{SetupNumberSetsOptions} command
+	\item Custom command defined by the \cs[no-index]{DeclareNumberSetCommand} command
+\end{itemize}
+
+It should be noted that the \meta{command} argument of the \cs[no-index]{DeclareNumberSetStyle} command
+can accept \emph{only} a single control sequence.
+Namely, combinations of multiple commands (e.g., \cs[no-index]{overline\cs[no-index]{symbb}}) are not supported.
+To avoid this limitation, you should define a single control sequence as an abbreviation for the combinations.
+In this case, you should define an abbreviation like ``\cs[no-index]{bbline}'';
+after that, you can define the style identifier using this single control sequence:
+\begin{lstlisting}
+	\NewDocumentCommand\bbline{m}{\overline{\symbb{#1}}}
+	\DeclareNumberSetStyle{bbline}{\bbline}
+\end{lstlisting}
+
+The values (\sourcecode{bb}, \sourcecode{bfup}, \sourcecode{bfit}) provided by default for the style option
+can be considered as pre-defined identifiers that the \cs[no-index]{DeclareNumberSetStyle} command declares.
+The Table \ref{tab:predefinedidentifier} shows
+the list of predefined identifiers and the commands corresponding to each identifier.
+\begin{table}[h]
+	\centering
+	\caption{Predefined identifiers for the values of the \sourcecode{style} option}
+	\label{tab:predefinedidentifier}
+	\begin{tabular}{cc}
+		\toprule
+		Identifer         & Command                \\
+		\midrule
+		\sourcecode{bb}   & \cs[no-index]{symbb}   \\
+		\sourcecode{bfup} & \cs[no-index]{symbfup} \\
+		\sourcecode{bfit} & \cs[no-index]{symbfit} \\
+		\bottomrule
+	\end{tabular}
+\end{table}
+
+
+\section{Using Without the \pkg{unicode-math} Package}
+\label{sec:withoutunicode-math}
+
+Although the default configuration of this package assumes the use of \pkg{unicode-math} package for handling mathematical typefaces,
+the \ThisPackageName{} package itself does not load the \pkg{unicode-math} package.
+Therefore, you can use the \ThisPackageName{} package without the \pkg{unicode-math} package by overriding the default configuration.
+
+Here is an example to use the \ThisPackageName{} package with \pkg{amssymb} package for blackboard bold symbols and \pkg{bm} package for bold italic symbols:
+\begin{lstlisting}
+	\usepackage{amssymb}
+	\usepackage{bm}
+	\usepackage{numbersets}
+	\DeclareNumberSetStyle{bb}{\mathbb}
+	\DeclareNumberSetStyle{bfup}{\mathbf}
+	\DeclareNumberSetStyle{bfit}{\bm}
+	...
+	% in the document
+	% equivalent to \mathbb{P}
+	\NumberSet[style=bb]{P}
+	% equivalent to \mathbf{A}
+	\NumberSet[style=bfup]{A}
+	% equivalent to \bm{H}
+	\NumberSet[style=bfit]{H}
+\end{lstlisting}
+
+Note that you only need to reconfigure the styles that you actually use in your document.
+For example, if you only use the \sourcecode{bb} style, there is no need to reconfigure the unused \sourcecode{bfup} and \sourcecode{bfit} styles.
+
+\section{Predefined Presets for Common Number Sets}
+\label{sec:predefinedpresets}
+
+\begin{function}{\NaturalNumbers, \Integers, \RationalNumbers, \RealNumbers, \ComplexNumbers}
+	Several predefined presets are available in the \ThisPackageName{} package for commonly used number sets.
+	These presets are designed to help you clearly express the intended mathematical meaning,
+	rather than just applying a specific format.
+	The table \ref{tab:predefinednumberset} shows the list
+	of predefined commands for common sets of numbers.
+\end{function}
+
+\begin{table}[h]
+	\centering
+	\caption{Predefined commands for common sets of numbers}
+	\label{tab:predefinednumberset}
+	\begin{tabular}{cc}
+		\toprule
+		Command name         & Output by default    \\
+		\midrule
+		\cs{NaturalNumbers}  & \(\NaturalNumbers\)  \\
+		\cs{Integers}        & \(\Integers\)        \\
+		\cs{RationalNumbers} & \(\RationalNumbers\) \\
+		\cs{RealNumbers}     & \(\RealNumbers\)     \\
+		\cs{ComplexNumbers}  & \(\ComplexNumbers\)  \\
+		\bottomrule
+	\end{tabular}
+\end{table}
+
+\section{Contributing, Issue Reporting, and Repository Access}
+
+The source code for the \ThisPackageName{} package is hosted on GitHub at the following repository:
+\begin{quote}
+	\url{https://github.com/enunun/numbersets}
+\end{quote}
+
+If you have any suggestions, feature requests, or bug reports,
+we encourage you to submit them via the repository's issue tracker.
+This ensures that improvements and fixes are addressed efficiently. You can visit the ``Issues'' tab in the repository to create a new issue.
+
+\printindex
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/numbersets/numbersets-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/numbersets/numbersets.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/numbersets/numbersets.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/numbersets/numbersets.sty	2024-10-14 19:11:30 UTC (rev 72547)
@@ -0,0 +1,120 @@
+\ProvidesExplPackage{numbersets}{2024-10-13}{v0.1.0}{A package for displaying number sets with customizable typefaces}
+
+% List of properties to store style commands
+\prop_new:N \g_numbersets_styles_prop
+
+% Global default style for the package
+\cs_new:Nn \g_numbersets_default_style_tl: { bb }
+
+% Presets for typefaces
+\prop_put:Nnn \g_numbersets_styles_prop { bb } { \symbb }
+\prop_put:Nnn \g_numbersets_styles_prop { bfup } { \symbfup }
+\prop_put:Nnn \g_numbersets_styles_prop { bfit } { \symbfit }
+
+% Options for package
+\keys_define:nn { numbersets }
+{
+	style .tl_set:N = \g_numbersets_default_style_tl,
+	style .initial:n = bb,
+}
+
+\ProcessKeyOptions
+
+% Validation for property
+\cs_new_protected:Npn \numbersets_check_style:n #1
+{
+	\prop_if_in:NnTF \g_numbersets_styles_prop { #1 }
+	{ }
+	{
+		\msg_error:nnn { numbersets } { unknown-style } { #1 }
+	}
+}
+
+% Error message for unknown options
+\msg_new:nnn { numbersets } { unknown-style }
+{
+	The~style~'#1'~is~not~declared.
+}
+
+% Command to declare (or overwrite) styles
+\NewDocumentCommand{\DeclareNumberSetStyle}{ m m }
+{
+	\prop_put:Nnn \g_numbersets_styles_prop { #1 } { #2 }
+}
+
+% Command for setup global option 
+\NewDocumentCommand{\SetupNumberSetsOptions}{ m }
+{
+	\keys_set:nn { numbersets } { #1 }
+}
+
+% Function to apply the style command
+\cs_new_protected:Npn \numbersets_apply_style:n #1
+{
+	\prop_get:NnNTF \g_numbersets_styles_prop { #1 } \l_tmpa_tl
+	{
+		\use:n { \l_tmpa_tl }
+	}
+	{
+		\msg_error:nnn { numbersets } { unknown-style } { #1 }
+	}
+}
+
+% Store the style identifer of the \numberset command as a local variable
+\cs_new:Nn \l_numbersets_style_tl: { }
+
+% Options for the \numberset command
+\keys_define:nn { numberset }
+{
+	style .tl_set:N = \l_numbersets_style_tl,
+}
+
+% Command to display the set symbol with custom typefaces
+\NewDocumentCommand{\NumberSet}{ O{} m }
+{
+	\group_begin:
+	\keys_set:nn { numberset } { #1 }
+	\tl_if_empty:VTF \l_numbersets_style_tl
+	{
+		\tl_set_eq:NN \l_numbersets_style_tl \g_numbersets_default_style_tl
+	}
+	{}
+	\expandafter\numbersets_apply_style:n \expandafter{ \l_numbersets_style_tl }
+	{ #2 }
+	\group_end:
+}
+
+% Command to declare custom commands for set composed of numbers
+\NewDocumentCommand{\DeclareNumberSetCommand}{ m m }
+{
+	\expandafter\NewDocumentCommand\cs:w#1\cs_end:
+	{o}
+	{
+		\IfValueTF{##1}
+		{
+			\NumberSet[##1]{#2}
+		}
+		{
+			\NumberSet{#2}
+		}
+	}
+}
+
+% Presets for some sets composed of numbers
+
+% Natural numbers
+\DeclareNumberSetCommand{NaturalNumbers}{N}
+
+% Integers
+\DeclareNumberSetCommand{Integers}{Z}
+
+% Rational numbers
+\DeclareNumberSetCommand{RationalNumbers}{Q}
+
+% Real Numbers
+\DeclareNumberSetCommand{RealNumbers}{R}
+
+% Complex Numbers
+\DeclareNumberSetCommand{ComplexNumbers}{C}
+
+\endinput
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/numbersets/numbersets.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	2024-10-14 19:10:45 UTC (rev 72546)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2024-10-14 19:11:30 UTC (rev 72547)
@@ -623,7 +623,7 @@
     notex-bst noto noto-emoji notoccite notomath
     novel nowidow nox
     nrc ntgclass nth ntheorem ntheorem-vn nuc nucleardata
-    numberedblock numberpt
+    numberedblock numberpt numbersets
     numerica numerica-plus numerica-tables numericplots
     numname numnameru numprint numspell nunito
     nwafuthesis nwejm nxuthesis

Modified: trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2024-10-14 19:10:45 UTC (rev 72546)
+++ trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2024-10-14 19:11:30 UTC (rev 72547)
@@ -176,6 +176,7 @@
 depend nicematrix
 depend nuc
 depend nucleardata
+depend numbersets
 depend numerica
 depend numerica-plus
 depend numerica-tables

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


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