LaTeX Glossary


My.SUPA has been setup to allow maths to be written quickly using LaTeX notation. This can be included anywhere you see a text box in your course area -- including news or social forums, web pages and wikis. The format for entering LaTeX in My.SUPA is to wrap the code between two pairs of dollar signs. $$ a=b+c $$


If you are looking at this for the first time, please read the entries under 01 Getting Started for an overview. The list of entries may be viewed by categories or alphabetically.

01 Getting Started
| 02 Arithmetic expressions | 03 Font Styles | 04 Delimiters
05 Spaces
| 06 Symbols | 07 Relations | 09 Structures | 10 Feynman Diagrams
11 Other LaTeX Software
Browse the glossary using this index

Special | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ALL

H

Help

Introduction to LaTeX

LaTeX (pronounced Lay-teck or Laytech) is a text processing language, designed to make it easy to typeset high quality technical documents. In the context of My.SUPA, it makes it easy to include mathematical expressions in forum postings. In this short introduction we'll cover some basic expressions to give you a flavour of the possibilities. There is a huge range of resources available for LaTeX and we'll give a short list of these at the end.

Getting Started - symbols

LaTeX expressions are indicated in My.SUPA by enclosing them in double dollar signs. So, typing $$1+2$$ gives the following LaTeX output: 1+2. Note that My.SUPA renders the LaTeX commands and creates an image as output.

The first useful thing that LaTeX can do is to translate commands mathematical symbols and characters. For example, $$\omega$$ gives \omega. These commands are case sensitive - $$\Omega$$ gives \Omega. Search for "greek letters (overview)" in this glossary to find a full list.

Formulae

Useful as using LaTeX to type symbols is, you can also use it to create complex mathematical expressions. In the following example, we'll create a finite integral from 0 to 5 of the function f(x). The command for an integral in LaTeX is \int. We can indicate limits to the integral by using the superscript command, ^, and the subscript command, _ . The complete command is then: $$ \int_0^5 f(x) dx$$:

 \int_0^5 f(x) dx

LaTeX recognises that we want to make 0 a subscript and 5 a superscript. What if we would like to use more than one character for our limits, for example integrating sine(x) in the following example?

 \int_0^{2\pi}\sin(x) dx

In this case we use the following set of commands: $$ \int_0^{2\pi}\sin(x) dx $$. Note that the 2\pi is enclosed in curly brackets to tell LaTeX that we want everything contained within to be made a superscript. We've also used in this example the standard function \sin.

Fractions

To use fractions in LaTeX, we use the command \frac, with 2 sets of curly brackets for the numerator and denominator. For example, \frac{1}{2} is written $$\frac{1}{2}$$. We can combine multiple commands together - for example, the quadratic formula can be written as $$x=\frac{-b\pm\sqrt{ b^2 - 4ac}}{2a}$$:

x=\frac{-b \pm \sqrt{b^2-4ac}}{2a}

where \pm gives \pm and \sqrt gives the square root symbol. Notice again how we enclose everything we want under the square root sign in curly brackets.

Matrices

Another useful feature of LaTeX is the ability to format matrices. To demonstrate the different parts of writing a matrix, we'll use the following example:

 \left( \begin{array}{cccc} a&b&c&d\\ e&f&g&h\\ i&j&k&l\\ m&n&o&p \end{array} \right)

The code for this is: $$\left(\begin{array}{cccc}a&b&c&d\\e&f&g&h\\i&j&k&l\\m&n&o&p\end{array}\right)$$. You can split this over several lines if you would like, but make sure that you don't put any spaces between the double dollar signs. Working from the outside in:

  • \left(... \right): tell LaTeX to put brackets round the enclosed code and to match the size of the brackets to match the contents.
  • \begin{array}{cccc} ... \end{array}: tell LaTeX that you're creating a matrix. This is called an environment. {cccc} indicates that you're making a 4 column matrix each of which is centre justified.
  • a&b&c&d\\...\m&n&o&p: these are the contents of the matrix. '&' is used as the column separator and '\\' indicates the end of each line. Note that you don't need this at the end of the last line.

Going further

This help section only scratches the very surface of the possibilities of LaTeX. For more information, here are some useful guides:
  • Latex: A Document Preparation System : User's Guide and Reference Manual, Leslie Lamport, Addison-Wesley, 1994
  • The TeXBook, Donald Knuth, Addison-Wesley, 1984
  • The Not So Short Introduction to LaTeX: An excellent short primer for LaTeX

If you are interested in using LaTeX away from My.SUPA for creating documents, try some of the following resources:

  • The TeX Users Group: A central respository of TeX information, installations and packages
  • MiKTeX: A good LaTeX installation for Windows
  • MacTeX: A comprehensive LaTeX installation for Mac OS X
  • LyX: A LaTeX editor for Windows, Mac OS X and Linux which resembles document processors such as Microsoft Word.
LaTeX is used very widely for writing theses and scientific papers, so you will almost certainly find lots of LaTeX expertise in your local group as well.