Sections and the Table of Contents
Organize the body with \section, \subsection, and related commands, and generate a table of contents with \tableofcontents. The document class manages headings, numbering, and entries, so moving content does not require manual renumbering.
EasyLaTeX compiler setting: pdfLaTeX. The article class supports \section through \subsubsection; use report or book when you need \chapter. Updating the table of contents uses repeat passes managed by the platform.
Building a Heading Hierarchy
Nest heading commands in order. The document class determines numbering and indentation in the contents:
\section{Method}
\subsection{Data Sources}
\subsubsection{Sample Selection}
In report or book, you can use this level above \section:
\chapter{Research Background}
Do not skip levels, such as going directly from \section to \subsubsection, because this makes the contents harder to follow.
Generating the Table of Contents
Place \tableofcontents where the contents should appear in the body:
\begin{document}
\maketitle
\tableofcontents
\section{Introduction}
...
\end{document}
Contents are generated from headings. After changes, compile in EasyLaTeX and wait for the entire job; the platform handles the required repeat passes. If page numbers are still incorrect, check the selected main file, that headings are inside the document body, and any compilation errors.
Unnumbered Headings in the Contents
Starred headings are unnumbered and are not added automatically:
\section*{Acknowledgments}
\addcontentsline{toc}{section}{Acknowledgments}
toc identifies the contents file, and section sets the entry's level. For an unnumbered chapter in book, change the second argument to chapter.
Abstracts and Appendices
Use the abstract environment supplied by the document class where available. \appendix switches subsequent headings to lettered numbering:
\begin{abstract}
Write the abstract here.
\end{abstract}
\appendix
\section{Questionnaire}
Appendix headings still appear in the contents. Do not manually include “Appendix A” in a heading, or the numbering will be duplicated.
Controlling Contents Depth
The tocdepth counter sets the lowest heading level to display:
\setcounter{tocdepth}{2}
Common values are 1 for sections and 2 for subsections. If the contents is too long, reduce its depth before shrinking the font to fit every entry.
Common Problems
Empty Contents or Outdated Page Numbers
Contents are generated from headings. After changes, compile in EasyLaTeX and wait for the entire job; the platform handles the required repeat passes. If page numbers are still incorrect, check the selected main file, that headings are inside the document body, and any compilation errors.
Headings Are Too Long
Provide a shorter contents entry in square brackets:
\section[Experimental Setup]{Parameter Settings and Calibration under Complex Experimental Conditions}
Undefined Chapter Command
article does not have \chapter. Choose report or book when appropriate rather than manually imitating chapter headings.
Complete Example
\documentclass[a4paper,12pt]{article}
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
\setcounter{tocdepth}{2}
\title{Sections and Contents Example}
\author{Author}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}
A minimal example with a table of contents, unnumbered acknowledgments, and an appendix.
\end{abstract}
\tableofcontents
\section{Introduction}
Introduce the research question.
\subsection{Contributions}
List the contributions.
\section*{Acknowledgments}
\addcontentsline{toc}{section}{Acknowledgments}
\appendix
\section{Supplementary Material}
Appendix content.
\end{document}