\documentclass{article}%
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}%



\title{Template \LaTeX\ document, INF-MAT 2351}
\author{Joakim Sundnes}

\begin{document}
\maketitle

\section{Purpose}
The assignments in INF-MAT 2351 should be handed in electronically as
pdf files. The documents will naturally include some mathematics, and
for this purpose \LaTeX\  is (in my opinion) by far the best tool. You
can use Word or similar tools if you want, but \LaTeX\  is strongly recommended.

We do not impose a rigid format for the assignment. Any well
structured and readable document will do fine. The purpose of this
document is to introduce the \LaTeX\  commands you will use most often,
to serve as an example for what the \LaTeX\  source file looks like, and
to list some useful references for more info. 

\section{Basics}
A \LaTeX\  file is a simple text file, which you can edit with your
favourite text editor. If you have never used \LaTeX\  before you can
copy this file as a starting point. Process (compile) the file with either 
\verb!latex template2351.tex! or \verb!pdflatex template2351.tex!. The
former gives you a \verb!.dvi! file, which can be processed further
with \verb!dvipdf!. The latter gives you a pdf file directly. The two
commands are different in what kind of figure files they expect. If
you include figure files as \verb!.ps! or \verb!.eps! files you need
to use \verb!latex!, otherwise \verb!pdflatex! normally works. This
document compiles with both commands, since the only figure file
included is
provided in two different formats. 

\section*{Commands}
A \verb!*! behind the \verb!\section! command ensures the
section is not numbered. Leaving it out will give you automatic
section numbering. There are also commands \verb!\subsection!,
\verb!\subsubsection! etc. 

We consider the ODE
\begin{equation}
y^{\prime}=31y
\label{ode1}\end{equation}.
with
\[
y(1)=2.
\]
Note that the equation \eqref{ode1}  is numbered and labeled, and can be referenced in the text,
while the initial condition is not.

Mulitible equations are easily included with the \verb!\align!
command:
\begin{align}
y^{\prime}&=31y , \\
y(1)&=2 .
\end{align}

You can also include math directly in the text like this, $y^{\prime}=31y $.

\subsection*{Tables and figures}
Tables and figures can be included, see Table \ref{tab1} and Figure
\ref{fig1}. These are positioned automatically in the document, which
sometimes can be annoying, but it is possible to override the
automatic positioning. 

\begin{figure}
\begin{center}
\includegraphics{graphics/parabola}
\end{center}
\caption{This is a parabola}
\label{fig1}
\end{figure}

\begin{table}
\begin{center}
\begin{tabular}{|l|c|r|}
\hline 
$\Delta t$ & $e$ & $e/\Delta t$ \\ \hline \hline
1.0  & 1.0 & 1.0 \\ \hline
0.5 & 0.5 & 1.0 \\ \hline
0.25 &  0.25 & 1.0 \\ \hline
\end{tabular}
\end{center}
\caption{The numerical errors show perfect first order convergence}
\label{tab1}
\end{table}

\subsection{References}
There are several ways to include references. For advanced use
\verb!bibtex! is superior, but for just including a couple of
references it may be easier to do it more manually. See also
\cite{Oetiker2014} for much more info, or the local \LaTeX\ 
documentation \cite{Langmyhr}

\begin{thebibliography}{10}

\bibitem{Oetiker2014}
T. Oetiker, H. Partl, I. Hyna, and E. Schlegl. 
The Not So Short Introduction to \LaTeX2$\varepsilon$ 
\newblock{\em https://tobi.oetiker.ch/lshort/lshort.pdf}

\bibitem{Langmyhr}
D. Langmyhr. Informasjon om \LaTeX\  med venner. \\
\newblock{\em http://www.mn.uio.no/ifi/tjenester/it/hjelp/latex/}
\end{thebibliography}
\end{document}