GeneralTable of Contents problem

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
leeau
Posts: 2
Joined: Wed Jul 23, 2008 12:21 am

Table of Contents problem

Post by leeau »

Hi all,

I am a new LaTeX user - I use MikTeX and TeXnicCenter.

I used \tableofcontents command, and got the table of contents page with 'Contents' heading, but none of the sections are showing. The sections themselves were \sections and have been automatically numbered and all.

The same thing goes for \listoffigures. A blank page with only 'List of Figures' title appears.

What could have I done wrong? Please help!!!

SL

Recommended reading 2024:

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

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

lilbill
Posts: 12
Joined: Wed Jul 23, 2008 12:38 am

Re: Table of Contents problem

Post by lilbill »

I always use \addcontentsline{toc}{heading name(like section chapter etc.)}{title of section...}
you can also define a new command like

\newcommand{\chap}[1]{\chapter*{#1}\addcontentsline{toc}{chapter}{#1}}

so that you can then add a chapter called Preliminaries by
\chap{Preliminaries}

That always forces it to work...also try to run latex twice to get the TOC references correct. Happens if you are using the \section*{} unnumbered version.

good luck!
leeau
Posts: 2
Joined: Wed Jul 23, 2008 12:21 am

Table of Contents problem

Post by leeau »

lilbill wrote:I always use \addcontentsline{toc}{heading name(like section chapter etc.)}{title of section...}
you can also define a new command like

\newcommand{\chap}[1]{\chapter*{#1}\addcontentsline{toc}{chapter}{#1}}

so that you can then add a chapter called Preliminaries by
\chap{Preliminaries}

That always forces it to work...also try to run latex twice to get the TOC references correct

good luck!
Thanks for your reply, but unfortunately it didn't work :( Still blank under 'Contents'
\tableofcontents or \addcontentsline or \listoffigures are supposed to work but they don't in my document.... :( :( :(
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Table of Contents problem

Post by Stefan Kottwitz »

Hi leeau,

did you change the tocdepth counter? It determines what entries will be shown in the toc.
Do you have a line like

Code: Select all

\setcounter{tocdepth}{0}
inside your code? Or could you post your document preamble here for examination?

Stefan
LaTeX.org admin
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Table of Contents problem

Post by gmedina »

Hi leeau,

If Stefan_K's suggestion does not work, then please post a minimal working example showing the undesired behaviour. Having relevant information about your code helps us to provide effective help.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
bas
Posts: 1
Joined: Sun Aug 03, 2008 12:54 am

Table of Contents problem

Post by bas »

Check puntuation ( e.g. " _ [ etc are not allowed and though they impact funnily enough the toc generating process).
Good luck.
Post Reply