Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am compiling a LaTeX file with 10 chapters and a table of contents. I have added the following in the first page.

But why is the table of contents still missing?

\pdfbookmark[1]{TABLE OF CONTENTS}{table}

\tableofcontents

\addtocontents{toc}{\def\protect\@chapapp{}} \cleardoublepage \phantomsection

\addcontentsline{toc}{chapter}{LIST OF TABLES}

\listoftables

\cleardoublepage \phantomsection \addcontentsline{toc}{chapter}{LIST OF FIGURES}

\listoffigures

% Comment out the next line if NOT using chaptertitle

\addtocontents{toc}{\def\protect\@chapapp{CHAPTER\ }}

This is the output of .toc file: All section titles are there.

\def \@chapapp {}

\contentsline {chapter}{LIST OF TABLES}{iv}{section*.3}

\contentsline {chapter}{LIST OF FIGURES}{v}{section*.5}

\def \@chapapp {CHAPTER\ }

\def \@chapapp {}

\contentsline {chapter}{ACKNOWLEDGEMENTS}{vi}{section*.7}

\def \@chapapp {CHAPTER\ }

\def \@chapapp {}

\contentsline {chapter}{ABSTRACT}{vii}{section*.8}

\def \@chapapp {CHAPTER\ }

\contentsline {chapter}{\numberline {1.}Introduction }{1}{chapter.9}

\contentsline {section}{\numberline {1.1}Network flow problems}{1}{section.10}

\contentsline {section}{\numberline {1.2}Classical Linear network flow problems (LNF)}{1}
{section.11}

\contentsline {section}{\numberline {1.3}{A LNF problem formulation } }{2}{section.12}

\contentsline {section}{\numberline {1.4}Capacity expansion multi-commodity network flow 
(CEMNF) Problems formulation}{3}{section.15}

\contentsline {section}{\numberline {1.5}Linear programming optimization method}{7}{section.19}

\contentsline {section}{\numberline {1.6}High performance computing for linear programming models}{7}{section.20}

.................

This is the output of .aux

\relax 
\bibstyle{apa}
\ifx\hyper@anchor\@undefined
\global \let \oldcontentsline\contentsline
\gdef \contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global \let \oldnewlabel\newlabel
\gdef \newlabel#1#2{\newlabelxx{#1}#2}
\gdef \newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\let \contentsline\oldcontentsline
\let \newlabel\oldnewlabel}
\else
\global \let \hyper@last\relax 
\fi

\@input{Preface/titlepage.aux}
\@input{Preface/dedication.aux}
\@writefile{toc}{\def \@chapapp{}}
\@writefile{toc}{\contentsline {chapter}{LIST OF TABLES}{iv}{section*.3}}
\@writefile{toc}{\contentsline {chapter}{LIST OF FIGURES}{v}{section*.5}}
\@writefile{toc}{\def \@chapapp{CHAPTER\ }}
\@input{Preface/acknowl.aux}
\@input{Preface/abstract.aux}
\@input{Body/chapter1.aux}
\@input{Body/chapter2.aux}
\@input{Body/chapter3.aux}
\@input{Body/chapter4.aux}
\@input{Body/chapter5.aux}
\@input{Body/chapter6.aux}
\@input{Body/chapter7.aux}
\@input{Body/chapter8.aux}
\@input{Body/chapter9.aux}
\@input{Body/chapter10.aux}
\@input{Appendix/appendix1.aux}
\@input{Reference/bibtex.aux}
\@input{Images.aux}
\global\NAT@numberstrue

Is there something wrong?

share|improve this question
8  
Without a complete example nobody will be able to test your code. Beside this: Check the log-file for errors. Also reconsider your code. A lot of \addcontentsline commands indicates a broken design (e.g. wrong choice or use of class). – Ulrike Fischer Feb 2 '12 at 19:12
5  
@N.N. I'm not sure I agree about editing out Any help is appreciated., particularly not if it's the only thing you're editing. It's somewhat different from a thanks, and it keeps the Why? from appearing somewhat demandingly rude. Let's just not overdo the removing of politeness phrases. – doncherry Feb 2 '12 at 19:41
1  
@user11401: do you see your section titles appear in the .aux file and .toc file? (I should guess they don't make it to the .toc file, since that is what gets included to form the table of contents.) – Ulrich Schwarz Feb 2 '12 at 20:20
10  
It's quite useless to edit the question in order to add again a "thanks" that others tell you is not usual in this site, instead of adding the requested information, without which it's impossible to help you. – egreg Feb 2 '12 at 21:57
2  
You should post a Complete Minimal Working Example as has already been suggested by Ulrike, and please post the contents of your .toc and .aux files as well. – tohecz Feb 3 '12 at 10:10
show 8 more comments

closed as too localized by Joseph Wright Mar 3 '12 at 22:36

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.