texlive[53657] Master/texmf-dist: secnum (3feb20)

commits+karl at tug.org commits+karl at tug.org
Mon Feb 3 23:31:53 CET 2020


Revision: 53657
          http://tug.org/svn/texlive?view=revision&revision=53657
Author:   karl
Date:     2020-02-03 23:31:53 +0100 (Mon, 03 Feb 2020)
Log Message:
-----------
secnum (3feb20)

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

Modified: trunk/Master/texmf-dist/doc/latex/secnum/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/secnum/README.md	2020-02-03 22:31:41 UTC (rev 53656)
+++ trunk/Master/texmf-dist/doc/latex/secnum/README.md	2020-02-03 22:31:53 UTC (rev 53657)
@@ -3,6 +3,11 @@
 
 This package provides a macro \setsecnum to format section numbering intuitively.
 
+## Usage
+
+One can simply use `\setsecnum{1.1.1}` to set the section numbering
+format as `arabic.arabic.arabic` and depth to be 3.
+
 ## Installation
 
 The installation is the same as usual Tex packages.

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

Modified: trunk/Master/texmf-dist/source/latex/secnum/secnum.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/secnum/secnum.dtx	2020-02-03 22:31:41 UTC (rev 53656)
+++ trunk/Master/texmf-dist/source/latex/secnum/secnum.dtx	2020-02-03 22:31:53 UTC (rev 53657)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2019 
+% Copyright (C) 2019-- 
 % Gau, Syu ( GauSyu at Gmail.com )
 %
 % ----------------------------------------------------------------------
@@ -31,6 +31,11 @@
 
 This package provides a macro \setsecnum to format section numbering intuitively.
 
+## Usage
+
+One can simply use `\setsecnum{1.1.1}` to set the section numbering
+format as `arabic.arabic.arabic` and depth to be 3. 
+
 ## Installation
 
 The installation is the same as usual Tex packages.
@@ -72,7 +77,7 @@
 
 \preamble
 
-Copyright (C) 2019 
+Copyright (C) 2019-- 
 Gau, Syu ( GauSyu at Gmail.com )
  
 ----------------------------------------------------------------------
@@ -136,11 +141,14 @@
 \cs_set_eq:NN \__codedoc_macro_end_style:n \use_none:n
 \ExplSyntaxOff
 \DeclareRobustCommand \opt {\texttt}
+\def\glossaryname{Changes History}
+\GlossaryPrologue{\section{\glossaryname}}
 \EnableCrossrefs
 \CodelineIndex
 \RecordChanges
 \begin{document}
   \DocInput{\jobname.dtx}
+  \PrintChanges
 \end{document}
 %</driver>
 % \fi
@@ -169,7 +177,7 @@
 %   marco \cs{setsecnum} in preamble.
 %  \begin{function}{\setsecnum}
 %  \begin{syntax}
-%    \cs{setsecnum} \meta{num format}
+%    \cs{setsecnum}\marg{num format}
 %  \end{syntax}
 %    A typical \meta{num format} is like this:
 %  \begin{center}
@@ -218,10 +226,10 @@
 %   The following is the implementation. 
 %   Users can ignore.
 % \subsection{Preparations}
-%   This document class uses \LaTeX3. 
-%   Therefore, the packages \pkg{expl3}, \pkg{xparse} 
-%   and \pkg{l3keys2e} are needed and should use 
-%   \cs{ProvidesExplClass} rather than \cs{ProvidesClass}.
+%   This package uses \LaTeX3. 
+%   Therefore, the packages \pkg{expl3} and \pkg{xparse}
+%   are needed and should use 
+%   \cs{ProvidesExplPackage} rather than \cs{ProvidesPackage}.
 %
 %    \begin{macrocode}
 %<*package>
@@ -228,7 +236,7 @@
 %<@@=syu>
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
-\ProvidesExplPackage{secnum}{2020/01/01}{}
+\ProvidesExplPackage{secnum}{2020/02/02}{}
   { An intuitive way to format section numbering }
 \RequirePackage{xparse}
 %    \end{macrocode}
@@ -293,33 +301,35 @@
 %    \end{macrocode}
 %   Replace syntax abbrs by corresponding macros.
 %    \begin{macrocode}
-    \syu_secnum_unabbr:N \l__syu_secnum_tl
+    \__syu_secnum_unabbr:N \l__syu_secnum_tl
 %    \end{macrocode}
 %   Split into a sequence by macros.
 %    \begin{macrocode}
-    \syu_split_by_macros:NN \l__syu_secnum_tl \l__syu_secnum_seq
+    \__syu_split_by_macros:NN \l__syu_secnum_tl \l__syu_secnum_seq
 %    \end{macrocode}
 %   Read formatting information.
 %    \begin{macrocode}
-    \syu_secnum_from_seq:N \l__syu_secnum_seq
+    \__syu_secnum_from_seq:N \l__syu_secnum_seq
 %    \end{macrocode}
-%   Set the \opt{secnumdepth}.
+%   Set the \opt{secnumdepth} and \opt{tocdepth}.
+%   \changes{2020/01/12}{2020/01/12}{Add codes to set \opt{tocdepth}.}
 %    \begin{macrocode}
     \setcounter{secnumdepth}{ \seq_count:N \l__syu_secnum_seq }
+    \setcounter{tocdepth}{ \seq_count:N \l__syu_secnum_seq }
 %    \end{macrocode}
 %   Format numberings.
 %    \begin{macrocode}
-    \syu_secnum:
+    \__syu_secnum:
   }
 %    \end{macrocode}
 %  \end{macro}
 %
 % \subsection{Unabbravation}
