% Header, contains document class declaration, imports required packages, a place to define
% local commands. Usually you don't have to mess around with any of this, provided
% you can find the template which suits your needs.
\documentclass[12pt]{article}
\usepackage{amsmath,amsgen,amstext,amsbsy,amsopn,amsfonts}
% standard AMS packages for symbols, formats, etc.
\usepackage{url,graphicx,tabularx,array,geometry}
% packages for web interface, graphics, etc,
\pagestyle{plain}
\setlength{\parskip}{1ex} %--skip lines between paragraphs
\setlength{\parindent}{0pt} %--don't indent paragraphs
%-- Commands for header
\renewcommand{\title}[1]{\textbf{#1}\\}
\renewcommand{\line}{\begin{tabularx}{\textwidth}{X>{\raggedleft}X}\hline\\\end{tabularx}\\[-0.5cm]}
\newcommand{\leftright}[2]{\begin{tabularx}{\textwidth}{X>{\raggedleft}X}#1%
& #2\\\end{tabularx}\\[-0.5cm]}
%\linespread{2} %-- Uncomment for Double Space
% Main text/body. Notice \begin{document} and \end{document}. Many environments
% in LaTeX are set up like this.
\begin{document}
\title{My First Homework in \TeX}
\line
\leftright{\today}{Jimbo Jones} %-- left and right positions in the header
\section{Getting Started}
This is a sentence in the first section.
\subsection{subsections}
This is a sentence in the first subsection of the first section.
Notice that the numbers are assigned automatically (by default in this style).
\section{All the benefits of \LaTeX}
Using \LaTeX\ for homework allows you to do lots of nice things like:
\begin{itemize} %Notice the use of \begin for beginning an "itemize environment"
\item Have your work neatly typeset
\item Impress your professors
\item Include equations easily
\item Put math $\in$ the text: $\textrm{money} = \sqrt{\textrm{all evil}}$
\item Not ever have to mess with a WYSIWIG word processor
\end{itemize}
You {\it can} typeset the reserved symbols \#\ \$\ \%\ \&\ \_\ \^\ \{\ \}\ $\tilde{}$\ $\backslash$, but
you have to be careful when using them in the \texttt{.tex} file
\section{math notation} % This is a subsection. All the structure you want is already available!
The purpose of this section is to provide a variety of examples of mathy notation.
Being able to include equations is especially nice. Say you were doing a
homework involving the Pythagorean theorem:
\begin{equation}
c = \sqrt{a^2+b^2},
\end{equation} % Notice this equation is numbered (it is formatted in the equation environment, so
% it gets numbered automatically.
which can also be written as
$$c=\sqrt{a^2+b^2}$$ % A displayed equation not numbered
or even $c=\sqrt{a^2+b^2}$. % an inline equation
A single carriage return
in the .tex file translates into a space in the output file.
A double carriage return in the .tex file translates into a paragraph break in the output
file.
Here is a nice matrix formula:
$$\left[\begin{array}{cc}
a & b \\
c & d \\
\end{array}\right]^{-1}
=\frac{1}{ad-bc}\left[\begin{array}{cc}
d & -b \\
-c & a \\
\end{array}\right].$$
Here is a displayed formula:
$$e=\sum_{n=0}^\infty\frac{1}{\int_0^\infty s^ne^{-s}\ ds}.$$
As an inline formula, this is
$e=\sum_{n=0}^\infty\frac{1}{\int_0^\infty s^ne^{-s}\ ds}$.
Also consider $\displaystyle{e=\sum_{n=0}^\infty\frac{1}{\int_0^\infty s^ne^{-s}\ ds}}$.
See the difference?
The inner product in a finite dimensional hermitian space
can be taken as
$$\left=\sum_{i=1}^n x_i\overline{y}_i.$$
Using this, the usual norm is given by
$$\|x\|=\sqrt{\left}.$$
One may write $\displaystyle{\lim_{x\rightarrow a}f(x)=L}$ if for every
$\epsilon>0$, there is $\delta>0$ such that $\left|f(x)-L\right|<\epsilon$
whenever $0<|x-a|<\delta$. ``Less than or equal'' is given by $\leq$.
Trig functions are given by $\sin$, $\cos$, $\tan$, etc.
Notice that
$$|x|=\left\{\begin{array}{ccl} % note the alignment designations
-x & \hbox{if} & x<0, \\
x & \hbox{if} & x\geq 0, \\
\end{array}\right.$$
is defined piecewise.
% \begin{theorem}
% Suppose $a$, $b$, and $c$ are the legs and hypotenuse of a right triangle. Then
% $$a^2+b^2=c^2.$$
% \end{theorem}
The real numbers $\mathbb{R}$, the integers $\mathbb{Z}$, the field $\mathbb{C}$ of complex numbers, etc.
A note about superscripts: Why does $2^10$ appear different than $2^{10}$?
\section{sizes and typefaces}
{\tiny This is tiny.}
{\small This is small.}
{\large This is large.}
{\Large This is Large.}
{\LARGE This is LARGE.}
{\Huge This is Huge.}
\underline{This is underlined.}
{\bf This is bold.}
{\it This is italicized.}
This is a good way to do ``quote marks''
\pagebreak % A useful command!
\section{Exercise 1}
Typeset a page from Whittaker and Watson.
\end{document}