summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-02-03 22:31:53 +0000
committerKarl Berry <karl@freefriends.org>2020-02-03 22:31:53 +0000
commited733e4d8a5cf0e887872e05c3bb7bb25f54a515 (patch)
treeca57edb35c2d237cd3b0c757c9ee11365fcf269d /Master/texmf-dist/source
parent95bf7f250dbac1d55df4f24bd88c21372a555774 (diff)
secnum (3feb20)
git-svn-id: svn://tug.org/texlive/trunk@53657 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/secnum/secnum.dtx54
1 files changed, 32 insertions, 22 deletions
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