%% LaTeX2e file `etocsnippet-24.tex'
%% generated by the `filecontentsdef' environment
%% from source `etoc' on 2023/10/29.
%%
\etocsetnexttocdepth {all}
\begingroup
\parindent 0pt \leftskip 0cm \rightskip .75cm \parfillskip -\rightskip
\newcommand*{\EndParWithPageNumberInMargin}
    {\nobreak\hfill
     % I initially added \etocnoprotrusion after \etocpage, but
     % finally switched to using monospace font for page number,
     % and it seems to have deactivated the protrusion anyhow.
     \makebox[0.75cm][r]{\mdseries\normalsize\ttfamily\etocpage}%
     \par}
\renewcommand*\etoctoclineleaders
    {\hbox{\normalfont\normalsize\hbox to .75ex {\hss.\hss}}}
\newcommand*{\EndParWithPageNumberInMarginAndLeaders}
    {\nobreak\leaders\etoctoclineleaders\hfill
     \makebox[0.75cm][r]{\mdseries\normalsize\ttfamily\etocpage}%
     \par }
\etocsetstyle {part}
              {}
              {\leavevmode\leftskip 1cm\relax}
              {\bfseries\large\llap{\makebox[1cm][r]{\etocnumber\ \ }}%
               \etocname\EndParWithPageNumberInMargin\smallskip}
              {}
\etocsetstyle {section}
              {}
              {\leavevmode\leftskip 1.75cm\relax}
              {\bfseries\normalsize\llap{\makebox[.75cm][l]{\etocnumber}}%
               \etocname\EndParWithPageNumberInMarginAndLeaders}
              {}
\etocsetstyle {subsection}
              {}
              {\leavevmode\leftskip 2.75cm\relax }
              {\mdseries\normalsize\llap{\makebox[1cm][l]{\etocnumber}}%
               \etocname\EndParWithPageNumberInMarginAndLeaders}
              {}
\etocsetstyle {subsubsection}
              {}
              {\leavevmode\leftskip 4cm\relax }
              {\mdseries\normalsize\llap{\makebox[1.25cm][l]{\etocnumber}}%
               \etocname\EndParWithPageNumberInMarginAndLeaders}
              {}
\etocsetstyle {paragraph}
              {}
              {\leavevmode\leftskip 5.5cm\relax }
              {\mdseries\normalsize\llap{\makebox[1.5cm][l]{\etocnumber}}%
               \etocname\EndParWithPageNumberInMarginAndLeaders}
              {}
\etocsettagdepth {preamble}    {part}
\etocsettagdepth {overview}    {part}
\etocsettagdepth {styling}     {part}
\etocsettagdepth {control}     {subsubsection}
\etocsettagdepth {examples}    {part}
\etocsettagdepth {advanced}    {part}
\etocsettagdepth {etocandworld}{part}
\etocsettagdepth {code}        {paragraph}
\renewcommand\etoctoprule {\hrule height 3pt\relax }
\renewcommand\etoctoprulecolorcmd {\color{blue}}
\renewcommand\etocaftercontentshook
   {\medskip\begingroup \color{blue}\hrule height 3pt \endgroup }
\etocruledstyle [1]{\Large\bfseries
                    \fbox{\makebox[8cm]{A TOC using depth tags}}}
\sloppy
\etocobeydepthtags % let's not forget to activate this (default anyhow)
\tableofcontents
\endgroup
