TransWikia.com

How can I achieve this TOC layout?

TeX - LaTeX Asked by Utkarsh Verma on August 19, 2020

I’m working on a software for which I need to write up a LaTeX template. I’ve been able to glue together the rest of the template somehow since I’m a beginner. But I’m facing huge difficulty in getting the Table of Contents right. I personally like the layout of the TOC used in G.F. Simmon‘s book on Differential Equations and was hoping that I could implement it in my template.

The TOC Layout

I don’t care about the image before the title. Also, the dark background is actually the job of my reader, Okular, so I need the background to be white as usual.

Thanks in advance.

I know this might sound lazy of me to just ask up how to achieve this, but I’ve actually invested a couple of days on this. I came to know about packages, tocloft etc, tried reading the documentation too, but it’s just taking too much time and I can’t force myself to be spending any more time on this. My current state is that I can’t go out exploring the docs and stuff, but will be able to understand and implement the layout if I have a starting point at least.

One Answer

Is this close to what you want?

enter image description here

documentclass{book}
usepackage{titlesec}
usepackage{titletoc}
%
renewcommand{contentsname}{raggedleft sffamily MakeUppercase{Table of Contents}}
%
%
titlecontents{chapter}[-7em]{sffamily bfseries addvspace{5ex}}%
{MakeUppercase chaptername{} {huge thecontentslabel} quad Large MakeUppercase}%
{}%
{hfill Large contentspage}%
[addvspace{1ex}]%
%
%
titlecontents{section}[1em]{}%
{thecontentslabel quad}%
{}%
{hfill contentspage}%
%
%
titlecontents{subsection}[3.2em]{}%
{thecontentslabel quad}%
{}%
{hfill contentspage}%
%
%
usepackage{blindtext}
%
begin{document}
tableofcontents
%
blinddocument
blinddocument
blinddocument
end{document}

Correct answer by hesham on August 19, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP