Research Methods: Typesetting with LaTeX Ian Morris (based on - - PowerPoint PPT Presentation

research methods typesetting with latex
SMART_READER_LITE
LIVE PREVIEW

Research Methods: Typesetting with LaTeX Ian Morris (based on - - PowerPoint PPT Presentation

Introduction Fundamentals Environments, packages and macros Mathematical symbols References Research Methods: Typesetting with LaTeX Ian Morris (based on earlier notes by Shu Sasaki) October 1, 2020 1 / 35 Introduction Fundamentals


slide-1
SLIDE 1

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Research Methods: Typesetting with LaTeX

Ian Morris (based on earlier notes by Shu Sasaki) October 1, 2020

1 / 35

slide-2
SLIDE 2

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Today’s topic:

This lecture introduces the basics of LaTeX typesetting.

2 / 35

slide-3
SLIDE 3

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Today’s topic:

This lecture introduces the basics of LaTeX typesetting. No knowledge of computer programming is assumed.

2 / 35

slide-4
SLIDE 4

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Today’s topic:

This lecture introduces the basics of LaTeX typesetting. No knowledge of computer programming is assumed. The aim of this lecture is just to get you started: you can learn all sorts of tricks as you start using LaTeX yourself.

2 / 35

slide-5
SLIDE 5

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Today’s topic:

This lecture introduces the basics of LaTeX typesetting. No knowledge of computer programming is assumed. The aim of this lecture is just to get you started: you can learn all sorts of tricks as you start using LaTeX yourself. The course materials for this week include an example document, example.tex, which contains examples of how to write various mathematical expressions. You can copy and adapt these in your

  • wn work, if you like.

2 / 35

slide-6
SLIDE 6

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some fundamentals

LaTeX is not a “WYSIWYG” document format like Microsoft Word, where the final document looks exactly the same as what is typed into the computer.

3 / 35

slide-7
SLIDE 7

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some fundamentals

LaTeX is not a “WYSIWYG” document format like Microsoft Word, where the final document looks exactly the same as what is typed into the computer. Rather, it is a markup language (like HTML): you create a source code file which instructs the computer about what the final document will contain. The source code has a .tex file extension.

3 / 35

slide-8
SLIDE 8

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some fundamentals

LaTeX is not a “WYSIWYG” document format like Microsoft Word, where the final document looks exactly the same as what is typed into the computer. Rather, it is a markup language (like HTML): you create a source code file which instructs the computer about what the final document will contain. The source code has a .tex file extension. This is then compiled to make a PDF or Postscript document.

3 / 35

slide-9
SLIDE 9

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some fundamentals

LaTeX is not a “WYSIWYG” document format like Microsoft Word, where the final document looks exactly the same as what is typed into the computer. Rather, it is a markup language (like HTML): you create a source code file which instructs the computer about what the final document will contain. The source code has a .tex file extension. This is then compiled to make a PDF or Postscript document. These days the editing and compiling are usually both done using a single piece of software, e.g. Overleaf (which runs in a web browser), TeXShop (Mac), TeXWorks (Windows).

3 / 35

slide-10
SLIDE 10

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some fundamentals

LaTeX is not a “WYSIWYG” document format like Microsoft Word, where the final document looks exactly the same as what is typed into the computer. Rather, it is a markup language (like HTML): you create a source code file which instructs the computer about what the final document will contain. The source code has a .tex file extension. This is then compiled to make a PDF or Postscript document. These days the editing and compiling are usually both done using a single piece of software, e.g. Overleaf (which runs in a web browser), TeXShop (Mac), TeXWorks (Windows). In the live session this week we will be using Overleaf.

3 / 35

slide-11
SLIDE 11

Introduction Fundamentals Environments, packages and macros Mathematical symbols References 4 / 35

slide-12
SLIDE 12

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some strengths of LaTeX:

It can make very complicated mathematical expressions appear very neatly and with little effort!

5 / 35

slide-13
SLIDE 13

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some strengths of LaTeX:

It can make very complicated mathematical expressions appear very neatly and with little effort! Internal and external references can be taken care of automatically: each equation can be given an internal label, and you can refer back to the equation using a LaTeX command. This means you don’t have to keep track of equation numbers yourself.

5 / 35

slide-14
SLIDE 14

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some strengths of LaTeX:

It can make very complicated mathematical expressions appear very neatly and with little effort! Internal and external references can be taken care of automatically: each equation can be given an internal label, and you can refer back to the equation using a LaTeX command. This means you don’t have to keep track of equation numbers yourself. Similarly bibliography references can be handled automatically.

5 / 35

slide-15
SLIDE 15

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Some strengths of LaTeX:

It can make very complicated mathematical expressions appear very neatly and with little effort! Internal and external references can be taken care of automatically: each equation can be given an internal label, and you can refer back to the equation using a LaTeX command. This means you don’t have to keep track of equation numbers yourself. Similarly bibliography references can be handled automatically. LaTeX makes its own decisions on page layout. Usually they are good decisions (but placement of large tables and diagrams can be problematic)

5 / 35

slide-16
SLIDE 16

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Source File

The source code file must contain at least these commands (in blue):

6 / 35

slide-17
SLIDE 17

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Source File

The source code file must contain at least these commands (in blue): \documentclass[11pt]{article} (Preamble) \begin{document} (Text) \end{document}

6 / 35

slide-18
SLIDE 18

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Source File

The source code file must contain at least these commands (in blue): \documentclass[11pt]{article} (Preamble) \begin{document} (Text) \end{document} Anything which follows \end{document} is ignored!

6 / 35

slide-19
SLIDE 19

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Source File

The source code file must contain at least these commands (in blue): \documentclass[11pt]{article} (Preamble) \begin{document} (Text) \end{document} Anything which follows \end{document} is ignored! Of course, you could vary the font size (10pt, 12pt et cetera) and

  • ther document classes may be useful, e.g.: beamer, amsart, thesis.

6 / 35

slide-20
SLIDE 20

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

The preamble

The title, author and date which appear at the front of the article go in the preamble:

7 / 35

slide-21
SLIDE 21

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

The preamble

The title, author and date which appear at the front of the article go in the preamble: \title{Modular elliptic curves and Fermat’s Last Theorem} \author{Andrew Wiles} \date{\today}.

7 / 35

slide-22
SLIDE 22

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

The preamble

The title, author and date which appear at the front of the article go in the preamble: \title{Modular elliptic curves and Fermat’s Last Theorem} \author{Andrew Wiles} \date{\today}. You will also need to put \maketitle immediately after \begin{document} in order to make the title actually appear.

7 / 35

slide-23
SLIDE 23

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Types of content

There are two basic kinds of content in a LaTeX document: text, and mathematical symbols. These are written in between \begin{document} and \end{document}.

8 / 35

slide-24
SLIDE 24

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Types of content

There are two basic kinds of content in a LaTeX document: text, and mathematical symbols. These are written in between \begin{document} and \end{document}. By default, material in the source code is turned into text in the final document. To write mathematics instead we must use $· · · $: anything occuring in between the two symbols will be interpreted as mathematics.

8 / 35

slide-25
SLIDE 25

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Types of content

There are two basic kinds of content in a LaTeX document: text, and mathematical symbols. These are written in between \begin{document} and \end{document}. By default, material in the source code is turned into text in the final document. To write mathematics instead we must use $· · · $: anything occuring in between the two symbols will be interpreted as mathematics. For example, if part of the source code reads:

8 / 35

slide-26
SLIDE 26

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Types of content

There are two basic kinds of content in a LaTeX document: text, and mathematical symbols. These are written in between \begin{document} and \end{document}. By default, material in the source code is turned into text in the final document. To write mathematics instead we must use $· · · $: anything occuring in between the two symbols will be interpreted as mathematics. For example, if part of the source code reads: The equation $x^n+y^n= z^n$ has no non-trivial integer solutions when $n\geq 3$,

8 / 35

slide-27
SLIDE 27

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Types of content

There are two basic kinds of content in a LaTeX document: text, and mathematical symbols. These are written in between \begin{document} and \end{document}. By default, material in the source code is turned into text in the final document. To write mathematics instead we must use $· · · $: anything occuring in between the two symbols will be interpreted as mathematics. For example, if part of the source code reads: The equation $x^n+y^n= z^n$ has no non-trivial integer solutions when $n\geq 3$, then this produces: The equation xn + yn = zn has no non-trivial integer solutions when n ≥ 3.

8 / 35

slide-28
SLIDE 28

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Text structure

You can create section, subsection, subsubsection, by writing \section{Whatever the title of the section is}, \subsection{ }, etc.

9 / 35

slide-29
SLIDE 29

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Text structure

You can create section, subsection, subsubsection, by writing \section{Whatever the title of the section is}, \subsection{ }, etc.

  • Exercise. Try:

\section{ }, \subsection{ }, \section{ } \section{ }, \section{ }, \subsection{ } and observe the difference.

9 / 35

slide-30
SLIDE 30

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Text fonts

Use \textbf{x}, \textit{x}, \textrm{x}, \textsf{x} etc. to create texts in different fonts.

10 / 35

slide-31
SLIDE 31

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Text fonts

Use \textbf{x}, \textit{x}, \textrm{x}, \textsf{x} etc. to create texts in different fonts. Use {\tiny x}, {\scriptsize x}, {\footnotesize x}, {\small x}, {\normalsize x}, {\large x}, {\Large x}, {\LARGE x}, {\huge x} and {\Huge x} to change size of texts.

10 / 35

slide-32
SLIDE 32

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Text fonts

Use \textbf{x}, \textit{x}, \textrm{x}, \textsf{x} etc. to create texts in different fonts. Use {\tiny x}, {\scriptsize x}, {\footnotesize x}, {\small x}, {\normalsize x}, {\large x}, {\Large x}, {\LARGE x}, {\huge x} and {\Huge x} to change size of texts. Use \emph{ · · · } to emphasise some text. Usually this will make the text between the brackets appear in italic, like this.

10 / 35

slide-33
SLIDE 33

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Accents, Greek letters, special characters

Accents: Example In text In mathematics â \^a \hat a ˇ a \v{a} \check a ã \ ∼a \tilde a á \ ´ a \acute a à \ ` a \grave a

  • a

\vec a

11 / 35

slide-34
SLIDE 34

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Accents, Greek letters, special characters

Accents: Example In text In mathematics â \^a \hat a ˇ a \v{a} \check a ã \ ∼a \tilde a á \ ´ a \acute a à \ ` a \grave a

  • a

\vec a Greek letters: \alpha, \beta, \gamma, . . . ; \Gamma, \Delta, . . .

11 / 35

slide-35
SLIDE 35

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Accents, Greek letters, special characters

Accents: Example In text In mathematics â \^a \hat a ˇ a \v{a} \check a ã \ ∼a \tilde a á \ ´ a \acute a à \ ` a \grave a

  • a

\vec a Greek letters: \alpha, \beta, \gamma, . . . ; \Gamma, \Delta, . . . Special characters: \ss, \ae, \flat, \sharp, . . .

11 / 35

slide-36
SLIDE 36

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Making lists:

\begin{itemize} \item . . . \end{itemize} produces a list with bullet points.

12 / 35

slide-37
SLIDE 37

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Making lists:

\begin{itemize} \item . . . \end{itemize} produces a list with bullet points. On the other hand, \begin{enumerate} \item . . . \end{enumerate} produces a list where each item is marked with a number.

12 / 35

slide-38
SLIDE 38

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Tables containing text

\begin{tabular}{ccc} stuff & goes & here\\ stuff & goes & here\\ stuff & goes & here \end{tabular} creates a (non-mathematical) 3-by-3 table.

13 / 35

slide-39
SLIDE 39

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Tables containing text

\begin{tabular}{ccc} stuff & goes & here\\ stuff & goes & here\\ stuff & goes & here \end{tabular} creates a (non-mathematical) 3-by-3 table. The special symbol & tells the computer when a column has ended; the special symbol \\ tells it when a row has ended. (Note that the last row ends automatically.)

13 / 35

slide-40
SLIDE 40

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Tables containing text

\begin{tabular}{ccc} stuff & goes & here\\ stuff & goes & here\\ stuff & goes & here \end{tabular} creates a (non-mathematical) 3-by-3 table. The special symbol & tells the computer when a column has ended; the special symbol \\ tells it when a row has ended. (Note that the last row ends automatically.) Here {ccc} tells the computer to expect three columns, each with the text positioned in the centre of the column. We could have chosen centre, left, or right.

13 / 35

slide-41
SLIDE 41

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Packages

LaTeX has a large inventory of commands, but new ones are being created all the time.

14 / 35

slide-42
SLIDE 42

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Packages

LaTeX has a large inventory of commands, but new ones are being created all the time. To add more commands to LaTeX you will need to add a package in the preamble, e.g.:

14 / 35

slide-43
SLIDE 43

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Packages

LaTeX has a large inventory of commands, but new ones are being created all the time. To add more commands to LaTeX you will need to add a package in the preamble, e.g.: \usepackage{amsmath}

14 / 35

slide-44
SLIDE 44

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Packages

LaTeX has a large inventory of commands, but new ones are being created all the time. To add more commands to LaTeX you will need to add a package in the preamble, e.g.: \usepackage{amsmath} Example: if you want to use non-Roman letters (Chinese, Cyrillic, Japanese etc) then you should expect to need a package which enables the relevant commands.

14 / 35

slide-45
SLIDE 45

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Packages

LaTeX has a large inventory of commands, but new ones are being created all the time. To add more commands to LaTeX you will need to add a package in the preamble, e.g.: \usepackage{amsmath} Example: if you want to use non-Roman letters (Chinese, Cyrillic, Japanese etc) then you should expect to need a package which enables the relevant commands. Some particularly useful packages: amsmath, amsfonts, amsthm, enumerate, graphicx. I will assume for the rest of the presentation that the first three of these packages are being used.

14 / 35

slide-46
SLIDE 46

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Macros

To reduce the amount of incessant typing, you can define your own shorter commands.

15 / 35

slide-47
SLIDE 47

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Macros

To reduce the amount of incessant typing, you can define your own shorter commands. For example, if I find it laborious to write \textbf{Q} every single time to produce Q, I’d write

15 / 35

slide-48
SLIDE 48

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Macros

To reduce the amount of incessant typing, you can define your own shorter commands. For example, if I find it laborious to write \textbf{Q} every single time to produce Q, I’d write \newcommand{\tbQ}{\textbf{Q}} in the preamble, and simply write \tbQ to produce Q.

15 / 35

slide-49
SLIDE 49

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Defining a new command can produce mathematical symbols. For example, I can define

16 / 35

slide-50
SLIDE 50

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Defining a new command can produce mathematical symbols. For example, I can define \newcommand{\mbbQ}{$\mathbb{Q}$}

16 / 35

slide-51
SLIDE 51

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Defining a new command can produce mathematical symbols. For example, I can define \newcommand{\mbbQ}{$\mathbb{Q}$} and write \mbbQ to produce Q. The advantage is that the command incorporates $· · · $ in itself.

16 / 35

slide-52
SLIDE 52

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Defining a new command can produce mathematical symbols. For example, I can define \newcommand{\mbbQ}{$\mathbb{Q}$} and write \mbbQ to produce Q. The advantage is that the command incorporates $· · · $ in itself. Note that to use the command \mathbb{Q} we need to load the amsfonts package.

16 / 35

slide-53
SLIDE 53

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Mathematical expressions

Mathematical formulas are made by combining commands for individual mathematical symbols:

17 / 35

slide-54
SLIDE 54

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Mathematical expressions

Mathematical formulas are made by combining commands for individual mathematical symbols: $ \zeta (s)=\sum_{n=1}^{\infty}\frac{1}{n^s} $

17 / 35

slide-55
SLIDE 55

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Mathematical expressions

Mathematical formulas are made by combining commands for individual mathematical symbols: $ \zeta (s)=\sum_{n=1}^{\infty}\frac{1}{n^s} $ This produces:

17 / 35

slide-56
SLIDE 56

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Mathematical expressions

Mathematical formulas are made by combining commands for individual mathematical symbols: $ \zeta (s)=\sum_{n=1}^{\infty}\frac{1}{n^s} $ This produces: ζ(s) =

  • n=1

1 ns .

17 / 35

slide-57
SLIDE 57

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Mathematical expressions

Mathematical formulas are made by combining commands for individual mathematical symbols: $ \zeta (s)=\sum_{n=1}^{\infty}\frac{1}{n^s} $ This produces: ζ(s) =

  • n=1

1 ns . The curly brackets above tell the computer to treat something as a single object. So for example, the brackets in {n=1} above make sure that the whole expression n = 1 goes below the sum. If they are omitted we get a mess:

17 / 35

slide-58
SLIDE 58

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Mathematical expressions

Mathematical formulas are made by combining commands for individual mathematical symbols: $ \zeta (s)=\sum_{n=1}^{\infty}\frac{1}{n^s} $ This produces: ζ(s) =

  • n=1

1 ns . The curly brackets above tell the computer to treat something as a single object. So for example, the brackets in {n=1} above make sure that the whole expression n = 1 goes below the sum. If they are omitted we get a mess: ζ(s) =

  • n

= 1∞ 1 ns .

17 / 35

slide-59
SLIDE 59

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To make a mathematical expression occur in the middle of some text, we use $ · · · $.

18 / 35

slide-60
SLIDE 60

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To make a mathematical expression occur in the middle of some text, we use $ · · · $. To make it appear on its own line, use $$ · · · $$ or \begin{equation} · · · \end{equation}.

18 / 35

slide-61
SLIDE 61

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To make a mathematical expression occur in the middle of some text, we use $ · · · $. To make it appear on its own line, use $$ · · · $$ or \begin{equation} · · · \end{equation}. Anything which appears inside the “equation” environment is treated by the computer as mathematics.

18 / 35

slide-62
SLIDE 62

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To make a mathematical expression occur in the middle of some text, we use $ · · · $. To make it appear on its own line, use $$ · · · $$ or \begin{equation} · · · \end{equation}. Anything which appears inside the “equation” environment is treated by the computer as mathematics. More advanced option: \begin{align} · · · \end{align} to produce a list of equations.

18 / 35

slide-63
SLIDE 63

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To make a mathematical expression occur in the middle of some text, we use $ · · · $. To make it appear on its own line, use $$ · · · $$ or \begin{equation} · · · \end{equation}. Anything which appears inside the “equation” environment is treated by the computer as mathematics. More advanced option: \begin{align} · · · \end{align} to produce a list of equations. Note that \begin{equation} and \begin{align} will produce an equation with an equation number at the end of each line. To supress this, use \begin{equation*} and \begin{align*} which produces numberless equations.

18 / 35

slide-64
SLIDE 64

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Arrays

Analogous to tabular in text, \begin{array}{ccc} x&x&x\\ x&x&x\\ x&x&x \end{array} creates a mathematical 3-by-3 table.

19 / 35

slide-65
SLIDE 65

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Arrays

Analogous to tabular in text, \begin{array}{ccc} x&x&x\\ x&x&x\\ x&x&x \end{array} creates a mathematical 3-by-3 table. Again, the symbol & tells the computer when a column has ended and the symbol \\ tells it when a row has ended.

19 / 35

slide-66
SLIDE 66

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Arrays

Analogous to tabular in text, \begin{array}{ccc} x&x&x\\ x&x&x\\ x&x&x \end{array} creates a mathematical 3-by-3 table. Again, the symbol & tells the computer when a column has ended and the symbol \\ tells it when a row has ended. The align environment behaves similarly: & marks the place where the equations are supposed to align with each other, and \\ marks the end of each line.

19 / 35

slide-67
SLIDE 67

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Aligned equations

Sometimes we want to write an equation which extends across several lines, for example: a

  • x + b

2a 2 − b2 4 + c = ax2 + bx + b2 4 − b2 4 + c = ax2 + bx + c.

20 / 35

slide-68
SLIDE 68

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Aligned equations

The source code for the previous example was: \begin{align*} a \left(x+\frac{b}{2a}\right)ˆ2 - \frac{bˆ2}{4} + c & = axˆ2 + bx + \frac{bˆ2}{4} - \frac{bˆ2}{4} + c \\ & = axˆ2 + bx + c. \end{align*}

21 / 35

slide-69
SLIDE 69

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Aligned equations

The source code for the previous example was: \begin{align*} a \left(x+\frac{b}{2a}\right)ˆ2 - \frac{bˆ2}{4} + c & = axˆ2 + bx + \frac{bˆ2}{4} - \frac{bˆ2}{4} + c \\ & = axˆ2 + bx + c. \end{align*} A more complicated expression. Some features:

21 / 35

slide-70
SLIDE 70

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Aligned equations

The source code for the previous example was: \begin{align*} a \left(x+\frac{b}{2a}\right)ˆ2 - \frac{bˆ2}{4} + c & = axˆ2 + bx + \frac{bˆ2}{4} - \frac{bˆ2}{4} + c \\ & = axˆ2 + bx + c. \end{align*} A more complicated expression. Some features: \frac{b}{2a} produces the fraction

b 2a

21 / 35

slide-71
SLIDE 71

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Aligned equations

The source code for the previous example was: \begin{align*} a \left(x+\frac{b}{2a}\right)ˆ2 - \frac{bˆ2}{4} + c & = axˆ2 + bx + \frac{bˆ2}{4} - \frac{bˆ2}{4} + c \\ & = axˆ2 + bx + c. \end{align*} A more complicated expression. Some features: \frac{b}{2a} produces the fraction

b 2a

\left( and \right) produce appropriate-sized brackets around whatever is in between them

21 / 35

slide-72
SLIDE 72

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Aligned equations

The source code for the previous example was: \begin{align*} a \left(x+\frac{b}{2a}\right)ˆ2 - \frac{bˆ2}{4} + c & = axˆ2 + bx + \frac{bˆ2}{4} - \frac{bˆ2}{4} + c \\ & = axˆ2 + bx + c. \end{align*} A more complicated expression. Some features: \frac{b}{2a} produces the fraction

b 2a

\left( and \right) produce appropriate-sized brackets around whatever is in between them The & signs align vertically (i.e. they make the = signs align vertically). Move them, and the vertical alignment will be different.

21 / 35

slide-73
SLIDE 73

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Matrices

Two basic ways to write matrices: using \array or using \pmatrix.

22 / 35

slide-74
SLIDE 74

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Matrices

Two basic ways to write matrices: using \array or using \pmatrix. \left( \begin{array}{cc} 2 & 1 \\ 1 & 0 \end{array} \right)

22 / 35

slide-75
SLIDE 75

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Matrices

Two basic ways to write matrices: using \array or using \pmatrix. \left( \begin{array}{cc} 2 & 1 \\ 1 & 0 \end{array} \right)

  • r

\begin{pmatrix} 2 & 1 \\ 1 & 0 \end{pmatrix}

22 / 35

slide-76
SLIDE 76

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Matrices

Two basic ways to write matrices: using \array or using \pmatrix. \left( \begin{array}{cc} 2 & 1 \\ 1 & 0 \end{array} \right)

  • r

\begin{pmatrix} 2 & 1 \\ 1 & 0 \end{pmatrix} Note that \pmatrix creates left and right brackets itself, but \array needs to be told to do this using \left( and \right). The former needs the amsmath package.

22 / 35

slide-77
SLIDE 77

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

A miscellany

TeX source code Result $\frac{a+b}{c+d}$

a+b c+d

$\sqrt{3+x}$ √3 + x $(a_{n_k})_{k=1}ˆ\infty$ (ank)∞

k=1

$\|A\|$ A $\det A$ det A $\sin\theta$ sin θ

23 / 35

slide-78
SLIDE 78

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Exercises

Use \prod_{ }^{ } and \frac{ }{ } to produce ζ(s) =

  • p

1 1 − p−s

24 / 35

slide-79
SLIDE 79

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Exercises

Use \prod_{ }^{ } and \frac{ }{ } to produce ζ(s) =

  • p

1 1 − p−s Use \leq and \int_{ }^{ } (and \infty) to write: for any ǫ > 0,

  • n=1

|n−s| ≤ 1 + ∞

1

x−(1+ǫ)dx < ∞ provided Re(s) ≥ 1 + ǫ.

24 / 35

slide-80
SLIDE 80

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Exercises

Using $$\begin{array} · · · \end{array}$$, \xarrow where x∈{left, right, up, down}, draw 1 → 2 ↑ ↓ 4 ← 3

25 / 35

slide-81
SLIDE 81

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Bibliographies: by hand

There is one direct way of creating the references:

26 / 35

slide-82
SLIDE 82

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Bibliographies: by hand

There is one direct way of creating the references: add \begin{thebibliography}{99} . . . \bibitem{FLT} A. Wiles, \emph{Modular elliptic curves and Fermat’s Last Theorem}, ... . . . \end{thebibliography}

26 / 35

slide-83
SLIDE 83

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Bibliographies: by hand

There is one direct way of creating the references: add \begin{thebibliography}{99} . . . \bibitem{FLT} A. Wiles, \emph{Modular elliptic curves and Fermat’s Last Theorem}, ... . . . \end{thebibliography} immediately before \end{document} but after everything else.

26 / 35

slide-84
SLIDE 84

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Bibliographies: by hand

There is one direct way of creating the references: add \begin{thebibliography}{99} . . . \bibitem{FLT} A. Wiles, \emph{Modular elliptic curves and Fermat’s Last Theorem}, ... . . . \end{thebibliography} immediately before \end{document} but after everything else. Here ‘FLT’ is a name I have decided to call the paper. To cite it in the text, write \cite{FLT}. The number, e.g. [n], corresponding to the order (n-th) of the reference appears instead.

26 / 35

slide-85
SLIDE 85

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Bibliographies: using BibTeX

Referencing can also be automated. This requires you to create a separate .bib file (e.g. reference.bib) which consists entirely of entries like this:

27 / 35

slide-86
SLIDE 86

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Bibliographies: using BibTeX

Referencing can also be automated. This requires you to create a separate .bib file (e.g. reference.bib) which consists entirely of entries like this: @article {Da44, AUTHOR = {Dalzell, D. P.}, TITLE = {On {$22/7$}}, JOURNAL = {J. London Math. Soc.}, VOLUME = {19}, YEAR = {1944}, PAGES = {133–134}, }

27 / 35

slide-87
SLIDE 87

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Advantage: you do not have to write these yourself! You can just download them from e.g. MathSciNet, MRLookUp, Zentralblatt Math.

28 / 35

slide-88
SLIDE 88

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Advantage: you do not have to write these yourself! You can just download them from e.g. MathSciNet, MRLookUp, Zentralblatt Math.

28 / 35

slide-89
SLIDE 89

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To instruct the computer to use the BibTeX file, add in the main source file, just before \end{document}:

29 / 35

slide-90
SLIDE 90

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To instruct the computer to use the BibTeX file, add in the main source file, just before \end{document}: \bibliographystyle{plain} \bibliography{reference}

29 / 35

slide-91
SLIDE 91

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To instruct the computer to use the BibTeX file, add in the main source file, just before \end{document}: \bibliographystyle{plain} \bibliography{reference} instead of the commands which we mentioned three slides ago. Now you can use \cite{Da44} to cite the article. (This may require you to compile the document twice before it works correctly.)

29 / 35

slide-92
SLIDE 92

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

To instruct the computer to use the BibTeX file, add in the main source file, just before \end{document}: \bibliographystyle{plain} \bibliography{reference} instead of the commands which we mentioned three slides ago. Now you can use \cite{Da44} to cite the article. (This may require you to compile the document twice before it works correctly.) This saves effort versus writing all the bibliography entries by hand. You can change the appearance by using different bibliography styles: acm, siam, etc.

29 / 35

slide-93
SLIDE 93

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Theorem numbering, internal reference

In the preamble, if we write \newtheorem{prop}{Proposition}, this allows us to use the command \begin{prop} · · · \end{prop} to create a header titled “Proposition” which we can use to state propositions in our document.

30 / 35

slide-94
SLIDE 94

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Theorem numbering, internal reference

In the preamble, if we write \newtheorem{prop}{Proposition}, this allows us to use the command \begin{prop} · · · \end{prop} to create a header titled “Proposition” which we can use to state propositions in our document. Similarly we could write: \newtheorem{theorem}{Theorem}, for example and use it by the command \begin{theorem} · · · \end{theorem}.

30 / 35

slide-95
SLIDE 95

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

By default, theorems and propositions will use different numbers: we would get Proposition 1, Theorem 1, Theorem 2, Proposition

  • 2. . .

31 / 35

slide-96
SLIDE 96

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

By default, theorems and propositions will use different numbers: we would get Proposition 1, Theorem 1, Theorem 2, Proposition

  • 2. . .

If we wanted them to share a numbering system (e.g. Proposition 1, Theorem 2, Theorem 3, Proposition 4) we could write:

31 / 35

slide-97
SLIDE 97

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

By default, theorems and propositions will use different numbers: we would get Proposition 1, Theorem 1, Theorem 2, Proposition

  • 2. . .

If we wanted them to share a numbering system (e.g. Proposition 1, Theorem 2, Theorem 3, Proposition 4) we could write: \newtheorem{prop}{Proposition}, \newtheorem{theorem}[proposition]{Theorem}, in the preamble instead.

31 / 35

slide-98
SLIDE 98

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Suppose we have Theorem All semi-stable elliptic curves over Q are modular.

32 / 35

slide-99
SLIDE 99

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Suppose we have Theorem All semi-stable elliptic curves over Q are modular. This is given by: \begin{theorem} All semi-stable elliptic curve over $\mathbb{Q}$ are modular. \end{theorem}

32 / 35

slide-100
SLIDE 100

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

In case I have to refer to the theorem multiple times in the text, it is very useful to have a system that deals with changes I make.

33 / 35

slide-101
SLIDE 101

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

In case I have to refer to the theorem multiple times in the text, it is very useful to have a system that deals with changes I make. ‘label’ the theorem by \label{ } a name I find it easy to remember–write \label{ssST} for example.

33 / 35

slide-102
SLIDE 102

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

In case I have to refer to the theorem multiple times in the text, it is very useful to have a system that deals with changes I make. ‘label’ the theorem by \label{ } a name I find it easy to remember–write \label{ssST} for example. use the command \ref{ } to create the ‘number’, given to the theorem–for example, ‘It follows from Theorem ∼\ref{ssST} that Fermat’s Last Theorem holds!’.

33 / 35

slide-103
SLIDE 103

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

In case I have to refer to the theorem multiple times in the text, it is very useful to have a system that deals with changes I make. ‘label’ the theorem by \label{ } a name I find it easy to remember–write \label{ssST} for example. use the command \ref{ } to create the ‘number’, given to the theorem–for example, ‘It follows from Theorem ∼\ref{ssST} that Fermat’s Last Theorem holds!’. This can be done with displayed and aligned equations as well as theorems: see the example file.

33 / 35

slide-104
SLIDE 104

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Resources

Additional course materials:

34 / 35

slide-105
SLIDE 105

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Resources

Additional course materials: examples.tex – contains source code for some examples of equations, aligned equations, diagrams, propositions, proofs, tables etc

34 / 35

slide-106
SLIDE 106

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Resources

Additional course materials: examples.tex – contains source code for some examples of equations, aligned equations, diagrams, propositions, proofs, tables etc exercises.pdf – some mathematical expressions for you to attempt to write using LaTeX.

34 / 35

slide-107
SLIDE 107

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Resources

Additional course materials: examples.tex – contains source code for some examples of equations, aligned equations, diagrams, propositions, proofs, tables etc exercises.pdf – some mathematical expressions for you to attempt to write using LaTeX. A very comprehensive and reputable free textbook: A (Not So) Short Introduction to LaTeX2ǫ

34 / 35

slide-108
SLIDE 108

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Resources

Additional course materials: examples.tex – contains source code for some examples of equations, aligned equations, diagrams, propositions, proofs, tables etc exercises.pdf – some mathematical expressions for you to attempt to write using LaTeX. A very comprehensive and reputable free textbook: A (Not So) Short Introduction to LaTeX2ǫ A recommended internet forum: tex.stackexchange.com

34 / 35

slide-109
SLIDE 109

Introduction Fundamentals Environments, packages and macros Mathematical symbols References

Thanks for listening!

35 / 35