Choose between article, report, and book, use the sectioning commands, generate a table of contents, add appendices, and split front matter from main matter.

Document Structure: Sections, Chapters, and the Table of Contents

LaTeX handles numbering, spacing, and the table of contents for you as long as you mark up the structure with the right commands. This page covers the standard document classes, the sectioning commands, and the commands that divide a long document into parts.

Choosing a Document Class

ClassUse it forTop-level unit
articlePapers, short reports, assignments\section
reportLonger reports, theses without parts\chapter
bookBooks and theses with front and back matter\part, \chapter
beamerSlides\begin{frame}

Conference and journal templates in Coauthor supply their own class or style file (acmart, IEEEtran, neurips_2026.sty, ...). Do not change the \documentclass line of a template; the venue expects it. See Writing for a Venue with Conference and Journal Templates.

Common options: \documentclass[11pt,a4paper,twocolumn]{article}, \documentclass[12pt,oneside,openany]{book}.

Sectioning Commands

From largest to smallest:

\part{Foundations}            % book, report
\chapter{Background}          % book, report
\section{Related Work}
\subsection{Neural Approaches}
\subsubsection{Attention}
\paragraph{Scope.} Runs into the text.
\subparagraph{Detail.}
  • article has no \chapter; using it there produces the error Undefined control sequence.
  • Add * to suppress numbering and keep the heading out of the table of contents: \section*{Acknowledgments}.
  • A short title for the table of contents and running headers goes in the optional argument: \section[Short]{A Much Longer Heading for the Page}.
  • Type \sec in the editor and pick \section from the autocomplete popup to get \section{} with the cursor inside.

Table of Contents, Figures, and Tables

\begin{document}
\maketitle
\tableofcontents
\listoffigures
\listoftables
\newpage

The lists are built from the .toc, .lof, and .lot files written by the previous compile, so a newly added heading appears in the table of contents only after the compiler runs twice. Coauthor's latexmk-based compile repeats passes automatically, so a single Compile is normally enough; if you still see stale entries, compile once more.

Control depth with counters in the preamble:

\setcounter{tocdepth}{2}    % show down to \subsection in the ToC
\setcounter{secnumdepth}{3} % number down to \subsubsection

Appendices

\appendix
\section{Proofs}          % becomes "A Proofs"
\section{Extra Results}   % becomes "B Extra Results"

Everything after \appendix is lettered instead of numbered. In report and book, \chapter becomes "Appendix A". Some venue templates provide their own appendix environment; check the template's example file.

Front Matter, Main Matter, Back Matter

The book class (and thesis templates based on it) splits the document into three regions:

\begin{document}
\frontmatter          % roman page numbers, unnumbered chapters
\maketitle
\tableofcontents
\chapter{Preface}

\mainmatter           % arabic page numbers, numbered chapters
\chapter{Introduction}

\appendix
\chapter{Supplementary Material}

\backmatter           % unnumbered chapters again
\bibliographystyle{plain}
\bibliography{references}
\end{document}

The PhD Thesis LaTeX Template and Master's Thesis LaTeX Template in the template gallery are already laid out this way, with one file per chapter pulled in by \input or \include. See Multi-File Projects.

Page Breaks

\newpage starts a new page; \clearpage also prints all pending figures and tables first; \cleardoublepage (book) continues on a right-hand page.

Referring to Sections

Give a section a label and refer to it by number so the text stays correct when you reorder:

\section{Method}\label{sec:method}
As described in Section~\ref{sec:method}, ...

The ~ is a non-breaking space that keeps "Section" and its number on one line. See Cross-References and Labels.

If you paste an outline into the AI coauthor thread and ask it to "scaffold these as sections in main.tex", it inserts the \section and \subsection commands for you, following the class and conventions already in the file.

Related articles

Your First LaTeX Document
Cross-References and Labels
Multi-File Projects
Writing for a Venue with Conference and Journal Templates

Prefer to ask?

Inside Coauthor, ask the AI coauthor how any feature works — it answers from these same help articles. For anything else, use the ? button in the top-right corner of the app.

Ready to Write Better Research Papers?

Let Coauthor help you with your next manuscript

7 days free, with €2.50 of AI usage on your own paper