summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex')
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex99
1 files changed, 28 insertions, 71 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
index 1a291c0426e..03d59c42f7a 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
@@ -1,74 +1,31 @@
%% LaTeX2e file `etocsnippet-23.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/21.
+%% from source `etoc' on 2023/03/02.
%%
-\begingroup
-\definecolor{subsecnum}{RGB}{13,151,225}
-\definecolor{secbackground}{RGB}{0,177,235}
-\definecolor{tocbackground}{RGB}{212,237,252}
-
-\renewcommand{\etocbkgcolorcmd}{\color{tocbackground}}
-\renewcommand{\etocleftrulecolorcmd}{\color{tocbackground}}
-\renewcommand{\etocrightrulecolorcmd}{\color{tocbackground}}
-\renewcommand{\etocbottomrulecolorcmd}{\color{tocbackground}}
-\renewcommand{\etoctoprulecolorcmd}{\color{tocbackground}}
-
-\renewcommand{\etocleftrule}{\vrule width 1cm}
-\renewcommand{\etocrightrule}{\vrule width .5cm}
-\renewcommand{\etocbottomrule}{\hrule height 12pt}
-\renewcommand{\etoctoprule}{\hrule height 12pt}
-
-\renewcommand{\etocinnertopsep}{0pt}
-\renewcommand{\etocinnerbottomsep}{0pt}
-\renewcommand{\etocinnerleftsep}{0pt}
-\renewcommand{\etocinnerrightsep}{0pt}
-
-\newcommand\shiftedwhiterule[2]{%
- \hbox to \linewidth{\color{white}%
- \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip\vskip#2}
-
-\etocsetstyle{subsubsection}{\etocskipfirstprefix}
- {\shiftedwhiterule{\leftskip}{6pt}}
- {\sffamily\footnotesize
- \leftskip2.5cm\hangindent1cm\rightskip1cm\noindent
- \hbox to 1cm{\color{subsecnum}\etocnumber\hss}%
- \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill
- \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par
- \nointerlineskip\vskip3pt}
- {}
-
-\etocsetstyle{subsection}{\etocskipfirstprefix}
- {\shiftedwhiterule{1.5cm}{6pt}}
- {\sffamily\small
- \leftskip1.5cm\hangindent1cm\rightskip1cm\noindent
- \hbox to 1cm{\color{subsecnum}\etocnumber\hss}%
- \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill
- \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par
- \nointerlineskip\vskip6pt}
- {}
-
-\newcommand{\coloredstuff}[2]{%
- \leftskip0pt\rightskip0pt\parskip0pt
- \fboxsep0pt % \colorbox uses \fboxsep also when no frame!
- \noindent\colorbox{secbackground}
- {\parbox{\linewidth}{%
- \vskip5pt
- {\noindent\color{#1}#2\par}\nointerlineskip
- \vskip3pt}}%
- \par\nointerlineskip}
-
-\etocsetstyle{section}
-{\coloredstuff{white}
- {\hfil \hyperref[toc:b]{\bfseries\large I am a twin of
- that other TOC (click me!)}\hfil}}
-{\vskip3pt\sffamily\small}
-{\coloredstuff{white}
- {\leftskip1.5cm\rightskip.5cm\parfillskip-\rightskip
- \makebox[0pt][r]{\makebox[.5cm][r]{\etocnumber\hspace{.2cm}}}%
- \etocname\hfill\makebox[.5cm][r]{\etocpage\hspace{.2cm}}}%
- \vskip6pt }
-{}
-
-\etocframedstyle[1]{}
-\tableofcontents \label{toc:clone} \ref{toc:globalcmds}
-\endgroup
+\makeatletter
+\newcommand*\firstsubname {} \newcommand*\lastsubname {}
+\newcommand*\firstsubnumber {} \newcommand*\lastsubnumber {}
+\newcommand*\thisspecialstatsaux{}
+\newcommand*{\thisspecialstats}{%
+ \setcounter{mycounti}{0}%
+ \def\thisspecialstatsaux{%
+ \let\firstsubname\etocthelinkedname
+ \let\firstsubnumber\etocthelinkednumber
+ \def\thisspecialstatsaux{}}
+ \begingroup
+ \etocsetstyle{subsection} {} {}
+ {\thisspecialstatsaux
+ \stepcounter{mycounti}%
+ \let\lastsubname\etocthelinkedname
+ \let\lastsubnumber\etocthelinkednumber }
+ {Here are some statistics for this section. It contains \arabic{mycounti}
+ subsections. The name of its first is \emph{\firstsubname{}} and the
+ corresponding number is {\firstsubnumber}. The name of the last
+ subsection is \emph{\lastsubname{}} and its number is {\lastsubnumber}.}%
+ \etocsettocstyle {}{}
+ \etocinline
+ \etocsetnexttocdepth {1}%
+ \localtableofcontents % to be used within a section
+ \endgroup
+}
+\makeatother