lecture 1 - brunel university londonicsrsss/teaching/ma2730/latex/print8latex01.pdf · ma2730,...

5
Overview (MA2730,2812,2815) lecture 1 Lecture slides for MA2730 Analysis I Simon Shaw people.brunel.ac.uk/~icsrsss [email protected] College of Engineering, Design and Physical Sciences bicom & Materials and Manufacturing Research Institute Brunel University October 26, 2015 Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Contents of the teaching and assessment blocks MA2730: Analysis I Analysis — taming infinity Maclaurin and Taylor series. Sequences. Improper Integrals. Series. Convergence. L A T E X2 ε assignment in December. Question(s) in January class test. Question(s) in end of year exam. Web Page: http://people.brunel.ac.uk/ ~ icsrsss/teaching/ma2730 Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 MA2730 - L A T E X: topics for Lecture 1 Lecture 1 Starting a document, basic content, processing and viewing. Page formatting, document types, sectioning. In line and displayed Mathematics. Numbering, cross referencing. Lists. Bibliographies, referencing. Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 Study and Assessment Components Study Block: MA2870, Analysis I and L A T E X 3L A T E X lectures in weeks 7, 9, 11. 1 ‘writing maths’ lecture in week 12. 5 labs during weeks 8 — 12. Assessment Block: MA2812, Multivariable Mathematics L A T E X assignment (30% by volume) on analysis Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 What is L A T E X? It is a typesetting system based on T E X (techhh). T E X: designed by Donald Knuth for high quality maths. It is free (but you can pay for it). It is a mark up language. It is based on macros. It is extensively documented. It can be hard to use at times — persevere! It produces very high quality PDF output. Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 What L A T E X isn’t A wysiwig word processor like word. A ‘cut and paste’ environment. An easy environment for the novice. Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 These Lectures You can only really learn L A T E X by doing it. In these lectures I will show you how to accomplish all of the most important tasks in L A T E X. In this way I will create a document each week which you will then obtain and build upon in your lab sessions. It will be hard at first, but perseverance will pay off. For MA2812 you will obtain an assignment which will involve an element of L A T E X document preparation. Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 Let’s get started Right click on your desktop and make a new folder called latex. Go into this folder and make another called lab1. Later you can make other folders called. . . ‘lab2’, ‘lab3’ and lab4’. Go into the folder called ‘lab1’. This folder hierarchy is just a suggestion. L A T E X wont mind if you do it differently. Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel MA2730, Analysis I, 2015-16

Upload: others

Post on 01-Oct-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 1 - Brunel University Londonicsrsss/teaching/ma2730/latex/print8latex01.pdf · MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 Here's the WinEdt

Overview (MA2730,2812,2815) lecture 1

Lecture slides for MA2730 Analysis I

Simon Shawpeople.brunel.ac.uk/~icsrsss

[email protected]

College of Engineering, Design and Physical Sciencesbicom & Materials and Manufacturing Research InstituteBrunel University

October 26, 2015

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Contents of the teaching and assessment blocks

MA2730: Analysis I

Analysis — taming infinity

Maclaurin and Taylor series.

Sequences.

Improper Integrals.

Series.

Convergence.

LATEX2ε assignment in December.

Question(s) in January class test.

Question(s) in end of year exam.

Web Page:http://people.brunel.ac.uk/~icsrsss/teaching/ma2730

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

MA2730 - LATEX: topics for Lecture 1

Lecture 1

Starting a document, basic content, processing and viewing.

Page formatting, document types, sectioning.

In line and displayed Mathematics. Numbering, crossreferencing.

Lists. Bibliographies, referencing.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Study and Assessment Components

Study Block: MA2870, Analysis I and LATEX

3 LATEX lectures in weeks 7, 9, 11.

1 ‘writing maths’ lecture in week 12.

5 labs during weeks 8 — 12.

Assessment Block: MA2812, Multivariable Mathematics

LATEX assignment (30% by volume) on analysis

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

What is LATEX?

