Page LayoutTable Of Contents Problem

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
shahacellisaya
Posts: 3
Joined: Thu Mar 31, 2011 1:56 pm

Table Of Contents Problem

Post by shahacellisaya »

Hi Guys!
I do have a problem with my BachelorsThesis.
My Professor wants the TOC also mentioned in the TOC...

Contents

Abstract1.........i
Abstract2.........ii
Contents..........iii
Introduction.....1
and so on

I did it that way:

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% ABSTRACTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter*{Abstract1}
\addcontentsline{toc}{chapter}{Abstract1}
\pagenumbering{roman}
\setcounter{page}{1}
foo
\chapter*{Abstract2}
\addcontentsline{toc}{chapter}{Abstract2}
foo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% CONTENTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{plain}
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% MAIN
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\newpage
\pagestyle{empty}
\null\newpage
%%%%%%%%%%%%%
%%% Introduction
%%%%%%%%%%%%%
\chapter{Introduction} 
\pagenumbering{arabic}
\setcounter{page}{1}
and so on


my Problem is that the TOC is over 2 Pages.
So in the end my TOC looks like this:
Abstract1.........i
Abstract2.........ii
Contents..........iv (<- that should be iii)
Introduction.....1

if I insert
\setcounter{page}{3}
every page of the TOC is labelled iii

What can I do?
Thanks for your help
Last edited by shahacellisaya on Mon Apr 04, 2011 12:33 pm, edited 1 time in total.

Recommended reading 2024:

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

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: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Table Of Contents Problem

Post by Stefan Kottwitz »

You could use

Code: Select all

\addtocontents{toc}{\protect\addcontentsline{toc}{chapter}{\contentsname}}
Btw. I don't like "Contents" listed in the TOC. The TOC is for look-up, that's why it lists sections with page numbers. Who would like to know, on which page the TOC is, looking into the TOC for it? Where "Contents" is listed with the same page number of the current page? It's like misusing a TOC for a list what's been done. Also, there's a big heading "Contents" on the page. Now it's followed by a smaller "Contents" meaning the same page. I don't think it's nice. Perhaps it's good to nicely speak with the professor if this style is useful. You can show that you're able to do it but question why it should be meaningful.

Stefan
LaTeX.org admin
shahacellisaya
Posts: 3
Joined: Thu Mar 31, 2011 1:56 pm

Table Of Contents Problem

Post by shahacellisaya »

Stefan_K wrote:You could use

Code: Select all

\addtocontents{toc}{\protect\addcontentsline{toc}{chapter}{\contentsname}}
nope, that doesn't solve my problem... now there is no Contents in my TOC but a "v".

Abstract1.........i
Abstract2.........ii
v
Introduction.....1

Stefan_K wrote: Btw. I don't like "Contents" listed in the TOC.
I do also don't like his idea... but he doesn't want to talk about it - he want it his way...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Table Of Contents Problem

Post by Stefan Kottwitz »

Perhaps \contentsname is undefined in your class. You did not say which class you are using. It's defined in base classes.

Code: Select all

\documentclass{report}
\begin{document}
\addtocontents{toc}{\protect\addcontentsline{toc}{chapter}{\contentsname}}
\tableofcontents
\end{document}
So, you could just write

Code: Select all

\addtocontents{toc}{\protect\addcontentsline{toc}{chapter}{Contents}}
Or define \contentsname yourself.

Stefan
LaTeX.org admin
shahacellisaya
Posts: 3
Joined: Thu Mar 31, 2011 1:56 pm

Re: Table Of Contents Problem

Post by shahacellisaya »

Thanks a lot!
THAT solve my problem!

btw. yes it is a report!
Post Reply