diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex | 65 |
1 files changed, 45 insertions, 20 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex index aefa80b73d4..e576278e2a1 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex @@ -1,23 +1,48 @@ %% LaTeX2e file `etocsnippet-22.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape - \fbox{\parbox{.6\linewidth}{ - \leftskip 0pt plus .5fil - \rightskip 0pt plus -.5fil - \parfillskip 0pt plus 1fil This is the global table of - contents on two columns, using \etoc default line styles, but with - sections as chapters, and subsections as sections. - }}} -\etocdefaultlines -\etocsetnexttocdepth{1} -\begingroup -\etocsetlevel{section}{0} -\etocsetlevel{subsection}{1} -\renewcommand*{\etocfontone}{\normalfont \normalsize} -\renewcommand*{\etoctoclineleaders} - {\hbox{\normalfont\normalsize\hbox to 1ex {\hss.\hss}}} -\sloppy -\tableofcontents -\endgroup +\newsavebox\firstnamei \newsavebox\firstnumberi +\newsavebox\lastnamei \newsavebox\lastnumberi +\newsavebox\firstnameii \newsavebox\firstnumberii +\newsavebox\lastnameii \newsavebox\lastnumberii +\newcounter{mycounti} \newcounter{mycountii} +\newcommand*{\thispartstatsauxi}{} \newcommand*{\thispartstatsauxii}{} +\newcommand*{\oldtocdepth}{} +\newcommand*{\thispartstats}{% + \setcounter{mycounti}{0}% + \setcounter{mycountii}{0}% + \def\thispartstatsauxi{% + \sbox{\firstnamei}{\footnotesize\etocname}% + \sbox{\firstnumberi}{\footnotesize\etocnumber}% + \def\thispartstatsauxi{}}% + \def\thispartstatsauxii{% + \sbox{\firstnameii}{\footnotesize\etocname}% + \sbox{\firstnumberii}{\footnotesize\etocnumber}% + \def\thispartstatsauxii{}}% + \begingroup + \etocsetstyle{subsection} {} {} + {\thispartstatsauxii + \stepcounter{mycountii}% + \sbox{\lastnameii}{\footnotesize\etocname}% + \sbox{\lastnumberii}{\footnotesize\etocnumber}} {}% + \etocsetstyle{section} {} {} + {\thispartstatsauxi + \stepcounter{mycounti}% + \sbox{\lastnamei}{\footnotesize\etocname}% + \sbox{\lastnumberi}{\footnotesize\etocnumber}} + {{\footnotesize\itshape + Here are some statistics for this part: it contains \arabic{mycounti} + section\ifnum\value{mycounti}>1 s\fi{} and \arabic{mycountii} + subsection\ifnum\value{mycountii}>1 s\fi. The name of the first section is + \unhbox\firstnamei{} and the corresponding number is \unhbox\firstnumberi. + The name of the last section is \unhbox\lastnamei{} and its number is + \unhbox\lastnumberi. The name of the first subsection is \unhbox\firstnameii{} + and the corresponding number is \unhbox\firstnumberii. The name of the last + subsection is \unhbox\lastnameii{} and its number is \unhbox\lastnumberii.\par}}% + \etocinline % cancels the automatic \par automatically before the TOC + \etocsettocstyle {}{} + \etocsetnexttocdepth{2}% + \localtableofcontents % to be used at the top level of a Part. + \endgroup +} |