\documentclass[12pts]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{epsfig}
\usepackage{graphicx}

\newcommand{\La}{\LaTeX\ }

\newtheorem{thm}{Amazing Theorem}

\begin{document}
\title{\LaTeX cheatsheet}
\author{Renzo}

\maketitle

\section{What is \LaTeX ?}
\label{intro}

\LaTeX is the way that nerdy mathematicians enjoy the most to write their math. Although at the beginning it may seem an unexplicably complicated way of doing things, after you acquire some famliarity it is extremely extremely convenient, as it allows you to:

\begin{enumerate}
	\item Organize the format automatically.
	\item Write formulas in a simple and effective way.
	\item Make referencing automatic.
\end{enumerate}

This is an example of a file containing a bit of info to get you guys started.

\section{Compiling}

With \La you don't immediately see the output of what you write. You have to write a text file that gives the computer ``instructions" for what you want to see.  Then you compile the text file. This can be done with line base commands if you like to be old fashioned, but nowadays there are a lot of  \TeX-text editors that automate all these functions (\La shop for Mac, TeXnic Center for windows for example, but many many others). 

With ordinary writing, things are pretty much the same. The only difference is that
spacing is done automatically. So it doesn't matter if you put one space between two 
words                                         or  lots of it, or
if you just hit enter and go down a line.

To start a new paragraph what you need to do is skip a line.

Here is what you do if you want to write \textbf{boldface}, \textit{italic}, or \textsc{in this funky style that I think is Cool}.

\section {Math}

To write math you have some options. If you just want to put some math in a text line, like $a_0 \leq \alpha^{230}$, then you just put  your math between two dollar signs.

If something is more important, you may want to have it in a more central fashion, then you sandwich it betwen pairs of dollar signs:
$$
\sum_{i=0}^\infty  \frac{x^n}{n!}= e^x
$$

If you want to later reference your formula, then you do this:

\begin{eqnarray}
\int \cos(x) =  \sin(x) + C
\label{trigisboring}
\end{eqnarray}

For a list of commands corresponding to math symbols, just use Google! I'll try to put as many in as I can here, but I am sure I'll be missing some.

\section{Environments}

Writing math is just an example of a \La environment. "Sandwiching with dollars" is just telling your computer: now you are in math mode. Most other environments are  simply recalled by telling the computer to begin and end them. Here are a few examples:

\subsection{Itemize}

\begin{itemize}
	\item this is good
	\item for lists.
\end{itemize}

\subsection{Enumerate}

\begin{enumerate}
	\item this is good
	\item for numbered lists.
\end{enumerate}

\subsection{Description}

\begin{description}
	\item[Sentence 1:] I like this one
	\item[Sentence 2:] because you can index your list however you want
\end{description}

\subsection{Array}

First off, arrays are in "math mode", so always sandwich your command with dollars.

Then, remember you need to specify what kind of delimiters you want and the number of columns.

You separate entries with \& , and rows with two backslashes.

Here is how it goes:

$$
\left[
\begin{array}{cc}
a_0 & a_1\\
b_0 & b_1\\
c_0 & c_1
\end{array}
\right]
$$

or if you want a delimiter only on one side:
$$
\left\{
\begin{array}{ccc}
x+y & = & 1\\
x-y  & = & 0
\end{array}
\right.
$$

Another useful environment is for theorems. The handiest thing is to define it in the preamble (the part at the very beginning of the document). \La keeps track of the numbering by itself.

\begin{thm} 
Traffic lights are very cool. When I see traffic lights I think of
$$
\sqrt{2}
$$
being irrational.
\end{thm}


\begin{thm}[A deep result in number theory]
$$
1+1=2
$$
(true also in characteristic $2$, except in that case it is usually stated as $1+1=0$.)
\label{deep}
\end{thm}
\section{Shortcuts}

One of the cool feaures of \La is that if you use something a lot, you can create a personalized command for it. I did this with \La . See how it is done in the preamble! (Important, commands always start with a backslash!)

\section{Referencing}

\La automatically numbers sections, subsections and so on and so forth, and keeps track of the numbering. You can label sections, formulas etc by simply putting a backslash label command in it.
And then you can recall it with the following command: as stated in section \ref{intro}, referencing is really nice. You can also note that formula (\ref{trigisboring}) is in page \pageref{trigisboring} this way.
Or that theorem \ref{deep} is truly amazing!

\section{Figures}

For figures, you need first off to get yourself a pdf (or eps) file. Then you include it in your text by using the syntax below. It is  sometimes tricky to tell \La where the figure should go, and most of the times \La will decide not to listen to you. The one thing you can try is use the commands  [h],[t],[b]   for "here", "top", or "bottom" of the page (or combinations like [hb] = try to put it here, but if you can't put it at the bottom of the page...)... however that only increases  the possibility  - and does not guarantee - that \La  might listen to you.

\begin{figure}[htb]
	\begin{center}
			\includegraphics[width=0.34\textwidth]{snoopytorus.jpg}
	\end{center}
	\caption{Snoopy is cool, and the sky is a torus...wow!}
	\label{snoopy}
\end{figure}
	
	

\end{document}