\documentclass[12pt]{article}

\usepackage{precalc}
\usepackage{url}
\usepackage{supertabular}

\begin{document}

\pctitle{\LaTeX\ cheat sheet}

All the \LaTeX\ commands you know and love\dots now gathered into one
convenient reference!

For more information, see 
\url{http://tug.ctan.org/tex-archive/info/lshort/english/lshort.pdf}.

\section{General}
\label{sec:general}

\begin{itemize}
\item All \LaTeX\ commands start with a backslash.  Command arguments
  go in \{curly braces\}.

\item \LaTeX\ ignores anything from a precent sign (\%) to the end of
  the line (comments).

\item Paragraphs are separated by a blank line.

\item Use two backticks to make an opening quotation mark and two
  apostrophes to make a closing one: \verb|``quotation marks''|.

\item \verb|\section{Foo}| starts a new section titled ``Foo,'' and
  likewise for \verb|\subsection| and so on.

\item You can give any numbered or lettered thing (section, equation,
  list item, etc.) a label with \verb|\label{foo}| and then later
  refer to it using \verb|\ref{foo}| to automatically insert the
  correct number.  For example:

\begin{verbatim}
  \begin{equation} 
    \label{eq:pythagorean}
  
    a^2 + b^2 = c^2
  \end{equation}

  As shown in equation \ref{eq:pythagorean}...
\end{verbatim}

\item You can define your own commands in the preamble (the part of
  the file before the \verb|\begin{document}|) with
    \verb|\newcommand{\com}{blah}|.  From now on, everywhere you write
    \verb|\com| it will be replaced with \verb|\blah|.
\end{itemize}


\section{Environments}
\label{sec:environments}

\begin{itemize}
\item Creating a \LaTeX\ document:

\begin{verbatim}
  \documentclass{article}

  % setup goes here

  \begin{document}

    % content goes here

  \end{document}
\end{verbatim}

\item Make a bulleted list with 
\verb|\begin{itemize} ... \end{itemize}|, and a numbered list with
\verb|\begin{enumerate} ... \end{enumerate}|.  Each list item starts
with \verb|\item|.

\item In general, the ``environment'' \verb|foo| starts with
  \verb|\begin{foo}| and ends with \verb|\end{foo}|.


\item Make a table with the \verb|tabular| environment.  For example:

\begin{verbatim}
  \begin{tabular}{cc|c}   
    $A$ & $B$ & $A \land B$  \\    
    \hline         
    $T$ & $T$ & $T$ \\ 
    $T$ & $F$ & $F$ \\ 
    $F$ & $T$ & $T$ \\
    $F$ & $F$ & monkey
  \end{tabular}
\end{verbatim}

\end{itemize}

\section{Mathematics}
\label{sec:mathematics}

\begin{itemize}

\item Mathematics in the middle of text should be surrounded by
  dollar signs.  For example:

\begin{verbatim}
  Since we know that $x^2 - 5 \leq f(z)$, we can 
  substitute for $f$ to obtain...
\end{verbatim}

\item Make an equation by itself on a separate line with an
  \verb|equation| environment.  If you don't want a number next to the
  equation, use \verb|equation*| instead, or use \verb|\[ ... \]|.
  You don't need to use dollar signs inside an \verb|equation|
  environment; it is in ``math mode'' automatically.

\item Make superscripts with \verb|^| (carat) and subscripts with
  \verb|_| (underscore).  If your superscript or subscript is more
  than one character, be sure to enclose it in curly brackets.  For
  example, \verb|2^i| ($2^i$), \verb|x_{99}| ($x_{99}$).

\item You can make a multi-line equation (for example, to show the
  steps in solving an equation) using an \verb|align*| environment.
  Put the alignment character \verb|&| before the place in the
  equations that you want aligned, and put \verb|\\| at the end of
  each line except the last.  For example:
\begin{verbatim}
  \begin{align*}
    x &= y + 4 \\
    z &= 2 + \sqrt{x} \\
      &= 2 + 1 + \sqrt{x} - 1 
  \end{align*}
\end{verbatim}

\item You can make matrices with a \verb|pmatrix| environment (use
  \verb|vmatrix| for determinants).  For example, you can typeset the
  following matrix: \[
  \begin{pmatrix}
    4 & 5 & x + 2 \\
    9 & 0 & \pi \\
    6 + 5i & \sqrt{3} & -2
  \end{pmatrix}
  \]
  with this code:
\begin{verbatim}
  \[
    \begin{pmatrix}
      4 & 5 & x + 2 \\
      9 & 0 & \pi \\
      6 + 5i & \sqrt{3} & -2
    \end{pmatrix}
  \]
\end{verbatim}

\item You can create sigma notation using the \verb|\sum|
command, followed by a subscript and a superscript for the parts below
and above the $\Sigma$.  For example, \verb|\sum_{k=1}^{20} (k^2 + 3)|
produces \[ \sum_{k=1}^{20} (k^2 + 3). \]

\item You can write modular equivalences with \verb|\equiv| and
  \verb|\pmod|.  For example, the equation \[ 12 \equiv 17 \pmod{5} \]
  can be typeset with \verb|12 \equiv 17 \pmod{5}|.
\end{itemize}

\section{Symbols}
\label{sec:symbols}

\subsection{General mathematical symbols}
\label{sec:general-symbols}

All of the commands listed below are standard \LaTeX\ commands except
those marked with an asterisk$^*$, which are defined in \texttt{precalc.sty}.

\tablehead{Symbol & command \\ \hline \\}

\begin{supertabular}{cc}
  \LaTeX & \verb|\LaTeX| \\  
  $\leq$  & \verb|\leq| \\
  $\geq$  & \verb|\geq| \\
  $\sqrt{x}$ & \verb|\sqrt{x}| \\
  $\sqrt[5]{x}$ & \verb|\sqrt[5]{x}| \\ 
  $\dots$ & \verb|\dots| \\
  \\

  $\{$   & \verb|\{| \\
  $\suchthat$ & \verb|\mid|, \verb|\suchthat|$^*$ \\
  $\}$   & \verb|\}| \\
  $\in$  & \verb|\in| \\
  $\not \in$ & \verb|\not \in| \\
  $\emptyset$ & \verb|\emptyset| \\
  $\N$   & \verb|\N|$^*$ \\
  $\Z$   & \verb|\Z|$^*$ \\
  $\Q$   & \verb|\Q|$^*$ \\
  $\R$   & \verb|\R|$^*$ \\
  $\I$   & \verb|\I|$^*$ \\
  $\C$   & \verb|\C|$^*$ \\
  $\union$ & \verb|\cup|, \verb|\union|$^*$ \\
  $\intersect$ & \verb|\cap|, \verb|\intersect|$^*$ \\
  $\setminus$ & \verb|\setminus| \\
  $\overline{S}$ & \verb|\overline{S}| \\
  $\infty$ & \verb|\infty|  \\
  $\subseteq$ & \verb|\subseteq| \\
  $\subset$ & \verb|\subset| \\
  $\times$ & \verb|\times| \\ 
  \\

  $\to$   & \verb|\to| \\
  $\mapsto$ & \verb|\mapsto| \\
  $\circ$ & \verb|\circ| \\
  \\

  $\land$ & \verb|\land| \\
  $\lor$ & \verb|\lor| \\
  $\neg$ & \verb|\neg| \\
  $\implies$ & \verb|\implies| \\
  $\iff$ & \verb|\iff| \\
  $\forall$ & \verb|\forall| \\
  $\exists$ & \verb|\exists| \\
  $\oplus$ & \verb|\oplus| \\
  \\

  $\sin$ & \verb|\sin| \\
  $\cos$ & \verb|\cos| \\
  $\cis$ & \verb|\cis|$^*$ \\
  $\tan$ & \verb|\tan| \\
  $\csc$ & \verb|\csc| \\
  $\sec$ & \verb|\sec| \\
  $\cot$ & \verb|\cot| \\
  $50^\circ$ & \verb|50^\circ| \\
  $\arcsin$ & \verb|\arcsin| \\
  $\arccos$ & \verb|\arccos| \\
  $\arctan$ & \verb|\arctan| \\
  \\

  $\det$ & \verb|\det|  \\
\end{supertabular}

\subsection{Greek alphabet}
\label{sec:greek}

  \begin{tabular}{lcc}
      Name & Lowercase & Uppercase \\
      \hline
      \verb|\alpha| & $\alpha$ & --- \\
      \verb|\beta| & $\beta$ & --- \\
      \verb|\gamma| & $\gamma$ & $\Gamma$ \\
      \verb|\delta| & $\delta$ & $\Delta$ \\
      \verb|\epsilon| & $\epsilon$ & --- \\
      \verb|\zeta| & $\zeta$ & --- \\
      \verb|\eta| & $\eta$ & --- \\
      \verb|\theta| & $\theta$ & $\Theta$ \\
      \verb|\iota| & $\iota$ & --- \\
      \verb|\kappa| & $\kappa$ & --- \\
      \verb|\lambda| & $\lambda$ & $\Lambda$ \\
      \verb|\mu| & $\mu$ & --- \\
      \verb|\nu| & $\nu$ & --- \\
      \verb|\xi| & $\xi$ & $\Xi$ \\
      \verb|\pi| & $\pi$ & $\Pi$ \\
      \verb|\rho| & $\rho$ & --- \\
      \verb|\sigma| & $\sigma$ & $\Sigma$ \\
      \verb|\tau| & $\tau$ & --- \\
      \verb|\upsilon| & $\upsilon$ & $\Upsilon$ \\
      \verb|\phi| & $\phi$ & $\Phi$ \\
      \verb|\chi| & $\chi$ & --- \\
      \verb|\psi| & $\psi$ & $\Psi$ \\
      \verb|\omega| & $\omega$ & $\Omega$ \\
    \end{tabular}

\end{document}

