0

How can I change the style of the \tableofcontents shown below: enter image description here

I want the styling to be similar to below example:

enter image description here

Below parts of the code in my main.tex:

\documentclass[11pt, a4paper]{article}
\usepackage[nochapters]{classicthesis}                              % template
\usepackage[margin=42mm]{geometry}                                  % margins
\usepackage[utf8]{inputenc}                                         % allow utf-8 input
\usepackage[T1]{fontenc}                                            % use 8-bit T1 fonts
\usepackage{graphicx}                                               % images
\usepackage{url}                                                    % URL typesetting
\usepackage{booktabs}                                               % good-looking tables
\usepackage{multirow}                                               % for tables
\usepackage{amsfonts}                                               % blackboard math symbols
\usepackage{amsmath}                                                % math ops
\usepackage{nicefrac}                                               % compact 1/2, etc.
\usepackage{microtype}                                              % microtypography

\definecolor{darkblue}{rgb}{0, 0, 0.5}                              % define link color
\hypersetup{colorlinks=true,citecolor=darkblue,                     % set link color
            linkcolor=darkblue, urlcolor=darkblue}

            
%%% Custom Commands %%%

% Centering image
\makeatletter
\newcommand*{\centerfloat}{%
  \parindent \z@
  \leftskip \z@ \@plus 1fil \@minus \textwidth
  \rightskip\leftskip
  \parfillskip \z@skip}
\makeatother

% Your packages here
\usepackage{graphicx}
\usepackage{tabulary}
\usepackage{array}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\usepackage[toc,page]{appendix}
\usepackage{float}

\usepackage[style=apa, natbib=true, backend=biber]{biblatex}

% this bit is required in any case 
%(change name if you use a different bib file)
\addbibresource{references.bib}

% !!! ------------------------------------------------------ !!!

\begin{document}
\input{frontmatter.tex}  % don't remove this :)

\tableofcontents

\newpage

Thanks in advance.

1
  • 1
    Welcome to TeX.SE! Why do you want to change the style of the table of contents? It is defined in package classicthesis...
    – Mensch
    Nov 27, 2023 at 22:14

1 Answer 1

1

It's a precise stylistic choice of classicthesis that the page numbers in the table of contents are not aligned and no leaders are provided.

To (approximately) quote Bringhurst, you don't want to add the page numbers, do you?

Anyway, if you want alignment and leaders, use

\usepackage[nochapters,dottedtoc]{classicthesis}

and add

\renewcommand{\cftsecdotsep}{4.5}
\renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}

at the end of the document preamble. You'll get something like

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .