Skip Navigation.

Sample LaTeX Document

This sample structure is from page 16 of Peter Flynn's "A Beginner's Guide to Typesetting with LaTex."

The top portion defines your document, with document class and listing the packages you'll be using. This defines the structure for the rest of your document, so make sure that this is correct.

Next is a short bit of text as an example.

Next is an itemized list. See more on lists on the lists page.

Then, a subsection is given as an example. This is followed by an example of how to center text, and the end of the document. To see the PDF version of this, click here.

\documentclass[12pt]{article}
\usepackage{palatino,url}
\begin{document}
\section*{My first document}

This is a short example of a \LaTeX\ document
I wrote on \today. It shows a few simple features
of automated typesetting, including

\begin{itemize}
\item setting the default font to 12pt;
\item specifing `article' type formatting;
\item using the palatino typeface;
\item adding special formatting for URLs;
\item formatting a deading in `section' style;
\item using the \LaTeX\ logo;
\item generating today's date;
\item centering and italicizing;
\item autonumbering the pages.
\end{itemize}

\subsection*{More information}

This example was taken from `Formatting Information,'
which you can download from \url{http://www.silmaril.ie/downloads/}
and use as a teach-yourself guide.

\begin{center}
\itshape Have a nice day!
\end{center}

\end{document}

Back