GeneralHow to modify default formatting for table of contents

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
intiha
Posts: 5
Joined: Wed May 27, 2009 8:46 am

How to modify default formatting for table of contents

Post by intiha »

Dear all,
I am nearing my deadline for submission of thesis. i have a style file used by a previous person, but the requirements have apparently changes. I have been able to make most changes required, by two changes - pertaining to TOC/LOF/LOT - I am not expert enough to make right now.

Essentially I am using a report documentclass, and have the following existing structure made when \listoftables etc. are called (since my last post in the tex format section I have spent some time and modified this) so here is the new format:

Code: Select all


\renewcommand{\tableofcontents}{%
  \begin{singlespace}
  \@ifnextchar [%
    {\@starspeciallist{toc}}%
    {\@starspeciallist{toc}[Table of Contents]}
  \end{singlespace}}

\renewcommand{\listoftables}{%
  \@ifstar
    {\@ifnextchar [%
       {\@starspeciallist{lot}}%
       {\@starspeciallist{lot}[List Of Tables]}}%
    {\@ifnextchar [%
       {\@speciallist{lot}}%
       {\@speciallist{lot}[List Of Tables]}}}

\renewcommand{\listoffigures}{%
  \@ifstar
    {\@ifnextchar [%
       {\@starspeciallist{lof}}%
       {\@starspeciallist{lof}[List Of Figures]}}%
    {\@ifnextchar [%
       {\@speciallist{lof}}%
       {\@speciallist{lof}[List Of Figures]}}}


% redefine commands used to generate entries in lof and lot, in order to make
% them singlespace within each entry (leaving doublespace between entries)
\renewcommand*\l@figure[2]{
 
 \@dottedtocline{1}{1.5em}{2.3em}{#1}{#2}
 
}
\let\l@table\l@figure

\def\@starspeciallist#1[#2]{%
  \newpage
  \@restonecolfalse
  \if@twocolumn
    \@restonecoltrue
    \onecolumn
  \fi
  \chapter*{#2}%
  \@starttoc{#1}%
  \if@restonecol\twocolumn\fi}

\def\@speciallist#1[#2]{%
  \newpage
  \@restonecolfalse
  \if@twocolumn
    \@restonecoltrue
    \onecolumn
  \fi
  \chapter*{#2}%
  \addcontentsline{toc}{chapter}{#2}
  \@starttoc{#1}%
  \if@restonecol\twocolumn\fi}
Now I have to modify this so that the appearance changes as per the following requirements:

1. List of Tables/Figures: Single space each list entry; double space between list entries. Do not use extra spacing between chapters.
2. Table of Contents: Major sections must be called "chapters" (excluding appendices and bibliography but including introduction and conclusion) and include a number. For example, "Chapter 2: Methods." Adjust in Table of Contents and in main body (if necessary) so that TOC entry matches the chapter title page heading.
3. Bold just the chapter number and title, not the page number in the table of content

Can the people in this community kindly guide me in the correct direction to perform the formatting. Please help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to modify default formatting for table of contents

Post by localghost »

Take a look at one of the packages titletoc or tocloft.


Best regards
Thorsten
Post Reply