Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[12pt]{article}
- usepackage[cp1250]{inputenc}
- usepackage{lmodern} % for the looks
- usepackage{biolinum} % for the looks
- usepackage[T1]{fontenc}
- usepackage{etoolbox}
- usepackage{titletoc}
- usepackage[colorlinks,linktoc=none]{hyperref}
- newcounter{numSubSection}
- setcounter{numSubSection}{0}
- gpreto{subsection}{%
- refstepcounter{numSubSection}}%
- titlecontents{section}[0pt]%
- {addvspace{6pt}sffamilybfseriesnormalsize%
- makebox[18pt][r]{%
- hyperlink{page.thecontentspage}{textbf{thecontentspage}}%
- hspace{6pt}}}%
- {makebox[30pt][r]{thecontentslabelhspace{12pt}}}%
- {makebox[30pt][r]{null}}%
- {}%
- makeatletter
- newlength{TOCleftSkip}
- setlength{TOCleftSkip}{66pt}%
- newlength{TOCrightSkip}
- setlength{TOCrightSkip}{18pt}%
- newtoggle{ifSub}
- togglefalse{ifSub}%
- newtoggle{ifSection}
- toggletrue{ifSection}%
- newcounter{RefSubSection}%
- setcounter{RefSubSection}{0}%
- renewcommand*theRefSubSection{@arabicc@RefSubSection}%
- renewcommand*{tableofcontents}{%
- section*{contentsname}%
- addcontentsline{toc}{section}{contentsname}%
- toggletrue{ifSection}%
- setcounter{RefSubSection}{0}%
- @starttoc{toc}}%
- gpreto{l@section}{%
- nottoggle{ifSection}
- {par%
- addtolength{leftskip}{-TOCleftSkip}%
- addtolength{rightskip}{-TOCrightSkip}%
- togglefalse{ifSub}}{}%
- toggletrue{ifSection}}%
- renewcommand*{l@subsection}[2]{%
- stepcounter{RefSubSection}%
- toggletrue{ifSub}%
- iftoggle{ifSection}
- {togglefalse{ifSection}%
- addtolength{leftskip}{TOCleftSkip}%
- addtolength{rightskip}{TOCrightSkip}%
- noindent}%
- {unskipbegingroupupshapesmall textbullet~endgroup}%
- begingroup%
- upshapesmall#1 hyperlink{numSubSection.theRefSubSection}{textbf{#2}}%
- endgroup}%
- renewcommand*{l@subsubsection}[2]{%
- iftoggle{ifSection}
- {togglefalse{ifSection}%
- addtolength{leftskip}{TOCleftSkip}%
- addtolength{rightskip}{TOCrightSkip}%
- noindent}%
- {iftoggle{ifSub}
- {togglefalse{ifSub}relax%
- unskipbegingroupupshapesmall: endgroup}%
- {unskipbegingroupitshapesmall, endgroup}}%
- begingroupitshapesmall#1endgroup}%
- renewcommand*{numberline}[1]{}%
- makeatother
- % solution ends here, code below is just for the example
- begin{document}
- % Frontmatter - only unnumbered/unlabeled sections
- pagenumbering{roman}
- clearpage
- tableofcontents
- clearpage
- section*{Preface}
- addcontentsline{toc}{section}{Preface}
- clearpage
- section*{Another Preface}
- addcontentsline{toc}{section}{Another Preface}
- % Mainmatter - only numbered/labeled sections
- clearpage
- addtocontents{toc}{protectvspace{18pt}} % just some separation
- pagenumbering{arabic}
- %clearpage
- section{First}
- subsection{Australia}
- subsubsection{Alpha}
- subsubsection{Beta}
- subsubsection{Charlie}
- subsubsection{Delta}
- subsubsection{Echo}
- subsubsection{Foxtrot}
- subsection{Brazil}
- subsubsection{Golf}
- subsubsection{Hotel}
- subsubsection{India}
- subsection{Canada}
- clearpage
- section{Second}
- clearpage
- section{Third}
- subsection{Denmark}
- subsubsection{Juliet}
- subsubsection{Kilo}
- subsubsection{Lima}
- subsubsection{Mike}
- subsubsection{November}
- subsection{Egypt}
- subsubsection{Oscar}
- subsubsection{Papa}
- subsubsection{Quebec}
- subsubsection{Romeo}
- clearpage
- section{Fourth}
- subsection{Georgia}
- subsubsection{Sierra}
- subsection{Haiti}
- subsubsection{Tango}
- subsubsection{Uniform}
- subsubsection{Victor}
- subsubsection{Whiskey}
- subsection{Iceland}
- subsection{Japan}
- subsubsection{X-ray}
- subsubsection{Yankee}
- subsubsection{Zulu}
- subsubsection{Alpha}
- subsubsection{Beta}
- subsubsection{Charlie}
- subsubsection{Delta}
- subsubsection{Echo}
- subsection{Kenya}
- subsubsection{Foxtrot}
- subsection{Laos}
- subsubsection{Golf}
- subsubsection{Hotel}
- subsubsection{India}
- subsubsection{Juliet}
- subsubsection{Kilo}
- end{document}
Add Comment
Please, Sign In to add comment