It is a typesetting system based on TEX (techhh).

TEX: designed by Donald Knuth for high quality maths.

It is free (but you can pay for it).

It is a mark up language.

It is based on macros.

It is extensively documented.

It can be hard to use at times — persevere!

It produces very high quality PDF output.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

What LATEX isn’t

A wysiwig word processor like word.

A ‘cut and paste’ environment.

An easy environment for the novice.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

These Lectures

You can only really learn LATEX by doing it.

In these lectures I will show you how to accomplish all of the mostimportant tasks in LATEX.

In this way I will create a document each week which you will thenobtain and build upon in your lab sessions.

It will be hard at first, but perseverance will pay off.

For MA2812 you will obtain an assignment which will involve anelement of LATEX document preparation.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Let’s get started

Right click on your desktop and make a new folder called latex.

Go into this folder and make another called lab1.

Later you can make other folders called. . . ‘lab2’, ‘lab3’ and‘lab4’.

Go into the folder called ‘lab1’.

This folder hierarchy is just a suggestion. LATEX wont mind if youdo it differently.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Page 2: Lecture 1 - Brunel University Londonicsrsss/teaching/ma2730/latex/print8latex01.pdf · MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 Here's the WinEdt

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Inside the folder lab1 we are going to make a new LATEX source filecalled lab1.tex.

You’ll be able to save your own version of this file into this folderfrom BBL once we have finished this session and I have uploaded it.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Open this LATEX file with WinEdt1.Type in the following:

\documentclass[12pt]{article}

\begin{document}

Hello, \LaTeX\ is in the house!

\end{document}

Now click the LATEX toolbar item to compile this source code.Then click the nearby dvi icon to view the document on screen,and click the dvi-pdf icon to get a PDF version of your document.

1This editor costs money, but there are free alternatives if you want LATEXon your own computer.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Here’s the WinEdt toolbar

This is version 5.5 — newer versions may look different.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Here’s the WinEdt toolbar

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Click LATEX to compile your source code

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Click dvi →֒ pdf to generate PDF

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Click the Adobe Acrobat icon to view the PDF

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Let’s discuss

\documentclass[12pt]{article}

\begin{document}

Hello, \LaTeX\ is in the house!

\end{document}

The backslash is used to start a command or macro.

We have initialised a document of type article. There areothers, but this is most useful.

We have set the font size at 12 point. The other possibilitiesare 11 point (pretty good) or 10 point (too small).

Our document content occurs between \begin{document}and \end{document}

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Page 3: Lecture 1 - Brunel University Londonicsrsss/teaching/ma2730/latex/print8latex01.pdf · MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 Here's the WinEdt

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Adding structure

\documentclass[12pt]{article}

% some useful packages - well learn more about this

\usepackage{latexsym,amssymb,amsmath,amsfonts}

\begin{document}

\title{\LaTeX\ Lab 1: this is where the title goes}

\author{Simon Shaw} \date{\today}

\maketitle % this command tells latex to create the title.

% a percentage starts a comment.

% Everything to the right is ignored.

\section{Introduction to lab 1}\label{sec:intro-lab1}

We now have a \LaTeXe\ document with a title, an author and

date. We also have our first section with this paragraph.

And a new paragraph --- \textbf{created with a blank line!}

\end{document}

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Again, we see that the backslash is used extensively to startcommands.

We used the \title{...} and \author{...} macros to setup the document’s name and author.

We used the \date{...} macro with the argument \todayto insert the correct date.

We inserted comments into the source file by entering textafter the % character. The comment lasts until the end of theline.

We used the \section{...} macros to create a section andgive it a title. And we gave that section a label with the\label{...} command.

We created two paragraphs simply by separating our test witha blank line.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Any questions or comments?

Let’s move away from this presentation for a while now and workdirectly with the LATEX document.

By the way, it’s actually LATEX2ε. There’s also a LATEX3, but itisn’t used widely (yet?).

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Mathematics

