Debian Codegraph @

texmf-dist/doc/latex/etoc/etocsnippet-23.tex

raw
1 %% LaTeX2e file `etocsnippet-23.tex'
2 %% generated by the `filecontentshere' environment
3 %% from source `etoc' on 2026/05/05.
4 %%
5 \makeatletter
6 \newcommand*\firstsubname {} \newcommand*\lastsubname {}
7 \newcommand*\firstsubnumber {} \newcommand*\lastsubnumber {}
8 \newcommand*\thisspecialstatsaux{}
9 \newcommand*{\thisspecialstats}{%
10 \setcounter{mycounti}{0}%
11 \def\thisspecialstatsaux{%
12 \let\firstsubname\etocthelinkedname
13 \let\firstsubnumber\etocthelinkednumber
14 \def\thisspecialstatsaux{}}
15 \begingroup
16 \etocsetlinestyle{subsection} {} {}
17 {\thisspecialstatsaux
18 \stepcounter{mycounti}%
19 \let\lastsubname\etocthelinkedname
20 \let\lastsubnumber\etocthelinkednumber }
21 {Here are some statistics for this section. It contains \arabic{mycounti}
22 subsections. The name of its first is \emph{\firstsubname{}} and the
23 corresponding number is {\firstsubnumber}. The name of the last
24 subsection is \emph{\lastsubname{}} and its number is {\lastsubnumber}.}%
25 \etocsettocstyle {}{}
26 \etocinline
27 \etocsetnexttocdepth {1}%
28 \localtableofcontents % to be used within a section
29 \endgroup
30 }
31 \makeatother