| 1 |
%% LaTeX2e file `etocsnippet-07.tex' |
| 2 |
%% generated by the `filecontentshere' environment |
| 3 |
%% from source `etoc' on 2026/05/05. |
| 4 |
%% |
| 5 |
\makeatletter |
| 6 |
\newcommand{\MyLocalTOC}[1][section]{% |
| 7 |
\begingroup |
| 8 |
\etocsetlinestyle{chapter}{}{} |
| 9 |
{\l@chapter{\numberline{\etocnumber}\etocname}{\etocpage}}{}% |
| 10 |
\etocsetlinestyle{section}{}{} |
| 11 |
{\l@section{\numberline{\etocnumber}\etocname}{\etocpage}}{}% |
| 12 |
\etocsetlinestyle{subsection}{}{} |
| 13 |
{\l@subsection{\numberline{\etocnumber}\etocname}{\etocpage}}{}% |
| 14 |
\etocsetlinestyle{subsubsection}{}{} |
| 15 |
{\l@subsubsection{\numberline{\etocnumber}\etocname}{\etocpage}}{}% |
| 16 |
% etc... if further sectioning units are needed |
| 17 |
% (i.e. not excluded by tocdepth and actually there in document) |
| 18 |
% Here #1 defaults to section, meaning this is appropriate |
| 19 |
% for local TOC in a chapter |
| 20 |
\etocsettocstyle{\@nameuse{#1}*{Local contents}} |
| 21 |
{}% |
| 22 |
% |
| 23 |
\localtableofcontents |
| 24 |
\endgroup} |
| 25 |
\makeatother |