Crash Course in LaTeX

Basics: Structure

Even the most basic document has some kind of structure. Often this involves a title block or page, an abstract, numbered sections, and lettered appendices. LaTeX makes it easy to organize your document this way.

Other pages on this site describe lists and footnotes, floats, tables of contents and indices, references to other parts of the same document, and bibliographies.

Title

Add the following lines to your header.
\title{My Document: Will Anyone Read It?}
\author{Homer Jay Simpson}
Then wherever you want the title block (probably right after \begin{document}) put
\maketitle
This will insert the title, author and the current date. Suppose it is February 1 but your paper is due April 9, and you want the date on the paper to be the due date. Then add this to your header along with the title and author commands.
\date{April 9, 2011}
If you have more than one author, they can be separated by \and. You can add contact information either by including line breaks \\ with each author or by using a special kind footnote with the \thanks command. Examples:
\author{Stephen R. Haptonstahl \and Barack H. Obama}
\author{Stephen R. Haptonstahl \\ 
  Department of Political Science \\
  UC Davis
  \and 
  Barack H. Obama \\
  1600 Pennsylvania Avenue NW \\
  Washington, D.C. 20500}
\author{Stephen R. Haptonstahl
  \thanks{Department of Political Science, UC Davis} 
  \and 
  Barack H. Obama
  \thanks{1600 Pennsylvania Avenue NW, Washington, D.C. 20500}
If you want the title to apper on a page of its own, change the \documentclass{article} line (the first line of the source file) adding the titlepage option:
\documentclass[titlepage]{article}
If you want a separate title page and want to organize it some other way, just start your document with
\begin{titlepage}
  Your title page stuff here
\end{titlepage}

Abstract

Wherever you want the abstract (usually right after \maketitle) put
\begin{abstract}This article breaks new ground...\end{abstract}

Sections

There are plenty of commands to indicate sections of the document.
\chapter                   <-- Only available using document classes book or report
  \section                 \
    \subsetion             |
      \subsubsection       | Available in all document classes
        \paragraph         |
          \subparagraph    /
These tell LaTeX the hierarchy of your document, which is useful when it automatically creates a table of contents, but none of these are necessary. For example, you do not need to have a section before you use a subsection. The format of any of these is just
\section{Title of the Section}
You can include a "short title" which will be used in the table of contents and other places that refer to the part by putting the short title in square brackets:
\section[Short Title]{Long Title}
These document parts are numbered automatically. If you do not want the part to be numbered, use the "starred" version.
\section*{Title of the Section}

Appendices

Right before the first appendix put
\appendix
Then use the \section command for each appendix. Appendices will be lettered (A, B, C, ...) rather than numbered like the sections.

Section and Appendix Example

\begin{document}
\section{Introduction}
This paper is important because...

\section{Related Research}
Other people have studied this, but they are all wrong...

\section{Theory}
We assume the cow is a sphere, then generalize to other shapes...

  \subsection{Basic Model}
  Suppose the cow is a sphere...
  
  \subsection{Fancy Model}
  Now suppose we have a cow of irregular shape...
  
    \subsubsection{Four Legs}
    ...
    
    \subsubsection{$n$ Legs}
    ...
    
\section{Conclusions}
...

\appendix

\section{Proofs of Results}
...

\section{Sample Code}
...

\end{document}