LaTeX document structure

An example of an ``article’’:

\documentclass{article}

\begin{document}

\author{A. U. Thor}
\title{Yet another \LaTeX{} document}
\maketitle
\tableofcontents

\section{The first section}
\label{sec:first}

\section{The second section}
\label{sec:second}

\subsection{A subsection}
\label{subsec:first}

\subsection{Another one}
\label{subsec:second}

\section*{Appendix}
This documents has a few sections: Section~\ref{sec:first},
Section~\ref{sec:second}, which consists of
Subsection~\ref{subsec:first} and Subsection~\ref{subsec:second}, and
an unnumbered Appendix.

Unsurprisingly, Section~\ref{sec:first} begins on
page~\pageref{sec:first}.

There can be also subsubsections, ``paragraphs'', and
``subparagraphs'', but it is better not to overuse them without a good
reason.  On the other hand, there are also larger structures: parts
and chapters\footnote{In the ``book'' document class.}.

\end{document}