\documentclass[12pt]{article} % 10 and 11 point also available
\usepackage{amsmath, amssymb} % these packages should be included in your TeX installation
\begin{document} % end of the preamble
% This document was edited from one Tom Hull gave me, which he yanked from somewhere else ~a decade ago.
\title{My Awesome Paper} % defines the title info
\author{Minnie Maximallian}
\maketitle % this actually does the title. Omit this if you don't want a title.
Intro optional blah blah. Just type in text normally! \LaTeX\ will format normal text very professionally, just like a real publication.
\section{Our very first section}
To start things off I'll blah blah blah % LaTeX ignores
more text blah blah blah blahblah. % extra spaces
But then I'll blah blah blah blah blab. Notice
by leaving a blank line, I started a new paragraph!
Yippe-de!
\section{Our Second Section!}
\subsection{Math formulae in text}
Use dollar signs before and after a mathematical
expression. One formula is $x-3y=7$. Another
is $A=\pi r^2$.
\subsection{Important-looking math formulae}
Use double dollar signs to put a formula/equation
on a line by itself!
$${d\over dx}\arcsin x=
(1-x^2)^{-{1\over 2}} =
\int_0^x\theta(1-\theta^2)^{-{3\over 2}}d\theta $$
There are easily-remembered keywords for all
the mathematical symbols you want to use.
Begin all of them with a backslash.
$$\alpha+\beta < \gamma \leq \Gamma
\approx \lim_{n \rightarrow \infty} x_n =
\prod_{i=1}^{\infty} \sqrt{y_i} $$
\subsection{Magical parentheses and things!}
\LaTeX\ keeps track of how big things are very nicely!
$$\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{x}}}}}}}}$$
$$\left\{ {n\choose 0}+{n\choose 1}+{n\choose 2}+\cdots
+{n\choose n}\right\} = 2^n$$
$$\left(\left(\left(\left(x^2\right)^2\right)^2\right)^2\right)^2=x^{32}$$
Notice how these work: Every time we have a \verb+\left+ command we need a \verb+\right+ command to go with it. Using these commands with parentheses () and brackets \{\} will make them as big as they need to be.
\subsection{Neat formulae}
To print a list of equations with the equal signs alinged:
\begin{eqnarray}
x_{i+1} & = & N^{i+1}(x_0) \\ % \\ means newline in
& = & N(x_i) \\ % this environment
& = & x_i-{f(x_i) \over f'(x_i)} % But no \\ on the
\end{eqnarray} % last line!
In fact, to do anything really fancy, you need to use arrays.
$$D(x)=\left\{ \begin{array}{cl} % cl means 2 columns, the first
1 & \mbox{if }x\mbox{ is rational,}\\ % is centered, the 2nd is flush left
(x+1)^2 & \mbox{otherwise}
\end{array} \right. % the \right. is needed to match the
\mbox{ or } % \left\{, but it prints nothing.
M=\left( % Every \left must have a \right following it.
\begin{array}{ccc}
1 & 0 & 1 \\
2 & -1 & 0 \\
3 & 3 & 17\end{array}\right) $$
Notice how I use the \verb+\mbox+ command to do normal text inside of ``math mode." (Also notice how I just got the ``quotes" to work properly there!)
\subsection{Lists}
A bulleted list
\begin{itemize}
\item of words
\item in the rest
\item of this sentence.
\end{itemize}
A numbered list
\begin{enumerate}
\item of words
\item in the rest
\item of this sentence.
\end{enumerate}
\subsection{Other stuff}
\LaTeX\ has lots of of commands to make text {\large large}, {\Large larger},
{\Huge huge}, {\small small}, and {\tiny tiny}!
\def\qed{\raise1truemm\hbox{$\infty\hskip-.165in\lower6truept\hbox{$\smile$}$}}
We can also define new commands. For example, the above (see the source code!)
produces a command \verb+\qed+ which can be used as an alternative to qed,
namely \qed.
Or suppose we needed a falling power command, which \LaTeX\ doesn't provide. To
do this, we need to define a command with an argument.
\def\fall#1{\underline{#1}}
This gives us $n^{\fall k}=n(n-1)(n-2)\cdots (n-k+1)$.
\section{Typesetting things like Homework!}
On the next page I'll do an example of how you might want to format homework and things like that. There are fun commands like \verb+\hline+ and \verb+\hfill+ that can be used to do make fun-looking headers and such. I'll also include an example of how to make a TABLE of things in \LaTeX. But first I'll use the \verb+\clearpage+ command to make a new page and then I'll do the sample homework! Let's go!
\clearpage
\noindent Thomas Hull \hfill 3/29/04
\centerline{\bf A goofy homework assignment!}
\smallskip
\hrule
\vspace{.05in} % the \vspace command makes some vertical space. Very useful!
\noindent {\bf (1)} Find the airspeed velocity of an unladen swallow.
\vspace{.1in}
{\bf Solution:} This problem is unclear because it does not specify if it is an African or European swallow. Therefore it is impossible to give an accurate answer. Fooey!
\vspace{.2in}
\noindent{\bf (2)} Make a table. Any table. Just for fun.
\vspace{.1in}
{\bf Solution:} Here is a table, just for fun:
\begin{tabular}{||l||c|c|c|c|c|c||}
\hline\hline
Module angle & $30^\circ$ & $45^\circ$ & $54.7^\circ$ & $60^\circ$ & $67.5^\circ$ &
$75.5^\circ$\\
\hline\hline
3-gon (triangle) & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ &
$\checkmark$ & $\checkmark$\\
\hline
4-gon (square) & & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ &
$\checkmark$\\
\hline
5-gon & & & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$\\
\hline
6-gon & & & & $\checkmark$ & $\checkmark$ & $\checkmark$\\
\hline
8-gon & & & & & $\checkmark$ & $\checkmark$\\
\hline
10-gon & & & & & & $\checkmark$\\
\hline
12-gon & & & & & & $\checkmark$\\
\hline\hline
\end{tabular}
\end{document}