It is time to look at creating some maths — that’s really whyLATEX was invented. Let’s add this to our lab source file.

\section{Starting with maths}\label{sec:start-maths}

Some famous trigonometric identities relating

$\sin\theta$, $\cos\theta$ and $\tan\theta$ are,

\[

\sin^2\theta + \cos^2\theta = 1,

\qquad

\tan^2\theta + 1 = \sec^2\theta

\quad\mbox{and}\quad

1 + \cot^2\theta = \csc^2\theta.

\]

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Lots of things to learn there. . .

We can see that we placed maths in the text between dollarsigns: So sin θ was produced by typing \sin\theta.

Displayed math was created between \[ and \]

We used \qquad to get a long space and \quad to get a shortone.

We wrote text in the display with \mbox{and}.

But we didn’t get an equation number!

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

If we don’t want an equation number then \[ and \] work justfine. Otherwise we need to use the equation environment like this:

The first identity in \eqref{eq:basic-trig-ids} below

\begin{equation}

\sin^2\theta + \cos^2\theta = 1,

\qquad \tan^2\theta + 1 = \sec^2\theta

\quad\mbox{and}\quad 1 + \cot^2\theta = \csc^2\theta.

\label{eq:basic-trig-ids} \end{equation}

follows by taking $A=\theta$ and $B=\theta$

in the addition formula

\begin{equation}

\cos(A-B) = \cos(A)\cos(B) + \sin(A)\sin(B)

\label{eq:cosA-B}\end{equation}

Other versions of \eqref{eq:cosA-B} lead to other identities.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Now we’re really getting somewhere. . .

We can create a document with a title, author and date.

We can structure it into sections and subsections.

We can use the \label{...} macro to give our sectionsnames and reference those names with the \ref{...} macroto get the section number.

We can use $...$ to place small amounts of maths in linewith our prose.

We can use \[ and \] to display equations without numbersor use the equation environment with \begin and \end toget numbered displays.

We can use the \label{...} macro to give our equationsnames and reference those names with the \eqref{...}macro to get the equation number.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

LATEX preamble

It is possible to insert a good deal of so-called preamble in betweenthe \documentclass{...} and \begin{document} commands.For example, control the page size, and its position on the paper.

% these are useful page formatting commands

\setlength{\textwidth}{16.0cm} % set the width of the text

\setlength{\textheight}{25.0cm} % set the height of the text

\setlength{\topmargin}{-1.0cm} % text to top of paper

\setlength{\oddsidemargin}{-0.5cm} % left margin on odd pages

\setlength{\evensidemargin}{0cm} % left margin on even pages

\setlength{\parskip}{1ex} % space between paragraphs

\setlength{\parindent}{0em} % indentation for paragraphs

\renewcommand{\baselinestretch}{1.2}% set the inter-line spacing

\overfullrule=1cm % 1cm wide bar if line too long

(You’ll need the twoside option to \documentclass forodd/even paged output.)

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Page 4: Lecture 1 - Brunel University Londonicsrsss/teaching/ma2730/latex/print8latex01.pdf · MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 Here's the WinEdt

Overview (MA2730,2812,2815) lecture 1

Lecture 1

LATEX packages

The success of LATEX is due in no small measure to the number ofextras and add-in’s that exist.

These are loaded in as packages. For example:

% some useful packages - we’ll learn more about this

\usepackage{latexsym,amssymb,amsmath,amsfonts}

These load in packages that give us access to a much wider rangeof mathematical symbols than standard LATEX provides. more onthat next week.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Lists

We’ll spend a great deal more time on using LATEX to typeset highquality maths over the next two weeks.

Today though we are going to finish up with two more essentialingredients for written documents.

Lists, and bibliographies.

We’ll start with bibliographies.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Bibliographies

It is extremely important to always cite your sources. For this youneed to be able to create a bibliography. Paste the following in toyour file immediately before the \end{document} at the end ofthe file

\begin{thebibliography}{999}

\bibitem{NJHigham} Nicholas J.~Higham.