-%  \begin{variable}{ \syu_secnum_unabbr:N }
+%  \begin{variable}{ \__syu_secnum_unabbr:N }
 %   This function replace the abbrs in a \meta{tl var}  
 %   by expansions.
 %    \begin{macrocode}
-\cs_new_protected:Npn \syu_secnum_unabbr:N #1
+\cs_new_protected:Npn \__syu_secnum_unabbr:N #1
   {
     \regex_replace_all:nnN {A} {\c{Alph}} #1
     \regex_replace_all:nnN {a} {\c{alph}} #1
@@ -331,11 +341,11 @@
 %  \end{variable}
 %
 % \subsection{Split to sequence}
-%  \begin{variable}{ \syu_split_by_macros:NN }
+%  \begin{variable}{ \__syu_split_by_macros:NN }
 %   This function split a \meta{tl var} into a \meta{sequence} 
 %   by macros.
 %    \begin{macrocode}
-\cs_new_protected:Npn \syu_split_by_macros:NN #1 #2
+\cs_new_protected:Npn \__syu_split_by_macros:NN #1 #2
   {
     \tl_clear:N \l_tmpa_tl
     \seq_clear:N #2
@@ -392,10 +402,10 @@
 %  \end{variable}
 %
 % \subsection{Read formatting info}
-%  \begin{variable}{ \syu_secnum_from_seq:N  }
+%  \begin{variable}{ \__syu_secnum_from_seq:N  }
 %   Read the formatting info from given \meta{sequence}.
 %    \begin{macrocode}
-\cs_new_protected:Npn \syu_secnum_from_seq:N #1
+\cs_new_protected:Npn \__syu_secnum_from_seq:N #1
   {
 %    \end{macrocode}
 %   Use \cs{tl_gset:Nx} since: 1, these data are global and 
@@ -418,10 +428,10 @@
 %  \end{variable}
 %
 % \subsection{Formatting}
-%  \begin{variable}{ \syu_secnum:  }
+%  \begin{variable}{ \__syu_secnum:  }
 %   Formatting section numbering.
 %    \begin{macrocode}
-\cs_new:Nn \syu_secnum: 
+\cs_new:Nn \__syu_secnum: 
   {
 %    \end{macrocode}
 %   When \cs{thechapter} is defined, start from it.
@@ -464,7 +474,7 @@
 %\end{implementation}
 %
 %
-% \changes{}{2020/01/01}{Correct the package name.}
+% \changes{2020/01/01}{2020/01/01}{Correct the package name.}
 %
 % \Finale
 \endinput
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/secnum/secnum.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/secnum/secnum.sty	2020-02-03 22:31:41 UTC (rev 53656)
+++ trunk/Master/texmf-dist/tex/latex/secnum/secnum.sty	2020-02-03 22:31:53 UTC (rev 53657)
@@ -6,7 +6,7 @@
 %%
 %% secnum.dtx  (with options: `package')
 %% 
-%% Copyright (C) 2019
+%% Copyright (C) 2019--
 %% Gau, Syu ( GauSyu at Gmail.com )
 %% 
 %% ----------------------------------------------------------------------
@@ -30,7 +30,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
-\ProvidesExplPackage{secnum}{2020/01/01}{}
+\ProvidesExplPackage{secnum}{2020/02/02}{}
   { An intuitive way to format section numbering }
 \RequirePackage{xparse}
 \tl_new:N \l__syu_secnum_tl
@@ -50,13 +50,14 @@
 \DeclareDocumentCommand{\setsecnum}{m}
   {
     \tl_set:Nn \l__syu_secnum_tl {#1}
-    \syu_secnum_unabbr:N \l__syu_secnum_tl
-    \syu_split_by_macros:NN \l__syu_secnum_tl \l__syu_secnum_seq
-    \syu_secnum_from_seq:N \l__syu_secnum_seq
+    \__syu_secnum_unabbr:N \l__syu_secnum_tl
+    \__syu_split_by_macros:NN \l__syu_secnum_tl \l__syu_secnum_seq
+    \__syu_secnum_from_seq:N \l__syu_secnum_seq
     \setcounter{secnumdepth}{ \seq_count:N \l__syu_secnum_seq }
-    \syu_secnum:
+    \setcounter{tocdepth}{ \seq_count:N \l__syu_secnum_seq }
+    \__syu_secnum:
   }
-\cs_new_protected:Npn \syu_secnum_unabbr:N #1
+\cs_new_protected:Npn \__syu_secnum_unabbr:N #1
   {
     \regex_replace_all:nnN {A} {\c{Alph}} #1
     \regex_replace_all:nnN {a} {\c{alph}} #1
@@ -64,7 +65,7 @@
     \regex_replace_all:nnN {i} {\c{roman}} #1
     \regex_replace_all:nnN {1} {\c{arabic}} #1
   }
-\cs_new_protected:Npn \syu_split_by_macros:NN #1 #2
+\cs_new_protected:Npn \__syu_split_by_macros:NN #1 #2
   {
     \tl_clear:N \l_tmpa_tl
     \seq_clear:N #2
@@ -94,7 +95,7 @@
         \prg_return_false:
       \fi:
   }
-\cs_new_protected:Npn \syu_secnum_from_seq:N #1
+\cs_new_protected:Npn \__syu_secnum_from_seq:N #1
   {
     \tl_gset:Nx \g__syu_chapter_tl
       { \seq_item:Nn #1 { \g__syu_if_thechapter_int } }
@@ -109,7 +110,7 @@
     \tl_gset:Nx \g__syu_subparagraph_tl
       { \seq_item:Nn #1 { 5 + \g__syu_if_thechapter_int } }
   }
-\cs_new:Nn \syu_secnum:
+\cs_new:Nn \__syu_secnum:
   {
     \if_cs_exist:N \thechapter
       \renewcommand*{\thechapter}



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