The simplest (non-empty) LaTeX document:
\documentclass{article} \begin{document} Hello world! \end{document}
A bit more complicated example:
\documentclass{article} \begin{document} \author{Marcin Borkowski} \title{A simple \LaTeX{} document} \maketitle \section{The first section} Probably 90\% of \LaTeX{} users learn it by \emph{copying examples}. We shall follow that practice. If example files are not enough---and it will happen at some point of learning \LaTeX---then one has to ``RTFM'', or ``Read The Friendly Manual'', i.e.\ consult the \emph{documentation}\footnote{Or ask a friend.}. Let us notice that the actual layout of a paragraph in the source file is irrelevant: newlines are treated like spaces, except that \emph{two} newlines in a row mean ``begin a new paragraph''. \end{document}