Skip to content

Instantly share code, notes, and snippets.

@sorrell
Created February 19, 2012 03:52
Show Gist options
  • Save sorrell/1861854 to your computer and use it in GitHub Desktop.
Save sorrell/1861854 to your computer and use it in GitHub Desktop.
Latex intro (2)
\documentclass{article}
\usepackage{amsmath}
\title{My First Document}
\author{Nick}
\date{\today}
\begin{document}
$x_0^5 + x_1 ^4$
\\ ------- \\
\[ x_0^{5x^e} + x_{1+3x} ^4 \]
\\ ------- \\
\begin{equation}
x_0^5 + x_1 ^4 \label{eq:MyFirstEquation}
\end{equation}
\\ ------- \\
\begin{eqnarray*}
x_0^5 + x_1 ^4 &=& e^{i\pi} \\
&=& \frac{1}{2} + \sqrt{\frac{1}{2}}
\end{eqnarray*}
\begin{eqnarray*}
f(n) = \left\{
\begin{array}{l l}
n/2 & \quad \text{if $n$ is even}\\
-(n+1)/2 & \quad \text{if $n$ is odd}\\
\end{array}
\right. %NOTICE this "closes" your curly brace!
\end{eqnarray*}
And then, later on in the text, we can use \eqref{eq:MyFirstEquation} to reference that equation!
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment