LaTeX (pronounced Latec - the x is actually a chi symbol) is an electronic typesetter used mainly for technical or scientific documents but it can be used for almost any form of publishing.

LaTeX is not a word processor! Instead, LaTeX encourages authors not to worry too much about the appearance of their documents but to concentrate on getting the right content. For example, consider this document:

The purpose is not primarily aesthetics as with a word processor, but correct content.

LaTeX contains features for:

 * Typesetting * Control over large documents containing sectioning, cross-references, tables and figures. * Typesetting of complex mathematical formulas. * Advanced typesetting of mathematics with AMS-LaTeX. * Automatic generation of bibliographies and indexes. * Multi-lingual typesetting. * Inclusion of artwork, and process or spot colour. * Using PostScript or Metafont fonts. 

LaTeX is built in to TSR. It helps enormously getting people to help you out if you format your mathematical queries using this method. Below are some basic commands to get you started:

Using LaTeX on TSR:

TSR currently has two LaTeX packages installed, one called TeXLive and an older one called MimeTeX. In terms of functionality and typographical quality the former is better, and this guide will assume you use TeXLive.

To use LaTeX on the TSR forums, simply enter the LaTeX code into [latex][/latex] tags.

e.g. [latex]x = 5[/latex] gives x = 5

Note Most, if not all, of the LaTeX commands on this page also work using the tags [tex] and [/tex] (which saves you quite a bit of typing if you're doing lots of it!) TeX is just the earlier version of LaTeX

Multiplication and division

If you need to use these symbols, use \times and \div respectively.

e.g. [latex]3 \times 5 = 15[/latex] gives 3 \times 5 = 15, while [tex]4 \div 2 = 2[/tex] gives 4 \div 2 = 2

Complex notation

Polar form

[tex]\langle r , \theta \rangle[/tex] gives \langle r , \theta \rangle

Plus or minus

[latex]\pm[/latex] gives \pm

[latex]\mp[/latex] gives \mp


[latex]x^a[/latex] gives x^a

If the exponent is more than one character long, then you have to use curly brackets (i.e. { and } ) This is the case throughout LaTeX.

e.g. [latex]x^[/latex] gives x^

For square roots, you use the \sqrt command.

e.g. [latex]\sqrt 2[/latex] gives \sqrt 2

e.g. [latex]\sqrt [/latex] gives \sqrt

If you want to take the n-th root, use the \sqrt[n] command.

e.g. [latex]\sqrt[3][/latex] gives \sqrt[3]

Equals sign and inequalities

To get an equals sign, you simply use the ordinary = sign.

e.g. [latex]2^4=16[/latex] gives 2^4=16

For 'not equal to', use \not=

e.g. [latex]2^4\not=2[/latex] gives 2^4\not=2

For less than signs, we use <, and for greater than signs, we use >

e.g. [latex]2^4>15[/latex] gives 2^4>15

For 'less than or equal to' signs, we use \leq, and for 'greater than or equal to' signs we use \geq

e.g. [latex]5x+3 \geq 8[/latex] gives 5x+3 \geq 8

As with the equals sign, the symbol for 'not less than or equal to', 'not greater than', etc. is just \not followed by the symbol (i.e. >, <, \leq, \geq).

e.g. [latex]5x+3 \not\geq 8[/latex] gives 5x+3 \not\geq 8

For 'equivalent to' signs, we use \equiv

e.g. [latex]1+ \cot^2 \equiv \mathrm^2[/latex] gives 1+ \cot^2 \theta \equiv \mathrm^2 \theta


We use \frac.

e.g. [latex]\frac[/latex] gives \frac

e.g.2 [latex]x = \frac{-b \pm \sqrt}[/latex] gives x = \frac{-b \pm \sqrt}

For fractions which aren't squashed onto one line, use \dfrac.

e.g. [latex]x = \dfrac{-b \pm \sqrt}[/latex] gives x = \dfrac{-b \pm \sqrt}


To get brackets in LaTeX you simply use the parentheses you're used to using when typing Maths without LaTeX.

e.g. [latex](x+1)^2[/latex] gives (x+1)^2

If you've got a huge expression with multiple brackets or roots, fractions, etc., you can get larger brackets, using the \left( and \right) commands.

e.g. [latex]f(x) = 3x^2\left(1+\frac \right)[/latex] gives f(x) = 3x^2\left(1+\frac \right) (compare with [latex]f(x) = 3x^2(1+\frac)[/latex] which gives f(x) = 3x^2(1+\frac)

Square brackets and curly brackets can also be used. For example, [latex]\displaystyle \int_1^2 \ dx = \left[ \frac + x \right]_1^2[/latex] gives \displaystyle \int_1^2 \ dx = \left[ \frac + x \right]_1^2

Normal text

When writing within TeX tags, it is assumed that any letters denote variables, and hence are italicised. If you want the letters to be written normally (for example, if you are quoting units), use the \mathrm{} tag. The \text{} tag can also be used to perform this function on TSR.

e.g. [latex]\mathrm[/latex] gives \mathrm (compare with [latex]hello[/latex] which gives hello)

For spaces, use "\ ".

e.g. [latex]\mathrm[/latex] gives \mathrm

and [latex]v=1.2\text{\ m/s}[/latex] gives v=1.2\text{\ m/s}

Subscripts and superscripts

Superscripts are exactly the same as indices - we again use the ^ command.

e.g. [latex]\mathrm^-[/latex] gives \mathrm^- (Note that you could also use the [sup] [/sup] tags instead though.)

For subscripts, we use the _ command.

e.g. [latex]x_1+x_2+x_3 = 5[/latex] gives x_1+x_2+x_3 = 5

Sigma notation

To write sums, we use the \sum command.

e.g. [latex]\sum_^n i^2 = \fracn(n+1)(2n+1) [/latex] gives \sum_^n i^2 = \fracn(n+1)(2n+1)

To make the first and last term appear above and below instead of to the side, use \displaystyle.

e.g. [latex]\displaystyle\sum_^n i^2 = \fracn(n+1)(2n+1) [/latex] gives \displaystyle\sum_^n i^2 = \fracn(n+1)(2n+1)

Alternatively use \limits to add limits while keeping the size of the text the same.

[latex]\sum\limits_^n i^2 = \fracn(n+1)(2n+1) [/latex] gives \sum\limits_^n i^2 = \fracn(n+1)(2n+1)

To write the mean of x, x-bar, use the \bar. E.g. \bar = \frac\displaystyle\sum_^n x_i


Again, we use \frac{}{} to write dy/dx.

e.g. [latex]\frac x^2 = 2x[/latex] gives \frac x^2 = 2x

For f'(x), simply write it out normally within LaTeX tags.

e.g. [latex]f'(x)[/latex] gives f'(x)

For partial derivatives, use \partial instead of d.

e.g. [latex]\displaystyle \frac{\partial}{\partial x} x^2y = 2xy[/latex] gives \displaystyle \frac{\partial}{\partial x} x^2y = 2xy


For the integral sign, use the \int command.

e.g. [latex]\int 2x\ dx = x^2 + C[/latex] gives \int 2x\ dx = x^2 + C

For definite integrals, use the commands for subscripts and superscripts.

e.g. [latex]\int^2_0 2x\ dx = 4[/latex] gives \int^2_0 2x\ dx = 4

Again, like with sums, the \displaystyle command makes integrals look nicer:

e.g. [latex]\displaystyle\int^2_0 2x\ dx = 4[/latex] gives \displaystyle\int^2_0 2x\ dx = 4

Modulus sign

Use | for the modulus sign.

e.g. [latex]\sqrt = |x|[/latex] gives \sqrt = |x|

or \lvert and \rvert (in case you don't have a | key on your keyboard)


Use the exclamation mark like normal.

e.g. [latex]4! = 24[/latex] gives 4! = 24

n choose r

[latex]^n\mathrm_r[/latex] gives ^n\mathrm_r

Or, you can use the \binom command:

[latex]\displaystyle \binom[/latex] gives \displaystyle \binom

You could also, if you wanted, write it as a vector(see below).

Greek Letters

Write \x where x is the written form of the Greek letter (i.e. alpha, beta, gamma, ... , omega).

e.g. [latex]\pi[/latex] gives \pi

e.g. [latex]\theta[/latex] gives \theta

If you want the uppercase Greek letter, write the first letter as a capital.

e.g. [latex]\Delta[/latex] gives \Delta

Some Greek letters look identical to their Roman equivalents, and so are not provided; e.g. for lowercase omicron, simply write o.


To insert the infinity symbol, use \infty.

e.g [latex]\displaystyle\sum_^{\infty} \frac = \frac{\pi^2}[/latex] gives \displaystyle\sum_^{\infty} \frac = \frac{\pi^2}


[latex]\cos \theta[/latex] gives \cos \theta

[latex]\sin \theta[/latex] gives \sin \theta

[latex]\tan \theta[/latex] gives \tan \theta

[latex]\sec \theta[/latex] gives \sec \theta

[latex]\mathrm \theta[/latex] gives \mathrm \theta

Alternatively, [latex]\csc \theta[/latex] gives \csc \theta

[latex]\cot \theta[/latex] gives \cot \theta

For the trig functions exponentiated, use ^ after the trig function and before the \theta (or whatever you're using).

e.g. [latex]\sin^2 \theta + \cos^2 \theta=1[/latex] gives \sin^2 \theta + \cos^2 \theta=1

To write 'degrees', you could use the \circ command.

e.g. [latex]\sin 30^{\circ} = \frac[/latex] gives \sin 30^{\circ} = \frac


Use some of the previous commands.

e.g. [latex]\ln x^k = k \ln x[/latex] gives \ln x^k = k \ln x

and [latex]\log_a x^k = k \log_a x[/latex] gives \log_a x^k = k \log_a x


[latex]x_1+x_2+\cdots[/latex] gives x_1+x_2+\cdots (i.e. central dots)

[latex]x_1+x_2+\ldots[/latex] gives x_1+x_2+\ldots(i.e. dots at the bottom)

[latex]\dot[/latex] gives \dot (i.e. dot above x)

[latex]\ddot[/latex] gives \ddot (i.e. two dots above x)

[latex]\cdot[/latex] gives \cdot

[latex]\bullet[/latex] gives \bullet

Matrices and Vectors

For a bold letter, you could use normal text and make it bold (e.g. [b]i[/b] gives i), or if you wanted to use LaTeX, use the \mathbf{} command.

e.g. [latex]\mathbf[/latex] gives \mathbf

The \vec{} command can also be useful.

e.g. [latex]\vec[/latex] gives \vec

To write a vector or a matrix, you could use either of the pairs

  • \begin \end
  • \begin \end
  • \begin \end
  • \begin \end
  • \begin \end
  • \begin \end

which enclose the matrix/vector in ( ), [ ], { }, | |, || || and nothing, respectively. Between these \begin{} and \end{} commands, enter the coefficients of the matrix/vector row by row, separating coefficients on the same row with & and separating rows by \\.


[latex]\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end[/latex] gives

\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end

[latex]\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end[/latex] gives

\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end

[latex]\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end[/latex] gives

\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end

[latex]\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end[/latex] gives

\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end

[latex]\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end[/latex] gives

\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end


[latex]\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end[/latex] gives

\begin 1 & 2 & 3 \\4 & 5 & 6 \\7 & 8 & 9 \end

For vectors, simply write a matrix with only one column:

[latex]\begin x \\ y \\ z \end[/latex] gives

\begin x \\ y \\ z \end


Sometimes, it could be useful to lay out what you write nicely in a table. For many cases, the \begin \end commands will suffice for this, but a little more control is offered by the \begin \end commands.

When using this, you need to decide beforehand how many columns you want to have, and include a string of letters, one for each column, enclosed in {} directly after the \begin command. The letters indicate what alignment you want of the entries in that column, l for left, c for centre, and r for right.


[latex]\begin n & n^2 & n^3 \\ 3 & 9 & 27 \\ 4 & 16 & 64 \\ 11 & 121 & 1331 \end[latex]


n & n^2 & n^3 \\
3 & 9 & 27  \\
4 & 16 & 64 \\
11 & 121 & 1331  

You can have horizontal and vertical lines in your table. For a horizontal line, use the \hline command , and for a vertical, put a | in the list of column alignments.


[latex]\begin n & n^2 & n^3 \\ \hline 3 & 9 & 27 \\ 4 & 16 & 64 \\ 11 & 121 & 1331 \end[latex]


n & n^2 & n^3 \\
3 & 9 & 27  \\
4 & 16 & 64 \\
11 & 121 & 1331  


e.g. [latex]\Rightarrow[/latex] gives \Rightarrow

e.g. [tex]\not\Rightarrow[/tex] gives \not\Rightarrow

e.g. [latex]\rightarrow[/latex] gives \rightarrow

e.g. [latex]\Longrightarrow[/latex] gives \Longrightarrow

e.g. [latex]\longrightarrow[/latex] gives \longrightarrow

e.g. [latex]\mapsto[/latex] gives \mapsto

Arrows can point left by replacing "right" with "left", or they can point both ways by replacing "right" with "leftright".

e.g. [latex]\longleftarrow[/latex] gives \longleftarrow

e.g. [latex]\Leftrightarrow[/latex] gives \Leftrightarrow

Logic Symbols

[latex]\forall[/latex] gives \forall

[latex]\land[/latex] gives \land

[latex]\lor[/latex] gives \lor

[latex]\exists[/latex] gives \exists

[tex]\neg[/tex] gives \neg


[tex]\displaystyle\underbrace_}[/tex] gives \displaystyle\underbrace_}

[latex]\lim_[/latex] gives \lim_

[latex]\displaystyle\lim_[/latex] gives \displaystyle\lim_

[latex] \Re [/latex] gives  \Re

[latex] \Im [/latex] gives  \Im


[latex]\cup[/latex] gives \cup eg. \mathrm(A \cup B)

[latex]\cap[/latex] gives \cap eg. \mathrm(A \cap B)

[latex]\subset[/latex] gives \subset

[latex]\subseteq[/latex] gives \subseteq

[latex]\nsubseteq[/latex] gives \nsubseteq

[latex]\in[/latex] gives \in

[latex]\not\in [/latex] gives \not\in

[latex]\mathbb[/latex] gives \mathbb

[latex]\mathbb[/latex] gives \mathbb

[latex]\mathbb[/latex] gives \mathbb

[latex]\mathbb[/latex] gives \mathbb

[latex]\mathbb[/latex] gives \mathbb

[latex]\mathbb[/latex] gives \mathbb

[latex]\mathbb[/latex] gives \mathbb

[latex]\forall[/latex] gives \forall


[latex]\bar[/latex] gives \bar

[latex]\hat[/latex] gives \hat

[latex]\dot[/latex] gives \dot

[latex]\ddot[/latex] gives \ddot

[latex]\vec[/latex] gives \vec