Contents

LaTeX Document Structure

This article discusses LaTeX document structure for letter, article, report, and book document classes.


LaTeX is a markup-based typesetting system widely used for writing scientific works, reports, books, and theses. One popular platform for writing and composing LaTeX documents is Overleaf, an online editor that enables real-time collaboration and provides complete documentation and templates. Before starting document writing, it’s important to understand the basic structure of LaTeX documents. A .tex file generally consists of three main parts:

  1. Preamble – initial document settings before \begin{document}
  2. Body – main document content between \begin{document} and \end{document}
  3. Additional sections – such as appendices, bibliography, or index

The minimal structure of a LaTeX document is as follows:

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{Document Title}
\author{Author Name}
\date{\today}

\begin{document}

\maketitle
\section{Introduction}
Your introduction text here.

\end{document}

The preamble contains all initial settings before the document begins. It typically includes:

\documentclass[12pt, a4paper]{article}
ClassDescription
articleFor articles, short reports, or papers
reportFor long reports, final projects, or dissertations
bookFor books with chapters
letterFor formal letters

Packages extend LaTeX’s capabilities. Common examples:

\usepackage[utf8]{inputenc}   % Set text encoding
\usepackage[T1]{fontenc}      % Set font encoding
\usepackage{graphicx}         % Insert images
\usepackage{amsmath, amssymb} % Mathematical symbols and formulas

Metadata contains information such as title, author, and date.

\title{LaTeX Document Example}
\author{Author Name}
\date{\today} % or can be left empty with {}

This section contains the main content between \begin{document} and \end{document}. Example basic structure:

\begin{document}

\maketitle

\section{Introduction}
Opening or introductory section of the topic.

\section{Methodology}
Explaining research methods or steps.

\subsection{Steps}
More detailed explanation of the method.

\section{Conclusion}
Final conclusion of the discussion.

\end{document}

LaTeX automatically numbers sections (\section, \subsection, etc.). For unnumbered sections, use an asterisk:

\section*{Acknowledgments}

Use the graphicx package:

\usepackage{graphicx}

\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{image.png}
\caption{Example Image}
\label{fig:example}
\end{figure}

Use the amsmath package:

\begin{equation}
E = mc^2
\end{equation}

For academic documents or books, LaTeX provides additional divisions such as:

\frontmatter    % For front matter (abstract, table of contents)
\tableofcontents

\mainmatter     % Main content (chapters, subchapters)
\chapter{Introduction}

\backmatter     % Back matter (bibliography, appendices)
\appendix
\chapter{Appendix}

Use biblatex for automatic bibliography:

\usepackage{biblatex}
\addbibresource{bibliography.bib}

...

\printbibliography

Here’s an example of the simplest valid document:

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{Hello World in LaTeX}
\author{Author}
\date{}

\begin{document}

\maketitle

\section{Introduction}
This is a minimal document example in LaTeX.

\end{document}

  • Use separate folder structure (/images, /chapters, /bib) to make large documents easier to manage.
  • Separate each chapter into .tex files and call them with \input{} or \include{}.
  • Use the Overleaf Outline Panel to quickly view document structure.
  • Avoid loading excessive unnecessary packages to maintain compilation performance.

  1. Learn LaTeX in 30 Minutes – Overleaf
  2. Sections and Chapters – Overleaf
  3. How to Write a Thesis in LaTeX (Part 1): Basic Structure – Overleaf
  4. Inserting Images – Overleaf
  5. Bibliography Management with BibLaTeX – Overleaf
  6. Using the File Outline in Overleaf

Related Content