Debian Codegraph @

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

raw
1 %% LaTeX2e file `etocsnippet-09.tex'
2 %% generated by the `filecontentshere' environment
3 %% from source `etoc' on 2026/05/05.
4 %%
5 \makeatletter
6 \newcommand*\TOClocalstyle {%
7 \etocsettocstyle
8 {\if@twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi
9 \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}%
10 \parindent\z@
11 \dimen@ 2.25em % for left indenting
12 \section *{\kern\dimen@ % use of \dimen@ works here by sheer luck
13 \contentsname
14 % un-comment this if marks are wanted:
15 %\@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}%
16 }% end of \section
17 \parskip \z@skip
18 \vspace{-1.25\baselineskip}% somewhat ad hoc
19 \leftskip 2.25em
20 \rightskip 4.5em
21 \advance\rightskip-\TOCrightmargin\relax
22 \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par
23 \rightskip 4.5em
24 \parfillskip -\TOCrightmargin\relax }
25 {\nobreak\vskip-.5\baselineskip
26 \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par
27 \bigskip
28 \if@restonecol \twocolumn \fi }%
29 %
30 \etocsetlinestyle{section}
31 {\advance\leftskip\TOCnumwidthC\relax}
32 {\addpenalty \@secpenalty
33 \etociffirst{}{\addvspace{\TOCmedvskip}}%
34 \leavevmode
35 {\interlinepenalty\@M
36 % \bfseries % <<<< commented out for the 1.2e version of documentation
37 % no good if \TOCnumwidthC is expressed with em unit
38 % as the latter has been used already above for \leftskip
39 % so better to either redefine it to use pt or to move
40 % the \bfseries to after usage of \TOCnumwidthC
41 \etocifnumbered
42 {\llap{\makebox[\TOCnumwidthC][l]{\etocnumber}}}
43 {\advance\leftskip-\TOCnumwidthC}%
44 \etocname\nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }%
45 \penalty \@highpenalty }
46 {}
47 {\advance\leftskip-\TOCnumwidthC\relax}%
48 % the rest is identical with code for global tocs:
49 \TOCsetlinestyle {subsection} {\TOCnumwidthD}%
50 \TOCsetlinestyle {subsubsection}{\TOCnumwidthE}%
51 \TOCsetlinestyle {paragraph} {\TOCnumwidthF}%
52 \TOCsetlinestyle {subparagraph} {\TOCnumwidthG}%
53 }% end of \TOClocalstyle
54 \makeatother