Debian Codegraph @

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

raw
1 %% LaTeX2e file `etocsnippet-06.tex'
2 %% generated by the `filecontentsdef' environment
3 %% from source `etoc' on 2026/05/05.
4 %%
5 \begingroup % we start a group to keep the style changes local
6 \newlength{\tocleftmargin} \setlength{\tocleftmargin}{4cm}
7 \newlength{\tocrightmargin} \setlength{\tocrightmargin}{1cm}
8
9 \etocsetlinestyle{section} % will pretend to be a Chapter
10 {\addvspace{1ex}\parfillskip0pt
11 \leftskip\tocleftmargin % (already done in title)
12 \rightskip\the\tocrightmargin plus 1fil
13 \parindent0pt\color{cyan}} % (already done)
14 {\bfseries\LARGE\upshape\addvspace{1ex}\leavevmode}
15 {\llap{Chapter\hspace{.5em}{\etocnumber}\hspace{.75cm}}\etocname
16 \nobreak\hfill\kern1em\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par}
17 {}
18
19 \etocsetlinestyle{subsection} % will pretend to be a Section
20 {}
21 {\mdseries\large\addvspace{.5ex}\leavevmode}
22 {\llap{\etocnumber\hspace{.75cm}}\textit{\etocname}%
23 \hfill\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par}
24 {}
25
26 \def\tmptitle{My Beautiful Thesis}
27 \etocsettocstyle{\color{cyan}\parindent0pt \leftskip\tocleftmargin
28 \leavevmode\leaders\hrule height 1pt\hfill\
29 \huge\textit{\tmptitle}\par}{\bigskip}
30
31 \tableofcontents \ref{toc:overview}
32 \endgroup