MPS115/MPS116 PRESENTATION LAB 5
Start a new document in your preferred editor, using the default preamble on the module webpage or one from a recent document. Make sure you include the AMS packages, as usual.
Here we look at how to cite books or internet pages. Citations are important for attributing results to the people who did them and allowing the reader to check material themselves. Citations should appear naturally in the text. Here are some examples.
The citations refer to entries in the bibliography at the end of this lab-sheet. Have a look.
Notice that the reference to the website in the bibliography in this document contains both the date it was visited and the date it was updated. This is to allow the reader to check out the exact pages that you are referring to.
Let’s create a bibliography to cite from.
\end{document} command.
\begin{thebibliography}{99}
\bibitem{Lessing:Notebook}
D.~Lessing,
\emph{The Golden Notebook},
HarperCollins Publishers, 2012.
\end{thebibliography}
books with books~\cite{Lessing:Notebook}. Process your document
twice and check that the citation has appeared. If you are using the
hyperref package then your citation markers should be clickable
links.Note that the 99 just informs LaTeX of the widest number it is expecting for the
citation label; you do not need to worry about it, it is not doing anything
interesting.
\bibitems. Process the document twice.It is good style to use the citation markers like footnote markers and not as a grammatical part of the sentence. So good style would be “If you look at Mirzakhani’s Wikipedia article [3] then…”; by contrast, bad style would be “If you look at [3] then…”.
You can refer to a specific part of the reference by using an optional parameter in
square brackets in the \cite command. For instance “Wiles was the person who
proved Fermat’s Last Theorem [4, Theorem 2.1].” is obtained with the following
code.
Wiles was the person who proved Fermat’s Last
Theorem~\cite[Theorem~2.1]{Wiles:fermats-theorem}.
Use this feature to add a reference to a specific page or chapter of your book.
Creating tables with LaTeX is straightforward, and uses the tabular
environment. Create a section called ‘Tables’, try the following. Note that the
{llr} bit consists of lowercase ‘L’s and ‘R’s as it stands for ‘left left right’, as
you will see.
\begin{center}
\begin{tabular}{llr}
\hline
Name & Location & Height (m)\\
\hline
Arts Tower & Bolsover Street & 78\\
St.~Georges Church & Broad Lane & 43\\
Hicks Building & Hounsfield Road & 40\\
\hline\\
\end{tabular}
\end{center}
This should give you a table. Think about the following.
& signs do here? What about the \\ commands? (The
\\ command must not be used in normal paragraphs.)
{llr} to {ccr}, or {llc}, or any other three-letter
combination of l, c and r. Here c is for ‘centred’.
{l|lr}. What has changed? Change
it back to llr. Most style guides recommend avoiding the use of
vertical lines in tables.If we want to put a caption on a table we need to ‘float’ it as we did with figures
in the figure environment last time: here we use a table environment. Enclose
the tabular environment you had above with the following code, where the ‘...’
represents the tabular environment.
\begin{table}[tbh]
\begin{center}
...
\caption{The heights of some buildings at the
University of Sheffield}
\label{table:building-heights}
\end{center}
\end{table}
You can now refer to this table via Table~\ref{table:building-heights}.
Try putting a mention of this table in your document.
| Name | Location | Height (m) |
| Arts Tower | Bolsover Street | 78 |
| St. Georges Church | Broad Lane | 43 |
| Hicks Building | Hounsfield Road | 40 |
This table is okay, but the default tables in LaTeX are a little too squashed. We
can improve this with the booktabs package, which makes tables look more
professional, like Table 1 in this document. In your preamble put the following
code.
\usepackage{booktabs}
\newcommand{\otoprule}{\midrule[\heavyrulewidth]}
Now in your tabular environment, replace the first \hline with \toprule, the
second with \otoprule and the bottom one with \bottomrule. Process the
document, you should have a better looking table.
3.1. Aligned equations. Start a section ‘More commands’, then start a subsection called ‘Aligned equations’ and add the following.
The Binomial Theorem says that for $n \in \mathbb{N}$ we have
\begin{align*}
(a + b)^n
&= \sum_{i=0}^n \binom{n}{i} a^i b^{n-i}
\\
&= a^n + n a^{n-1} b + \binom{n}{2} a^{n-2} b^2
+ \dots + b^n .
\end{align*}
Here, the align* environment has switched to displayed maths and has lined
up all of the equals signs. Note that each line is ended with \\ and the
things that are lined up on each line are preceded with an ampersand
&.
3.2. Text in maths. Start a subsection ‘Text in maths mode’. Enter the following code.
Let
\[
x = u + v \quad\text{and}\quad y = u - v.
\]
Process this and look at the result. Now remove the \quad commands and
process it again. What do you notice? Now put \qquad where the \quad
commands where. What difference does this make?
The term quad comes from traditional printing and it just means a space
whose width is that of the letter ‘M’. In LaTeX the commands \quad and
\qquad should only be used to separate maths from text in displayed
maths.
3.3. Correctly sized brackets. Compare the following two expressions:
You should see the left-hand version is clearly wrong: brackets need to be the
correct size for the job. Enter the following code and process it. Then remove the
\left and \right commands and compare the result.
\[
\left(\frac{x}{y} + 1\right)
\]
Each \left command needs to have a corresponding \right command.
Both need to be followed by a delimiter which will be something like
(, \{, \langle or \vert. LaTeX will pick an appropriate size for the
delimiters.
\left and \right appropriately; note that you want
and
not .
______________________________________________________________
Finish off the sheet and look at the attempt on the module webpage if necessary. Look at the module solution for last week’s homework – you will use it below.
Create a document with title ‘MPS115: Homework 5’ (or MPS116) and your name on as author. Your task this week is to write about Lagrange interpolation, illustrating it with the example of a quadratic interpolation of . The work should be structured as follows.
The first section,“An introduction to Lagrange interpolation”, should consist of one or two paragraphs explaining what Lagrange interpolation is. You do not necessarily need to give lots of complicated formulas. You could look on the internet, or in search the University library’s digital collection. For instance, the theory is covered in a book by Stroud [2] which is available to view online there. Note that you must write this in your own words, you must not copy directly from any other source. You must use at least two sources as per the lecture on plagiarism.
The second section should be called, “A quadratic interpolation of ”. The quadratic Lagrange interpolation through the points , and in is given by
You should explain how you use this to get an interpolation function for the function which passes through the points , and . You should simplify as much as you can but you do not need to show all of your working. Illustrate this by using one of the graphs from the model homework from last week.
The third section such be a brief ‘Generative AI fair use’ section. You should give brief details of any use made of generative AI. If you have not used generative AI then you can simply say “No generative AI was used in writing this.”
Finally you should include your bibliography as we have done in this lab. You should reference all of the sources that you use, including webpages. There must be at least two sources.
[1] J. C. Maxwell, A Treatise on Electricity and Magnetism Volume 1, Dover Publications Inc., 3rd edition, 2003.
[2] K.A. Stroud, Advanced Engineering Mathematics, Palgrave Macmillan, 2011.
[3] Wikipedia contributors, Maryam Mirzakhani, Wikipedia. Visited 13 October 2022, updated 13 October 2022, https://en.wikipedia.org/wiki/Maryam_Mirzakhani.
[4] A. Wiles, Modular elliptic curves and Fermat’s Last Theorem, Annals of Mathematics 141 (1995) 443–551.