\documentclass[a4paper,11pt]{article}
\usepackage{anysize}
\usepackage{graphicx}
\begin{document}
\title{How to drive \LaTeX{} with flair\thanks{This is a homework
to make you familiar with \LaTeX{} typesetting.}}
\author{%
Soumen Chakrabarti \\
Computer Science and Engineering
\and
A. U. Thor\thanks{Funded by Odin Inc.} \\
Greek Mythology}
\maketitle

\begin{abstract}
In this report we prove that
\begin{eqnarray}
\frac{(n_1 + n_2 + \cdots + n_m)!}{n_1!\, n_2! \ldots n_m!} &=&
{{n_1 + n_2} \choose n_2} {{n_1 + n_2 + n_3} \choose n_3} \ldots
{{n_1 + n_2 + \cdots + n_m} \choose n_m}. \label{eqn-abs}
\end{eqnarray}
Note the thin space after the `$!$' in $n_1!$ and before $n_2$ starts.
Also notice the quotation marks: it is not '$!$'.  Similarly, for
double quotes, always type ``hello,'' not "hello".  Note that
punctuations such as colon, comma, and semicolon are placed
\emph{inside} the quotations.  For fine points of typsetting, see the
\TeX{}book~\cite{Knuth96a}, but do not refer to Lawrence \emph{et
al}~\cite{LawrenceG99}.
\end{abstract}

\section{Introduction \label{sec-intro} }
Our goal is to prove equality~(\ref{eqn-abs}) given on
page~\pageref{eqn-abs}.  Do not use hardwired numbers for any cross
reference.  Instead use the \verb|\label{}|, \verb|\ref{}| and
\verb|\pageref{}| commands.

\def\tablecontents{\begin{tabular}{|l|r|} \hline
Item & Price \\ \hline
Carrots & Rs~5 \\
Peas    & Rs~3 \\ \hline
\end{tabular}}

\subsection{Some tabular material}
You can inline small tables in your document as follows:
\tablecontents.  This will look gross in general, so you should use
the \verb|table| environment to make a floating table, as shown in
Table~\ref{tab-price}.  Similarly, you can typeset figures using the
\verb|figure| environment.

\begin{table}[th]
\center \tablecontents
\caption{Consumer price index. \label{tab-price}}
\end{table}


\subsection{More math}
It is harder than equation~(\ref{eqn-abs}) to typeset the following
displayed equations, using the \verb|eqnarray| environment:
\begin{eqnarray}
\prod_{k\ge 0} \frac{1}{(1 - q_kz)} &=&
\sum_{n \ge 0} z^n \left/ \prod_{1\le k\le n} (1-q^k) \right. \\
\nonumber
\left( \int_{-\infty}^{\infty} e^{-x^2} dx \right)^2 &=&
\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} e^{-(x^2+y^2)}dx\, dy \\
\nonumber &=& \int_0^{2\pi} \int_0^{\infty} e^{-r^2}r\, dr\, d\theta \\
\nonumber &=& \int\limits_0^{2\pi} \left(\left.
-\frac{e^{-r^2}}{2}\right|^{r=\infty}_{r=0}\right) d\theta \\
&=& \pi.
\end{eqnarray}
Notice that in the second last line the limits of the integral look
different.  Also note the space between $x$ and $dx$.  Do not
feel tempted to use $math\ italic$ where you should be using
\emph{text italic}.  Use the \verb|\emph{}| command for this purpose.
They are $different$ (which one was used in this case?).

Even vectors require some care to typeset: say
$\vec{x}=(x_1,\ldots,x_d)$, not $\vec{x}=(x_1,...,x_d)$ or
$\vec{x}=(x_1,\cdots,x_d)$.  You can get more fancy and say
$(\overbrace{x_1,\ldots,x_d}^{\mbox{\scriptsize $d$ numbers}})$ if you
need to.  Arrays can be typeset inline, such as
$\left(\begin{array}{cc}x_{11} & x_{12} \\ x_{21} & x_{22}\end{array}
\right)$, or in a display as shown below.
\begin{eqnarray}
A &=& \left(
\begin{array}{cccc}
a_{11} & a_{12} & \ldots & a_{1n} \\
a_{21} & a_{22} & \ldots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \ldots & a_{mn}
\end{array}
\right)
\end{eqnarray}
Arrays can also be used to typeset conditional formulae such as the
following.
\begin{eqnarray}
f(x) &=& \left\{
\begin{array}{ll}
1/3 & \mbox{if $0 \le x \le 1$;} \\
2/3 & \mbox{if $3 \le x \le 4$;} \\
0   & \mbox{elsewhere.}
\end{array}
\right.
\end{eqnarray}



\subsection{Typesetting pseudocode using \texttt{tabbing}}
Use the \verb|tabbing| environment to typeset the following in a box
that is 0.8 times the width of the printable area.  Notice the reduced
font size (\verb|\footnotesize|).
\begin{center}
\fbox{\begin{minipage}{.8\hsize} \footnotesize
\begin{tabbing}
www\=www\=www\=www\= \kill
\textbf{for $j := 2$ step $1$ until $n$ do} \+ \\
  \textbf{begin}\footnote{Note the footnote in the
\texttt{minipage} environment.} $\textit{accum} := A[j]; \quad k := j-1;
\quad A[0] := \textit{accum};$\\
\textbf{while} $A[k] > \textit{accum}$ \textbf{do} \+ \\
    \textbf{begin} $A[k+1] := A[k]; \quad k:=k-1;$ \\
     \textbf{end} \- \\
  $A[k+1] := \textit{accum};$ \\
  \textbf{end}.
\end{tabbing}
\end{minipage}}
\end{center}

\section{Including pictures}
Use the \verb|\includegraphics{}| command to include \verb|.eps|
files.  These can be produced by:
\begin{enumerate}
\item
Line-drawing as with \verb|xfig|:\\
\includegraphics[scale=.8,angle=270]{sample1.eps}
\item
Or by screen-capture using \verb|xwd| and \verb|xv|:\\
\includegraphics[width=.8\textwidth]{sample2.eps}
\end{enumerate}

\bibliographystyle{abbrv}
\bibliography{sample}

\end{document}


