You can open the project used in the video in ShareLaTeX by following this link: https://www.sharelatex.com/project/51ed0480335f3d63700f3aa9
In the last video we looked at splitting up documents into sections and paragraphs.
In this video we’re going to be looking at adding basic maths symbols and equations into our documents.
Before you start writing mathematical content in LaTeX we recommend you load up the ‘amsmath’ package, this will give you more options when writing more complicated mathematical documents.
To do this simply use the
\usepackage command and enter ‘amsmath’ in the brackets.
To simply write maths inline with the text you are writing, enclose your mathematical content in dollar signs. ShareLaTeX will colour code content in dollar signs in green so you can easily identify your inline mathematics.
To write something in superscript, follow your number or symbol by a caret and then enter the number or symbol you want in the superscript into curly brackets.
To write something in subscript it’s the same process except we use an underscore instead of a caret.
Greek letters are very easy to add in LaTeX. Each letter of the greek alphabet has a corresponding command which is just a backslash followed by the name of the greek letter in english. If you want to capitalise them, simply start the command with a capital letter.
Pretty much any mathematical function you can think of has a LaTeX command to typeset it.
There are numerous lists of these online so I will just introduce a few of them to you now.
Firstly trig functions look like this.
The square root function like this.
Fractions can be easily entered using the
And there are also numerous functions for writing algebraic statements like this subset command.
Often you don’t want to write mathematics inline with the text, particularly if you are writing more complex equations. Therefore to write an equation or formula on a new line you can use the begin equation structure. Here’s an example of this structure implementing a basic polynomial and an example demonstrating a summation symbol. You will notice that LaTeX has automatically numbered these equations and printed their corresponding numbers in brackets on the right hand side of the page. If you don’t want your equation to be numbered you can add an asterisk immediately after the word equation in both the begin and end commands. Here’s an example using a definite integral.
This concludes our discussion on mathematics in LaTeX. In the next video we’ll look at inserting images into our documents.