diff options
author | Karl Berry <karl@freefriends.org> | 2020-02-03 22:31:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-02-03 22:31:53 +0000 |
commit | ed733e4d8a5cf0e887872e05c3bb7bb25f54a515 (patch) | |
tree | ca57edb35c2d237cd3b0c757c9ee11365fcf269d /Master/texmf-dist | |
parent | 95bf7f250dbac1d55df4f24bd88c21372a555774 (diff) |
secnum (3feb20)
git-svn-id: svn://tug.org/texlive/trunk@53657 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/secnum/README.md | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/secnum/secnum.pdf | bin | 57260 -> 381934 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/secnum/secnum.dtx | 54 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/secnum/secnum.sty | 21 |
4 files changed, 48 insertions, 32 deletions
diff --git a/Master/texmf-dist/doc/latex/secnum/README.md b/Master/texmf-dist/doc/latex/secnum/README.md index 8748c961903..9ee10bcae85 100644 --- a/Master/texmf-dist/doc/latex/secnum/README.md +++ b/Master/texmf-dist/doc/latex/secnum/README.md @@ -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. diff --git a/Master/texmf-dist/doc/latex/secnum/secnum.pdf b/Master/texmf-dist/doc/latex/secnum/secnum.pdf Binary files differindex e26107701c5..101df250f95 100644 --- a/Master/texmf-dist/doc/latex/secnum/secnum.pdf +++ b/Master/texmf-dist/doc/latex/secnum/secnum.pdf diff --git a/Master/texmf-dist/source/latex/secnum/secnum.dtx b/Master/texmf-dist/source/latex/secnum/secnum.dtx index 5d2fe91f37b..1220b7ec59b 100644 --- a/Master/texmf-dist/source/latex/secnum/secnum.dtx +++ b/Master/texmf-dist/source/latex/secnum/secnum.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2019 +% Copyright (C) 2019-- % Gau, Syu ( GauSyu@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 @@ One can also download the generated files from the [github release](https://gith \preamble -Copyright (C) 2019 +Copyright (C) 2019-- Gau, Syu ( GauSyu@Gmail.com ) ---------------------------------------------------------------------- @@ -136,11 +141,14 @@ The Current Maintainer of this work is \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 @@ The Current Maintainer of this work is % 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,17 +226,17 @@ The Current Maintainer of this work is % 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> %<@@=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 @@ The Current Maintainer of this work is % \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 @@ The Current Maintainer of this work is % \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 @@ The Current Maintainer of this work is % \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 @@ The Current Maintainer of this work is % \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 @@ The Current Maintainer of this work is %\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 diff --git a/Master/texmf-dist/tex/latex/secnum/secnum.sty b/Master/texmf-dist/tex/latex/secnum/secnum.sty index c3e85d464d1..20f75a0c800 100644 --- a/Master/texmf-dist/tex/latex/secnum/secnum.sty +++ b/Master/texmf-dist/tex/latex/secnum/secnum.sty @@ -6,7 +6,7 @@ %% %% secnum.dtx (with options: `package') %% -%% Copyright (C) 2019 +%% Copyright (C) 2019-- %% Gau, Syu ( GauSyu@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} |