\documentclass[a4paper,10pt]{article}
% This is a comment line
% Basic settings
\usepackage[latin1]{inputenc}
\usepackage{amsfonts,amsmath,amssymb,amsthm}
\usepackage{t1enc}
\usepackage{url}
\usepackage{times}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
%Pseudocode
\usepackage[ruled,linesnumbered,nofillcomment,vlined]{algorithm2e}
%\usepackage[noend]{algorithmic}
\DeclareMathOperator{\argmin}{argmin}
\DeclareMathOperator{\argmax}{argmax}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}
% Meta information on the document
% Actual text will be produced with command \maketitle
\author{Jon Doe}
\title{My Fun with Algorithms}
\date{18 April 2018}
% Here, the actual document begins.
%=========================================================================================
%=========================================================================================
\begin{document}
%=========================================================================================
%=========================================================================================
% Create title page
\maketitle
% Create Table of Contents
\tableofcontents
% Structuring the document by
% \section{} and \subsection{}
%=========================================================================================
\section{Introduction}
%=========================================================================================
% A \label that is created for a figure, table, section etc. can later be used to refer to it using \ref (creating the number) or \pageref (creating the number of the page containing the object)
\label{sec:intro}
% With \cite, you refer to literature.
% The ~ in front of \cite{} creates a non-breaking space.
Write whatever you want to write, bablabla.
To begin a new paragraph, there has to be at least one empty line in-between the paragraphs.
You can see that, at least in this template, a paragraph begins with an indentation.
The \emph{Burrows-Wheeler-Transform} introduced by Burrows and Wheeler in 1994~\cite{BUR-WHE-1994} allows to, \ldots
If necessary, you can also cite websites~\cite{citingWebsites,wiki:xxx2}.
\subsection{Figures and tables}
\label{sec:ibwt}
As motivated in Section~\ref{sec:intro}, \ldots, ca.\ 1 liter of water visualized in Figure~\ref{fig:example}.
% A figure in a floating environment.
% LaTeX determines, where to place the figure.
% Placing can be influenced with [htb]:
% h here
% t top of a page
% b bottom
% p a separate page with figures
\begin{figure}
\begin{center}
% to include a graphics file use:
% \includegraphics[width=0.5\textwidth]{filename}
% ideally without specifying the file ending ".pdf" etc.
% Formats that are usually supported are
% pdf, png, jpeg
%
\framebox{This is just a placeholder}
\end{center}
\caption{Example of a figure. Usually, the caption begins with a short phrase like the one before, followed by further explanations in complete sentences. If a figure is copied from another source, you have to indicate this clearly. Figure reprinted from~\cite{alts}.}
\label{fig:example}
\end{figure}
Please recall that each figure, table, pseudo code
\begin{itemize}
\item has to be referred to in the main text (at that position where you want the reader to read them),
\item has to contain an explicit citation in the caption if it is not your own,
\item has to be briefly explained in the caption such that it is self-contained,
\item has to be scaled appropriately (font size equals font size of main text), and
\item is put to the top or bottom of a page by Latex (don't mess up the placing manually).
\end{itemize}
Table~\ref{tab:tabel} shows a list of irrelevant\footnote{Avoid footnotes as they interrupt the reading flow.} numbers. And here is just some more text to produce some lines. Ignore the content---it is stupid blabla.
% A table as floating object. Similar to figures...
\begin{table}
\caption{A table. Again, further explanations follow in complete sentences and sources have to be cited clearly.}
\label{tab:tabel}
\begin{center}
% Here the actual table.
% {lcr}specifies the columns
% l for a leftifyed column, r rightifyed, c centered.
% | separates two columns by a vertial line, e.g., r|ll (usually ugly)
\begin{tabular}{lrr}
% \\ ends a row
% \hline adds a horizontal line
% \cline{2-3} adds a line from column 2 through 3
% The content of the colmns is separated by &, extra spaces are ignored
\hline
& \multicolumn{2}{c}{Collection} \\\cline{2-3}
& Small & Large \\\hline\hline
File size (Kb) & 18.2 & 1\,202.3 \\
Index size (Kb) & 1.3 & 109.0 \\
Number of words & 1\,200 & 98\,234\\\hline\hline
CPU time (Hr:Min) & 2:37 & 8:31 \\
Memory (Mb) & 42.3 & 121.3 \\
\hline
\end{tabular}
\end{center}
\end{table}
\section{Some math}
This section contains some loose collection of math to exemplify (i) some Latex syntax, and (ii) good style in presenting mathematics.
\medskip
%If you do not want to have indentation for such a short line, use \noindent in front of the line.
\noindent Let $\langle V \rangle$ be a vector space defined by
\begin{equation}\label{eqn:vs}
\langle V \rangle \ = \ \left\{ \sum\limits_{i=1}^n \alpha_i x_i \mid \alpha_i \in F, 1 \leq i \leq n \right\}.
\end{equation}
We now show that $\langle V \rangle$ is closed under addition. Consider two vectors $x,y \in \langle V \rangle$. Then $x = \sum_{i=1}^n \alpha_i x_i$ and $y = \sum_{i=1}^n \beta_i x_i$.
For any constants $\alpha, \beta \in F$, we have
%If you use align instead of align*, all equations are numbered.
\begin{align*}
\alpha x + \beta y & \ = \ \alpha\left( \sum\nolimits_{i=1}^n \alpha_i x_i \right) + \beta\left( \sum\nolimits_{i=1}^n \beta_i x_i \right) \nonumber\\
& \ = \ \sum\limits_{i=1}^n \left( \alpha\alpha_i + \beta\beta_i \right) x_i,
\end{align*}
%If you would add an empty line here, this would start a new paragraph and thus cause indentation of the next line.
so that $\alpha x + \beta y \in \langle V \rangle$, where
\[ \delta_{ij} := \left\{ \begin{array}{cl}
1 & \text{if }i=j,\\
0 & \text{otherwise.}
\end{array}
\right. \]
Based on the above observation, we now formalize the phenomenon that deleting two different intervals from a given reference results in the same string.
Let $|S|$ be the length of a string $S$.
We denote deletions by intervals $[i,j]$, where $S\backslash[i,j]$ denote the string that results from removing all characters from (and including) position $i$ to (and including) $j$ from $S$.
As introduced by Wittler \textit{et al.}~\cite{WIT-MAN-PAT-STO-2011}, deleting different segments of a given string can yield the same result.
Such deletions are called \emph{equivalent}.
\begin{definition}[\cite{WIT-MAN-PAT-STO-2011}]\label{def:equivalent}
Deletions $[i,j]$ and $[i',j']$ are \emph{equivalent} w.r.t.\ a reference sequence~$S$, written $[i,j] \Leftrightarrow [i',j']$, if and only if $S \backslash [i,j] = S \backslash [i',j']$. We further define their \emph{shift} being $s\left([i,j],[i',j']\right) := |i'-i|$.
\end{definition}
Out of a set of equivalent deletions, we are especially interested in the leftmost and rightmost representative, formally defined as follows.
\begin{definition}[rightmost and leftmost shift]
Let $S$ be a reference string. Then the \emph{leftmost} and \emph{rightmost shift} of a deletion $[i,j]$ are defined as:
$L([i,j]) := $ \linebreak[4] $\argmin\left\{\, i' \mid [i',j']\Leftrightarrow[i,j] \right\}$ and
$R([i,j]) := $ $\argmax\left\{\, i' \mid [i',j']\Leftrightarrow[i,j] \right\}$, respectively.
\end{definition}
Our main result is that deciding the mC1P is tractable for a large
family of matrices with constraints on the maximum number of entries
$1$ in multicolumns a row can have.
\begin{theorem}\label{thm:main}
Let $M$ be a binary matrix and $\mu $ a multiplicity vector such
that \ldots. Deciding if $M$ has the mC1P
for $\mu $ can be done in polynomial time and space.
\end{theorem}
\begin{proof}
We split the proof into two parts. First we consider the case where
$M$ with multiplicity vector $\mu $ contains a single multicolumn. Then we show how to handle the general
case based on Eulerian
cycles.
\ldots
\end{proof}
\medskip
You can easily refer to equations, definitions, etc.\ like in the following example. Theorem~\ref{thm:main} is neither based on Definition~\ref{def:equivalent} nor on Equation~\eqref{eqn:vs}.
\section{An algorithm}
Algorithm~\ref{alg:hartigan} on page~\pageref{alg:hartigan} gives an example on pseudo code.
When explaining an algorithm in more detail or discussing its runtime, you can easily refer to individual lines, e.g. lines~\ref{line:root} or~\ref{line:node}.
\begin{algorithm}[ht]\DontPrintSemicolon%\SetLine
\caption{Fitch-Hartigan for Zero-One Instances}
\label{alg:hartigan}
%In- and output
\KwIn{A rooted tree $T=(V,E)$ with each leaf $l \in V$ labeled with $L(l) \subseteq \mathcal{C}$.}
\KwOut{A labeling $L$ with minimal Wagner parsimony weight $W(T,L)$.}
\ForEach{$c\in\mathcal{C}$}{
\tcc{Bottom-up phase}
\ForEach{leaf $l$}{
$VU(l)\longleftarrow\{L_c(l)\}$\;
$VL(l)\longleftarrow\emptyset$\;
}
\ForEach{unlabeled node $u$ whose children $v_1,\ldots,v_{l(u)}$ are labeled}{
\lFor{$b\in\{0,1\}$}{$k(b)\longleftarrow|\{v_i\mid b \in VU(v_i)\}|$}\;
$K\longleftarrow\max\{k(0),k(1)\}$\;
$VU(u)\longleftarrow\{b \mid k(b)=K\}$\;
$VL(u)\longleftarrow\{b \mid k(b)=K-1\}$\;
}
\tcc{Top-down refinement}
assign any $b \in VU(r)$ to the root node $r$: $L_c(r):=b$\;\label{line:root}
\ForEach{\label{line:node}unrefined node $v$ whose parent node $u$ is already refined to $L_c(u)=a$}{
refine the labeling of $v$ to $L_c(v)\longleftarrow b$, with any $b \in B(v,a)$:
$B(v,a):=\left\{\begin{array}{ll}
\{a\} & \text{if }a \in VU(v),\\
\{a\}\cup VU(v) & \text{if } a \in VL(v),\\
VU(v) & \text{otherwise.}
\end{array}\right.$
}
}
\KwRet{$L$}
\end{algorithm}
% This is how to add a bibliography using Bibtex. The entries that are cited using \cite{key} are listed in the specifyed format (here abbrv).
% The entries themselves are defined in a separate file (here "example.bib"). This file can contain more entries than used in the tex file.
% This way, a (larger) bib-file can be recycled for various documents.
\bibliographystyle{abbrv}
\bibliography{example}
% Finally, a small bu ver important line:
\end{document}
% Everything below \end{document} will be ignored.
For instance this line including this non-existing \command_x_y