Initial version.
[latex-intro] / example.tex
1 \documentclass[a4paper]{article}
2 \usepackage{amssymb}
3 \usepackage[T1]{fontenc}
4 \usepackage[british]{babel}
5 \usepackage{hyperref}
6 \usepackage[utf8]{inputenc}
7
8 \renewcommand{\rmdefault}{ppl}
9 \renewcommand{\sfdefault}{phv}
10 \renewcommand{\ttdefault}{pcr}
11
12 \newcommand{\dd}[1]{\mathrm{d}#1}
13 \newcommand{\res}{\mathop{\mathrm{res}}\nolimits}
14 \newcommand{\punct}[1]{\,\textrm{#1}}
15
16 \title{An example document}
17 \author{Mark Wooding}
18
19 \begin{document}
20 \maketitle
21
22 \begin{abstract}
23 This is a simple example of a \LaTeX\ document, demonstrating some
24 important features.
25 \end{abstract}
26
27 \tableofcontents
28
29 \section{An initial section} \label{sec:init}
30
31 This is an initial paragraph
32 which doesn't look as though it merits careful attention.
33 In fact, however, it demonstrates a few features
34 which aren't immediately obvious.
35
36 This is a second paragraph,
37 which is separated from the first by a blank line.
38 No explicit markup was required.
39 More interesting things will happen in Section~\ref{sec:next}.
40
41 \section{A subsequent section} \label{sec:next}
42
43 This is another section. There was a cross-reference from
44 Section~\ref{sec:init}.
45
46 \subsection{Lists and suchlike}
47
48 \begin{itemize}
49 \item We can typeset lists of things.
50 \begin{itemize}
51 \item We can nest lists.
52 \item Four levels are usually allowed
53 before \LaTeX\ runs out of bullet symbols.
54 \end{itemize}
55 \item
56 \begin{enumerate}
57 \item We can also have lists with numbered entries.
58 \item This emphasizes that their ordering is relevant.
59 \item \label{en:item} It also allows us to refer to items later.
60 \item \begin{enumerate}
61 \item These lists can also be nested.
62 \item A nested list can form the entirety of a list item.
63 \end{enumerate}
64 \end{enumerate}
65 \item We can \emph{emphasize} words.
66 \item We can set words in \textbf{boldface}.
67 \item We can switch to \textsf{sans-serif}
68 or \texttt{monospace} typefaces.
69 \item If I don't refer to item~\ref{en:item} above
70 then it would have been pointless to have labelled it.
71 \end{itemize}
72
73 See Table~\ref{tab:example} for an example table.
74 (Notice how it's ended up at the top of the page,
75 above this text which precedes the table in the source code.
76 Also observe that there's insufficient vertical space
77 around the horizontal rules.)
78
79 \begin{table}
80 \centering
81 \begin{tabular}{lcr} \hline
82 \textbf{Left} & \textbf{Centre} & \textbf{Right} \\ \hline
83 Left-aligned & Mid! & Right-aligned \\
84 Stuff & \multicolumn{2}{r}{spanning two columns} \\
85 More & random & nonsense \\ \hline
86 \end{tabular}
87 \caption{An example table which contains little information of value.}
88 \label{tab:example}
89 \end{table}
90
91 \subsection{Mathematics}
92
93 This is sort of the whole point.
94 Silverman~\cite[\textsection VI.2, p.~151]{silverman:curves}
95 deduces from the residue theorem that
96 \[ \sum_{w\in\mathbb{C}/\Lambda} \res_w(f)
97 = \frac{1}{2\pi i} \int_{\partial D} f(z) \,\dd{z} \punct{.} \]
98 Elsewhere, Lang~\cite[\textsection VIII.4, p.~516]{lang:algebra}
99 defines the \emph{Vandermonde determinant}
100 $V = V(x_1, \ldots, x_n)$ to be
101 \[ V = \left| \begin{array}{cccc}
102 1 & 1 & \cdots & 1 \\
103 x_1 & x_2 & \cdots & x_n \\
104 \vdots & \vdots & \ddots & \vdots \\
105 x^{n-1}_1 & x^{n-1}_2 & \cdots & x^{n-1}_n \\
106 \end{array} \right| \punct{.} \]
107
108 \begin{thebibliography}{99}
109 \bibitem{lang:algebra}
110 Lang, Serge,
111 \emph{Algebra, Revised Third Edition},
112 (Springer Verlag, 2005).
113 \bibitem{silverman:curves}
114 Silverman, Joseph H.,
115 \emph{The Arithmetic of Elliptic Curves},
116 (Springer Verlag, 1986).
117 \end{thebibliography}
118
119 \end{document}