Debian Codegraph @

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

raw
1 %% LaTeX2e file `etocsnippet-19.tex'
2 %% generated by the `filecontentsdef' environment
3 %% from source `etoc' on 2026/05/05.
4 %%
5 \begingroup
6 \etocglobaldefs % necessary for \etocname etc... to survive &
7 \makeatletter
8 % hack into longtable \hline to avoid annoying (here) stray lines at top
9 \def\LT@@hline{%
10 \ifx\@let@token\hline
11 \global\let\@gtempa\@gobble
12 \global\let\@gtempb\@firstofone %%% ADDED
13 \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}%
14 \else
15 \global\let\@gtempa\@empty
16 \global\let\@gtempb\@gobble %%% ADDED
17 \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}%
18 \fi
19 \ifnum0=`{\fi}%
20 \multispan\LT@cols
21 \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
22 \@gtempb{% %%% ADDED
23 \noalign{\LT@sep}%
24 \multispan\LT@cols
25 \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
26 \noalign{\penalty\@M}%
27 }% %%% ADDED
28 \@gtempa}
29 \makeatother
30
31 % observe the locations of the \\
32 \etocsetlinestyle{part}
33 {}
34 {}
35 {\\\hline\multicolumn{3}{c}{\bfseries\vrule height6ex depth3ex width0pt
36 \makebox[0pt]{\etocifnumbered{\etocnumber. }{}\etocname}}}
37 {}
38
39 \etocsetlinestyle{section}
40 {}
41 {\etociffirst{\\\hline}{\\}}
42 {\etocnumber&\etocname &\etocpage }
43 {}
44
45 \etocsetlinestyle{subsection}
46 {}
47 {\\}
48 {&\makebox[1cm][c]{\etocnumber}%
49 \parbox[t]{\dimexpr6cm-\tabcolsep\relax}{\sloppy\itshape\etocname\strut}%
50 &\itshape\etocpage }
51 {}
52
53 \etocsettocstyle
54 {\hypersetup{hidelinks}%
55 \begin{longtable}{|>{\bfseries}c|p{7cm}|r|}
56 \hline
57 \multicolumn{3}{|c|}{\Large\bfseries\strut\strut TABLE OF CONTENTS}%
58 }
59 {\\\hline\end{longtable}}
60
61 \etocsetnexttocdepth {subsection}
62
63 \tableofcontents
64 \endgroup