\documentclass[11pt]{amsart} % documentclass with options
%%%%%%% PREAMBULUM
\usepackage[utf8]{inputenc}

\usepackage[pdftex,final]{hyperref}
\hypersetup{colorlinks=true,allcolors=blue}
\usepackage{amsmath} 
\usepackage{amsthm}

\theoremstyle{plain} %default
\newtheorem{theorem}{Theorem}[section]
\newtheorem*{theorem*}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}
%\newtheorem{proposition}{Proposition}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{problem}[theorem]{Open problem}
\newtheorem{corollary}[theorem]{Corollary}
%\newtheorem{corollary}{Corollary}[section]
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem*{example*}{Example}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{remarks}[theorem]{Remarks}


\title{My very first paper --- or homework to hand in}
\author{Joe Smith}
\date{September 7, 2028}

\begin{document}
\maketitle
\tableofcontents

\section{Introduction}
This paper is about nothing in particular. It's worth
reading\footnote{Actually, it's the \LaTeX\ source of it that is worth
reading, but never mind.}, nonetheless.

\section{Main results}\label{sec:mr}
Where do we begin? The main result of this paper is that it manages to show off some
of the most important capabilities of \LaTeX. In particular, we'll give examples of
\begin{enumerate}
\item enumerations (like this)
\item theorems, and
\item their proofs
\item cross references
\item footnotes
\end{enumerate}
The meat of this work is in section~\ref{sec:det}.


\section{The gory details}\label{sec:det}
Here comes our first result.
\begin{theorem}\label{thm:good} 
The multiplication of polynomials over a field is commutative.
\end{theorem}
\begin{proof}Follows from the fact that multiplication 
in any field is commutative.
\end{proof}


And a definition that is needed for our next one.
\begin{definition}\label{def:binprop}
  A binary relation $R$ on a set $A$ is
  \begin{enumerate}
    \item irreflexive if $(\forall x\in A) \lnot(xRx)$
  \item asymmetric if $(\forall x,y\in A) (xRy\implies
    \lnot(yRx))$
    \item anti-symmetric if $(\forall x,y\in A) (xRy\And
      yRx\implies x=y)$
  \end{enumerate}
\end{definition}
\begin{example*}
  $<$ on natural numbers is irreflexive and asymmetric. 
  $\leq$ on natural numbers is anti-symmetric.
\end{example*}

\begin{theorem}\label{thm:asymiff}
$R$ is asymmetric if and only if it is anti-symmetric and irreflexive.
\end{theorem}
\begin{proof}($\Rightarrow$) $R$ is irreflexive, because, by asymmetry,
  $xRx$ would imply $\lnot(xRx)$; and is anti-symmetric, because the
  condition $xRy\And yRx$ in the definition of anti-symmetry (see
  Definition~\ref{def:binprop}) never holds.\footnote{Non-breaking
  space alert!}

\noindent  ($\Leftarrow$) By anti-symmetry, $xRy\And yRx$ would imply
$x=y$ and hence $xRx$, contradicting irreflexivity.
\end{proof}

\begin{theorem}[Weirstrass]
  The image of a closed, bounded interval under a continuous function
  is bounded and has a smallest and a biggest element.
\end{theorem}
Let's see if this looks better without numbering (and with a little bit of snobbery):
\begin{theorem*}[Weirstra\ss]
  The image of a closed, bounded interval under a continuous function
  is bounded and has a smallest and a biggest element.
\end{theorem*}
This, together with Bolzano's theorem yields the following
\begin{corollary}
  The image of a closed, bounded interval under a continuous function
  is a closed bounded interval.
\end{corollary}

Time for a new, unnumbered section!
\section*{\protect\LaTeX{}nical miscellany}

As we know, \textbackslash{} is a special character, so we need to
write it here in a special way (by writing a command that produces
it). Fortunately, it's not used often in mathematical text. But when
it is, it's usually in a formula, such as this one: $A\backslash B$, and then
it's written in yet an other way.

If you're reading the source, which you should, you may have noticed
that I wrote \verb+\textbackslash{} is a...+ and not
\verb+\textbackslash is a...+. The reason is that if the command
\verb+\textbackslash+ is followed by a space (or a hundred spaces,
since that's equivalent to one), \LaTeX{} uses it to detect the end of
the command's name (if it's alphabetic), and {\em not as a space after
  the command\/}\footnote{This was an example of a block; if you don't
know \emph{what} was an example of a block, you're probably not
looking at the source. Why did italicizing stop where it did in the
body of the text?}. (Leave
out the \verb+{}+ and see what happens!) So we need to signal the end
of the name in some other way. \verb+{}+ is fine, because an opening
brace can never be part of the name of a command.

