Maths not in maths-mode.
Text in maths-mode.
Punctuation in the wrong place.
Using too much displayed mathematics.
Using bold text.
Overful hboxes.
When using inline maths, it is easy to forget the single dollars.
Look out for maths symbols not displayed in italics.
Examples. This is correct, whereas this x is not. This f(x) is wrong as well, as is this set A, which is should be .
The reverse situation is using text in math-mode.
This is easy to spot, as the text becomes italic and spacing isn’t correct.
Examples.
The first case here may have happened by accident.
The second is someone fiddling to make things look okay, but looks bad.
Text is occassionally needed within math-mode.
If it is necessary, use the \text{...}
command (from amsmath
).
The \text
command allows us to write
Notice the spacing between the maths and text. This has been done using the
\quad
command, which creates a large space:
\[ x = u + v \quad\text{and}\quad y = u - v. \]
3. Punctuation in the wrong place
Punctuation needs to be outside of inline mathematics.
Therefore $x=2$. The result is proved.
Therefore $x=2.$ The result is proved.
These display as follows.
Therefore . The result is proved.
Therefore The result is proved.
There are two things wrong here.
These subtle differences will make your document look worse.
3. Punctuation in the wrong place II
Conversely, punctuation needs to be inside of displayed mathematics!
Otherwise it can fall to the next line.
Thus, \[ \sin^2 x + \cos^2 x = 1 \], and the result follows.
gives rise to
Thus,
, and the result follows.
4. Using too much displayed mathematics I
Beginners to LATE X often overuse displayed mathematics. Displayed mathematics should be used for important steps that you would like to stand out, or for formulas and equations too big to display well in-line. Too much displayed maths slows the reader down.
Here’s an example of something broken up too much by display-math.
4. Using too much displayed mathematics II
Example. Suppose not, and is rational. Then, by Lemma 1.2,
where and share no common factors. Thus, squaring, we get
It follows that is even, and hence so is . Write
for some …
4. Using too much displayed mathematics III
Example (Re-write). Suppose not, and is rational. Then, by Lemma 1.2, , where and share no common factors. Thus, squaring, we get . It follows that is even, and hence so is . Write for some …
As explained in an earlier lecture, LaTeX is a mark-up language. The best
approach is to use LaTeX to tell the computer what kind of thing your text is,
rather than specifically how to display it. Bold text is almost never used in
sentences, where the \emph{...}
command (meaning ‘emphasised text’) is used
instead.
LaTeX creates documents with fully-justified text (i.e., text stretched from the left margin to the right). Usually LaTeX does this well, and doesn’t like to stretch the space between the words too much. Sometimes it chooses to spill over the right margin slightly. If this happens, you will get a warning about an ‘overfull hbox’ in the log-file.
Example. Overfull hboxes can happen with looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong words.
To fix this, slightly reword the sentence; usually LaTeX finds a better way to split the lines. If the overfull hbox is very slight, you might choose to ignore it.
Using too many paragraphs.
Not writing in full sentences.
Some have a habit of starting each new sentence as a new paragraph. Each new paragraph should represent a change of idea or step forward.
Example (Bad). Let .
Differentiating, we find .
Thus, if and only if .
Since for all , it follows that…
Example (Better). Let . Differentiating, we find . Thus, if and only if . Since for all , it follows that…
2. Not writing in full sentences
Mathematicians often try to save time when writing by hand, adding little notes, and these might not be written in full sentences.
When typing mathematics you should write everything in full sentences.
Example (Bad). If then (product rule). Sub in . Then…
Example (Better). If then use the product rule to obtain . Substitute in . Then…
Activity (More proof-reading). The document on the course website in the Presentation Materials has a number of problems with it. Find as many ways of improving the document as you can.
First mini-project to launch next week
Make sure you attend the Week 6 lectures next week, as the first mini-project will be launched then (to be submitted in Week 8).
Most often, errors are just due to bad LATE X code. Error message alerts show up at the bottom of the left-hand pane in TeXworks and just above the output pane in Overleaf. Unfortunately, LaTeX’s error messages aren’t always the clearest (though Overleaf, in particular, does a good job of trying to help).
1! Missing $ inserted. 2<inserted text> 3 $ 4l.55 \item Let f(x) = a_ 5 0+a_1x+a_2x^2+a_3x^3 and $g(x) = b_0+b_1x+b_2x^2$. F... 6I’ve inserted a begin-math/end-math symbol since I think you left one out.
This is maths symbols used not in math-mode (in this case, the _
symbol).
1! LaTeX Error: \begin{enumerate} on input line 74 ended by \end{document}. 2 3See the LaTeX manual or LaTeX Companion for explanation. 4Type H <return> for immediate help. 5 ...
This is a forgotten \end{enumerate}
.
1Runaway argument? 2{Maclaurin and Taylor series, drawing attention to the $x-a$ in the d\ETC. 3! File ended while scanning use of \emph . 4<inserted text> 5 \par 6<*> ...10*Maclaurin*series/10_maclaurin_series.tex 7 8I suspect you have forgotten a ‘}’, causing me to read past where you wanted me to stop.
1! LaTeX Error: Environment enumreate undefined. 2 3See the LaTeX manual or LaTeX Companion for explanation. 4Type H <return> for immediate help. 5 ... 6 7l.54 \begin{enumreate} 8 9Your command was ignored.
This is a misspelling of ‘enumerate’.
This is a missing \end{document}
.
Many LATE X errors will be a variation on one of the above examples.
In Computer Lab 5 we’ll look at referencing and tables and a few other things.