Files
2025-09-23 09:40:14 +02:00

21 lines
474 B
TeX

\makeatletter
\preto{\chapter}{\def\leveltitle{\chaptertitle}}
\pretocmd{\@chapter}{\expandafter\gdef\leveltitle{#2}}{}{}
% TODO: set this to only include sections in chaptertoc
%\etocsetnexttocdepth{section}
\newcommand{\chaptertoc}{
\etocsettocstyle{
\setlength{\parskip}{0pt}
\setlength{\itemsep}{0pt}
\rule{\textwidth}{0.4pt}\\
\textbf{\sffamily \chaptertitle}\hfill\raggedright
}
{\rule{\textwidth}{0.4pt}}
\localtableofcontents
\bigskip
}
\makeatother