\textit{Handbook of writing for the mathematical sciences}.

SIAM, 1998.

\bibitem{LamportLaTeXbook} Leslie Lamport.

\textit{\LaTeX~User’s Guide \& Reference Manual}.

Addison-Wesley Publishing Company, 1986.

\end{thebibliography}

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Now include the following line somewhere near the beginning.

Also, although aimed at \LaTeXe\ users,

the book \cite{NJHigham} contains a lot of helpful tips on how

to write mathematical text. The original \LaTeX\ book,

\cite{LamportLaTeXbook}, was written by Leslie Lamport.

Run LATEX twice and you will have a bibliography at the end of thedocument, and correct referencing to the items in thatbibliography in the text!

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Kopka and Daly

I learned most of my LATEX from a classic book:

\bibitem{KopkaDaly}

Helmut Kopka and Patrick W.~Daly.

\textit{A Guide to \LaTeXe.

Document preparation for beginners and advanced users}.

Addison Wesley, 1995", second edition.

But there is a new edition of this, and many many other booksavailable now.

Add that bibitem to your file and you can reference the book inyour text with the \cite{KopkaDaly} command

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

LATEX resources

But you don’t need to buy a book. . .

There is a huge amount of information on LATEX out there on theweb. For example:

http://latex-project.org/guides/

http://en.wikibooks.org/wiki/LaTeX

https://tobi.oetiker.ch/lshort/lshort.pdf

https://www.writelatex.com/blog/7-free-online-introduction-to-latex-course-part-1#

http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:Symbols

http://web.ift.uib.no/Teori/KURS/WRK/TeX/symALL.html

That’s not a attractive list. Let’s see how to do better. . .

We’ll use a \newpage command to start our next section on a newpage.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

The following LATEX mark-up will produce a bullet pointed list.

The good things about studying maths are:

\begin{itemize}

\item Doing lots of maths.

\item Getting lots of coursework.

\item Sitting lots of exams.

\item \ldots\ Can you see how to create a bulleted list?

\end{itemize}

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

To get a numbered list, try the following:

The bad things about studying maths are:

\begin{enumerate}

\item Not doing enough maths in the evenings and weekends.

\item Not getting enough coursework.

\item Too few exams.

\item \ldots\ Can you see how to create a numbered list?

\end{enumerate}

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Page 5: Lecture 1 - Brunel University Londonicsrsss/teaching/ma2730/latex/print8latex01.pdf · MA2730, Analysis I, 2015-16 Overview (MA2730,2812,2815) lecture 1 Lecture 1 Here's the WinEdt

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Last, a descriptive list:

The ugly aspects of a maths degree are:

\begin{description}

\item[Short lectures.] It would be much better if we could

start maths at 7:30am and continue learning it until 9pm,

seven days a week.

\item[Thin textbooks.] Each book should be at least

one thousand pages long.

\item[OK?] \ldots\ Can you see how to create a descriptive list?

\end{description}

Note that blank lines have no effect in these list environments.They just make the source file more readable.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Lists within lists. . .

You can even put lists inside of lists. . .

You can even put lists inside of lists\ldots

\begin{description}

\item[Calculus:] One easy and one hard thing:

\begin{enumerate}

\item Differentiation \item Integration

\end{enumerate}

\item[Algebra:] One good thing and one excellent thing!

\begin{itemize}

\item Complex numbers \item Gauss-Jordan elimination

\end{itemize}

\end{description}

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

Lecture 1

Next Week. . .

Lots of mathematics!

AndSome FoNt Selection commands.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16

Overview (MA2730,2812,2815) lecture 1

End of Lecture

Computational andαpplie∂ Mathematics

Lab session

In the first lab session you will create a LATEX document that setsout the things you like most about studying maths, and the thingsyou like least.You’ll also practice producing mathematical copy by creating someMaclaurin series.

Shaw bicom, mathematics, CEDPS, IMM, CI, Brunel

MA2730, Analysis I, 2015-16