There is no such problem with commands that consist of a backslash
and exactly one non-letter. For example, ``the US \$ is stable'' is
written \verb+the US \$ is stable+. This is only logical, since there
is no need to terminate the name of these commands with a
non-alphabetic character.

Sometime one just doesn't know how to finish a sentence\dots. The
solution is to write \verb+\dots+ and not three dots, like
this... because it just doesn't look right.

\section{Tables}
First, a simple one: \begin{tabular} {| c | c || c |}
$p$ & $q$ & $p\land q$\\ \hline\hline
  0 & 0 & 0\\ \hline
  0 & 1 & 0\\ \hline
  1 & 0 & 0\\ \hline
  1 & 1 & 1\\ \hline
\end{tabular}\\
and another:
\begin{tabular}{|l|l|r|}
\hline
  What & Where & Price (\$) \\
\hline
  Apple       & Market     & 200 \\
  Tomato      & Supermarket      & 300 \\
  Carrot      & Grocery & 1200 \\
  The \TeX\ Book    & Bookstore & 13\,000 \\
\hline
\end{tabular}

\medskip

which I think looks better without the vertical lines:
\begin{tabular}{llr}
\hline
  What & Where & Price (\$) \\
\hline
  Apple       & Market     & 200 \\
  Tomato      & Supermarket      & 300 \\
  Carrot      & Grocery & 1200 \\
  The \TeX\ Book    & Bookstore & 13\,000 \\
\hline
\end{tabular}

\medskip

We don't usually want to put a table in the middle of a
paragraph. So we make it a {\em floating object\/} with the help of
the \texttt{table} environment,
\begin{table}[!h]
\begin{center}
\begin{tabular}{llr}
\hline
  What & Where & Price (\$) \\
\hline
  Apple       & Market     & 200 \\
  Tomato      & Supermarket      & 300 \\
  Carrot      & Grocery & 1200 \\
  The \TeX\ Book    & Bookstore & 13\,000 \\
\hline
\end{tabular}
\end{center}
\end{table}
and perhaps give it a name and a label, too, so we can refer to
Table~\ref{tab:1} from any part of our document.
\begin{table}[!h]
\caption{Shopping list}\label{tab:1}
\begin{center}
\begin{tabular}{llr}
\hline
  What & Where & Price (\$) \\
\hline
  Apple       & Market     & 200 \\
  Tomato      & Supermarket      & 300 \\
  Carrot      & Grocery & 1200 \\
  The \TeX\ Book    & Bookstore & 13\,000 \\
\hline
\end{tabular}
\end{center}
\end{table}
The downside of floating objects is that they \emph{really} float. We
don't know where on the page they will end up. But we can try to
control it with an optional argument to \texttt{table}.

Here's a fancy version:
\begin{table}[h]
\caption{Fancy table}\label{tab:fancy}
\begin{center}
\begin{tabular}{|l|l|r|}
\hline
  \multicolumn{2}{|c}{Shopping} & \multicolumn{1}{|c|}{Price} \\
  \hline
  What & Where & \$ \\
\hline
  Apple       & Market     & 200 \\
  Tomato      & Supermarket      & 300 \\
  Carrot      & Grocery & 1200 \\
  The \TeX\ Book    & Bookstore & 13\,000 \\
\hline
\end{tabular}
\end{center}
\end{table}


\begin{thebibliography}{9}
\bibitem{texbook} Donald E. Knuth, \textit{The \TeX book},
Addison-Wesley, Reading, 1984.
\bibitem{latexbook} Leslie Lamport, \textit{\LaTeX\ A Document
Preparation System}, 2nd ed. Addison-Wesley, 1994.
\bibitem{shortlatex} Tobias Oetiker \&al., \textit{The Not So Short Introduction to
      \LaTeXe}, \href{http://metodos.fam.cie.uva.es/~latex/bibliografia/lshort.pdf}{http://metodos.fam.cie.uva.es/~latex/bibliografia/lshort.pdf} 

\end{thebibliography}

\end{document}

