LaTeX

Basics

There are two types of text inside LaTeX: math text, and normal text.
$ ... $ = math text
$$ ... $$ = math text on a centered, new line
/ = Needed in front of any math symbol.
Comments are prefaced with a "%" sign.
To create your actual LaTeX document, run
         latex name-of-file.tex from the terminal.

Example
\documentclass[11pt]{article}
\usepackage{amstex}

\begin{document}

La la la math is so cool....
\textbf{bold!}
\textit{talicised!}
\texttt{typewriter-text}
\size{ where size = tiny, scriptsize, footnotesize, small, normalsize, large, Large, or LARGE, huge, HUGE }
(Rest of the paper)

\end{document}
Document Classes
LaTeX files begin with a command: \documentclass.
For instance, you may have:
\documentclass[11pt]{article}

  • article: for articles, the most commonly used class
  • report: variant of article for a report
  • letter: for letters
  • book: for chapters of a book
  • proc: for proceedings, based on article
  • slides: to produce transparencies
  • Packages
    You may also import packages into LaTeX, generally for extra symbols. For instance, you may have:
    \documentclass[11pt]{article}
                    \usepackage{amstex, amssymb, amscd}

    Common Packages
  • amsmath, amsthm: These packages have a lot of standard math symbols.
  • amssymb: Additional fonts and symbols.
  • amscd: This is a package for typesetting simple commutative diagrams. It's lightweight and easy to use, but it cannot handle diagonal arrows; if you need diagonal arrows, use the xy package described below.
  • xy: This package that loads the "xy-pic" program, a general drawing package for TeX that is great for drawing directed graphs and complex commutative diagrams. Very powerful.
  • graphicx: The graphicx package allows you to include graphics created by other applications. The graphics files must be in eps (encapsulated postscript) format.
  • microtype The microtype package improves the spacing between words and letters. Load this package after any font packages you load, as the package behavior is dependent on this font. Basically, it just makes stuff a tad bit prettier.
  • geometry Allows you to alter the margins of your page.
  • Formatting
    The main way of controlling the format of your document is by using matched pairs of \begin{ } and \end{ } commands. You may declare such an environment in one of the following ways:
             \begin{itshape}
             The polynomial $p(t)$ splits...
             \end{itshape}
    or simply:
             {\itshape The polynomial $p(t)$ splits ...}


    State a proposition or theorom
             \begin{prop}
             This is the text of my awesome proposition
             \end{prop}

             \newtheorem{thm}{Theorem}
             \begin{thm}[Main Theorem]
             This is the main theorem.
             \end{thm}

    List things (1., 2., 3. ...)
             \begin{enumerate}
             \item $M$ is complete
             \item $f$ is proper
             \end{enumerate}

    Center (or underline) Text
             \begin{center}
             This will be centered!
             \end{center}
    (or underline )

    Spacing
             \vskip100pt
             \newpage
             \newline
             \linebreak
             \\ = new paragraph
             \\* = new line, but not a new paragraph

    Tables
    The 8 c's tell LaTeX that the table should have 8 columns, and the entries in each column are to be centered (using l or r makes them left or right justified). The vertical bar characters, |, tell LaTeX to draw vertical lines between the first and second columns, and after the eighth.          \begin{center}
             \begin{tabular}{c|ccccccc|}
                $\lambda$& (5)& (4,1)& (3)& (3,1)& (2)& (1)& (1,1)\\
             \hline
                $d_{_\lambda}$& 1& 4& 5& 6& 5& 4& 1\\
             \end{tabular}
             \end{center}

    Formatting (2)
    Sections
             \section{Introductory Remarks}
             \subsection{ }
             \subsubsection{ }
             \chapter{ } (only in report and book document styles
             \label{ }
             \ref{ }
    e.g.:
             \subsection{Garden Flowers}
              \label{Tulips}
             ...
             ... as we saw in Section \ref{Tulips}, tulips are damned pretty ...

    Bibliographies
             \begin{thebibliography}{[AHU]}
             \bibitem[AHU]{ahu} Aho, A.,\ Hopcroft, J.,\ and
             Ullman, J.\ (1976). {\em{The Design and
             Analysis of Computer Algorithms.}} Addison
             Wesley, Reading, Mass.
             \bibitem[AT]{AT} Auslander, L. and Tolmieri, R.
             (1979). Is Computing with the Fast Fourier
             Transform Pure or Applied Mathematics?
             {\em{Bulletin (New Series) of the AMS Vol. 1}}
             847-897.
             \end{thebibliography}

    Equations Using the equation environment puts you in math mode, so you don't need to use $ sigs, and creates a numbered, centered equation.

    Subcripting and Superscripting
             subscript: $\alpha_j$
             superscript: $\alpha^j$
             both: $\alpha_j^i$
             Extra-low subscript: $\alpha_{_j}$ (applies lowering operator, "_", twice)

    Text Inside Math
             $$ \{\psi \mid \psi \text{ is an additive character}\} $$. In math mode, LaTeX ignores all spaces. So, it's good to use the following to tell LaTeX to space text-based symbols as text.
             $$ X := \operatorname{Spec}A $$