diff --git a/classes/custom_classes/news.cls b/classes/custom_classes/news.cls index 7f3cd25..e9f2184 100644 --- a/classes/custom_classes/news.cls +++ b/classes/custom_classes/news.cls @@ -72,3 +72,42 @@ }{ \end{multicols} } + +% CONTENTS: -------------------------------------------------------------------- +\newrobustcmd{\tocdepth}[1]{% + \IfStrEq{#1}{h}{\setcounter{tocdepth}{1}} + {\IfStrEq{#1}{hh}{\setcounter{tocdepth}{2}} + {\IfStrEq{#1}{hhh}{\setcounter{tocdepth}{3}}}% + {\IfStrEq{#1}{hhhh}{\setcounter{tocdepth}{4}}{\setcounter{tocdepth}{2}}}}% +} + +\renewcommand{\usecompacttoc}{ + \titlecontents{section}[0em]{}{% + \small\bfseries\thecontentslabel.\hspace*{0.5em}}{\bfseries}{% + \titlerule*[0.5pc]{.}\contentspage% + } + \titlecontents{subsection}[0em]{% + \small\hspace*{0.8em}}{\thecontentslabel.\hspace*{0.5em}}{}{% + \titlerule*[0.5pc]{.}\contentspage% + } + \titlecontents{subsubsection}[0em]{% + \small\hspace*{1.6em}}{\thecontentslabel.\hspace*{0.5em}}{}{% + \titlerule*[0.5pc]{.}\contentspage% + } + \titlecontents{paragraph}[0em]{% + \small\hspace*{2.4em}}{\thecontentslabel.\hspace*{0.5em}}{}{% + \titlerule*[0.5pc]{.}\contentspage% + } +} + +\@ifundefined{chapter}{}{ + \makeatletter% + \renewcommand\tableofcontents{% + \usecompacttoc + \section*{\contentsname}% + \@starttoc{toc}% + \protect\thispagestyle{front}% + } + \makeatother% +} + diff --git a/classes/custom_classes/news_example.pdf b/classes/custom_classes/news_example.pdf index 20bb934..c7c2d85 100644 Binary files a/classes/custom_classes/news_example.pdf and b/classes/custom_classes/news_example.pdf differ diff --git a/classes/custom_classes/news_example.tex b/classes/custom_classes/news_example.tex index fc08f0f..52b7dad 100644 --- a/classes/custom_classes/news_example.tex +++ b/classes/custom_classes/news_example.tex @@ -17,6 +17,12 @@ \begin{document} + % Include a table of contents. Adjust the depth of the headings included in the table of contents + % with the \tocdepth{