Where is my table of contents? I looked at Table of contents using article and report classes and here's my MWE. According to the commentators, everything down three levels should appear--but the ToC file (yes, I ran LaTeX twice) is a zero byte file, hence no ToC is being generated.

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{ulem}
\usepackage{amsmath}
%\usepackage{tocloft}  didn't do anything.
\usepackage{fancyhdr}
\pagestyle{fancy}
\lfoot{}
\cfoot{}
\rfoot{\footnotesize{less-important info}}
\title{boring article}
\author{troubled author}
\date{}
%\setcounter{tocdepth}{3} this is the default. I've tried other values.
\usepackage{mathpazo} nice fonts.
\begin{document}
\maketitle
\tableofcontents
\begin{center}\textbf{Part $[$1$]$: General Provisions}\end{center}
\section*{Article $[$1$]$ Definitions}
Blah blah blah
\section*{Article $[$2$]$ More Definitions}
Blah blah
\end{document}


What am I missing? Is the fancyheader package interfering?

• You are trying hard to avoid to get a table of contents by using the starred version of \section. Remove the *. If you want unnumbered sections change the secnumdepth counter. – Ulrike Fischer Mar 7 '16 at 11:53
• @UlrikeFischer If I change \section* to \section then I do get a ToC. But I have to suppress the automatically-generated section numbers. So I changed \section back to \section* and the automatically generated numbers disappeared. Then I added \setcounter{tocdepth}{3} both before and after \begin{document}. In both cases, no ToC was generated. – user26732 Mar 7 '16 at 12:04
• If i may quote Ulrike: If you want unnumbered sections change the secnumdepth counter. \setcounter{secnumdepth}{-1} – Johannes_B Mar 7 '16 at 12:08
• How can I mark these as answers? – user26732 Mar 7 '16 at 12:17
• I converted the comment to an answer. – Ulrike Fischer Mar 7 '16 at 12:35

To summarize the tips in the comments:

\documentclass[12pt,a4paper]{article}
\begin{document}

\tableofcontents

\section*{I'm not in the toc}
Blah blah blah
\section{I'm in the toc and I'm numbered}
Blah blah blah

\setcounter{secnumdepth}{-1}
\section{I'm in the toc and I'm not numbered}

Blah blah blah
\end{document}