\documentclass{article}
% Required packages
\usepackage{lipsum} % For generating dummy text
\usepackage{titletoc} % For customizing TOC
\usepackage{etoc} % For advanced control over TOC
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=black
}
% Change depth of sections
\setcounter{tocdepth}{3} % Include subsubsections
% Customize formatting
\titlecontents{section}[0pt]{\bfseries}{\thecontentslabel\quad}{}{\hfill\bfseries\contentspage}
\begin{document}
% Change TOC title
\renewcommand{\contentsname}{My Table of Contents with dots}
\tableofcontents
% Change dots to spaces in TOC
\makeatletter
\renewcommand{\@dotsep}{10000} % Set dot separation to a large negative value
\makeatother
\renewcommand{\contentsname}{My Table of Contents with spaces}
\tableofcontents
\hypersetup{
linkcolor=red
}
\renewcommand{\contentsname}{Change toc colors with hyperref}
\tableofcontents
\clearpage
\section{Section 1}
\lipsum[1]
\subsection{Subsection 1.1}
\lipsum[2]
\subsubsection{Subsubsection 1.1.1}
\lipsum[3]
\subsubsection{Subsubsection 1.1.2}
\lipsum[4]
\subsection{Subsection 1.2}
\lipsum[5]
\section{Section 2}
\lipsum[6]
\subsection{Subsection 2.1}
\lipsum[7]
\subsubsection{Subsubsection 2.1.1}
\lipsum[8]
\subsubsection{Subsubsection 2.1.2}
\lipsum[9]
\subsection{Subsection 2.2}
\lipsum[10]
\end{document}
Leave a comment if you like this content أترك تعليقا إن أعجبك المحتوى
Most viewed courses:
سلسلة تمارين علوم رياضية
Subject: Maths
Class: 2 Bac Science Maths
Views: 44.48K
الحساب المثلثي 1
Subject: Maths
Class: Tronc Commun Sciences
Views: 19.40K
- Série exercices: Calcul Trigonométrique
- Devoir Surveillé 1 Calcul Trigonométrique
- Devoir à la maison 1 Calcul Trigonométrique
- Devoir 2 S02 de généralités des fonctions et trigonométrie
- Devoir Surveillé 1 S02 Calcul Trigonométrique A - B
- Devoir Surveillé 1 S02 Calcul Trigonométrique C - D
- Devoir Surveillé 1 S02 Calcul Trigonométrique E - F
الجداء السلمي وتطبيقاته
Subject: Maths
Class: 1 BAC Science
Views: 16.82K
عموميات حول الدوال العددية
Subject: Maths
Class: Tronc Commun Sciences
Views: 16.71K
دراسة وتمثيل الدوال الاعتيادية
Subject: Maths
Class: Tronc Commun Sciences
Views: 16.44K
- Maths
- 1APIC
- 3APIC
- Tronc Commun Sciences
- Tronc Commun Lettres
- 1 BAC Science
- 1 BAC Science Maths
- 1 Bac Lettre
- 2 Bac Science
- 2 Bac Science Maths
- Discussions
- Physics
- 1 BAC Science
- SVT
- 3 Année Collège
- Tronc Commun Sciences
- 1 BAC Science
- 1 BAC Science Maths
- 1 Bac Lettre
- 2 Bac Science
- Latex
- Templates
- Figures
Most Recent Articles
Most Viewed Articles
0 Comments, Latest
No comments yet. Be the first to Comment