[Tex/LaTex] \tableofcontents does not list the unnumbered chapter

table of contents

My question is just like the title. Here is a MWE for my case :

\usepackage[paperwidth=16cm,paperheight=24cm]{geometry}
\usepackage{amsmath,amsxtra,amssymb,latexsym,amscd,amsfonts,enumerate,ifthen,stmaryrd,amsthm,amstext}
\usepackage[mathscr]{eucal}
\usepackage[pdftex]{graphicx}
\usepackage{xspace}
\usepackage{multicol,color}
\usepackage{mathrsfs}
\usepackage{makeidx}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{vietnam} 
\usepackage{eso-pic}
\usepackage{perpage} 
\MakePerPage{footnote}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt} 
\makeindex
\begin{document}
\pagenumbering{roman}
\pagestyle{fancy}
\tableofcontents 
\chapter*{Foreword}
 Blah blah blah
 \chapter*{Preface}
 \pagenumbering{arabic}  
  Blah Blah
  Mirella gọi là papa, dạy toán ở nhà cho Mirella. 
 \thispagestyle{plain}
 \chapter{Dido's problem}
 \label{chapter:Dido}
 \index{Dido (công chúa)} \index{bài toán công chúa Dido}
   Blah blah blah
  \end{document}

Why the unnumered chapter does not appear in the table of content ? Please help me. Thanks.

Best Answer

Starred sectional units don't produce entries in the ToC. You can add them using

\addcontentsline{toc}{<unit>}{<text>}

(and \phantomsection if hyperref is used). A complete example:

\documentclass{book}

\begin{document}

\tableofcontents 
\chapter*{Foreword}
\addcontentsline{toc}{chapter}{Foreword}
Blah blah blah
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
Blah Blah
Mirella gọi là papa, dạy toán ở nhà cho Mirella. 
\chapter{Dido's problem}
\end{document}

enter image description here

If you are using the book document class, it's better to use \frontmatter and \chapter for the initial introductory units, and then \mainmatter for the main body of the document:

\documentclass{book}

\begin{document}

\frontmatter
\tableofcontents 
\chapter{Foreword}
Blah blah blah
\chapter{Preface}
Blah Blah
Mirella gọi là papa, dạy toán ở nhà cho Mirella. 
\mainmatter
\chapter{Dido's problem}
\end{document}
Related Question