\documentclass[11pt]{article}

% Edit the following to change the title, author name and date
\title{\LaTeX{} practical}
\author{Clive Newstead}
\date{Wednesday 16th January 2019}

% Packages
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{hyperref}

% Page setup
\setlength{\parskip}{10pt}
\setlength{\parindent}{0pt}
\geometry{
    paper={letterpaper},
    marginratio={1:1},
    margin={1.25in}
}

% Theorem environments
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}

\begin{document}
\maketitle

By default, \LaTeX{} is in `text mode' which is used for inputting plain English text. Text mode is used for typing pretty much anything that isn't mathematics.
Single new lines are ignored by \LaTeX{}.

Leaving a blank line starts a new paragraph. Avoid starting a new line using \\
double backslash or the \newline command.

To start a new section, use the section command:

\section{Basic formatting}

Text can be made \textbf{bold} or \textit{italic} or \underline{underlined} or \texttt{monospace} or \textsf{sans-serif}.

By default text is aligned to the left and justified.

\begin{center}
It can be aligned to the centre.
\end{center}

\begin{flushright}
It can also be aligned to the right.
\end{flushright}

\section{Mathematics}

Math mode is used to type mathematical symbols.

The simplest way of entering math mode is by typing a dollar sign. You can type another dollar sign to exit math mode. For example, $a^2 + b^2 = c^2$. This is not in math mode: a+b=c.

\begin{center}
\Huge
\textbf{\underline{All} mathematical notation and variables should be typed using math mode!}
\end{center}

Another way of entering math mode is using double dollar signs (and double dollar signs are used to exit again). For example
$$ ab + bc + ca \le \sqrt{a^2 + b^2 + c^2} $$

Using math mode, we can type:

\begin{itemize}
\item Logical operators: $p \wedge q$, $p \vee q$, $p \Rightarrow q$ (not $p \rightarrow q$), $p \Leftrightarrow q$, $\neg p$ (not $\not p$)
\item Quantifiers: $\forall x \in X$ and $\exists x \in X$
\item Number sets: $\mathbb{N}$, $\mathbb{Z}$
\end{itemize}

For example,
$$ \forall a, b \in \mathbb{R},\, a \le b \Rightarrow \exists c \in \mathbb{R},\, b = a + c^2 $$

By default math mode ignores spaces:
$ab c  d   e$
but you can force spaces using various commands:
$a b \, c \; d \ e \quad f \qquad g$

You can also enter text mode from within math mode using the text command:
$$a^2 \ge 0 \ \text{for all} \ a \in \mathbb{R}$$

Enumeration is handled automatically:

\begin{enumerate}[(1)]
\item Variables
\item Quantifiers
\item Logical formulae
\item Apples
\item Oranges
\item Pomegranates
\item Guinea pigs
\end{enumerate}

\section{Aligned equations}

Sometimes there are just too many $=$ signs to keep track of. For example:

$$(n+1)! - (n-1)!
= (n+1) n (n-1)! - (n-1)!
= [(n+1) n - 1] (n-1)!
= [n^2 + n - 1] (n-1)!
\ne -17 = 0 - 1 - 2 - 3 - 4 - 5 - 2$$

We can remedy this using the \texttt{align*} environment.

\begin{align*}
(n+1)! - (n-1)!
& = (n+1) n (n-1)! - (n-1)!
  && \text{by definition of factorials} \\
& = [(n+1) n - 1] (n-1)! && \text{collecting common factor} \\
& = [n^2 + n - 1] (n-1)! && \text{expanding}
\end{align*}

One last thing: $x^1000$ is bad, but $x^{1000}$ is good.

\end{document}

