General ⇒ Help formatting TOC
Help formatting TOC
1. Introduction
1.1 Motivation
1.2 Method
2. Background
3. Stuff
3.1 Stuff 1
3.2 Stuff 2
(The sections should be indented to the first letter in the chapter's name. That part is working but I couldn't format it in the e-mail). My current TOC looks like this:
1. Introduction
1.1 Motivation
1.2 Method
2. Background
3. Stuff
3.1 Stuff 1
3.2 Stuff 2
I need to put a blank line between the chapter and first section in each chapter. This is what I'm using on my main tex file:
\documentclass[12pt]{report}
\usepackage{amsmath,amsthm,amsfonts,amscd} % Some packages to write mathematics.
\usepackage{eucal} % Euler fonts
\usepackage{verbatim} % Allows quoting source with commands.
\usepackage{setspace}
\usepackage[usenames]{color}
\usepackage{colortbl}
\usepackage{hhline}
\usepackage{longtable}
\usepackage{graphicx}
\usepackage[square]{natbib}
Thanks for looking and any help you may provide,
Ariel
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Help formatting TOC
One simple way is to insert after a \chapter call and before the next \section one line:
Code: Select all
\addtocontents{toc}{\protect\addvspace{10pt}}
If you dont whant to repeat that inside each chapter, you could redefine the \@chapter macro.
Stefan
Re: Help formatting TOC
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Help formatting TOC
You could use \renewcommand\@chapter inside your preamble to modify this: copy the original code of \@chapter into it and insert \addtocontents{toc}{\protect\addvspace{10pt}} just after the original \addcontentsline{toc}{chapter}{#1}. And \makeatletter ... \makeatother around this redefinition is necessary because of the @-symbol inside the command names.
Stefan