Help:Editing Math Equations using TeX

This is how you edit math equations using the TeX syntax to make nice looking equations. Please use TeX when writing math. Trying to put equations directly into the text doesn't look very nice and TeX is very easy to learn.

If you already use TeX, then all you need to know is that your normal syntax must be surrounded by tags:


 * For HTML rendering if possible

$$ syntax $$


 * For forced TeX rendering ( which produces an image )

$$ syntax ~$$ $$ syntex \,\!$$ $$ syntax \,$$

The above forced rendering are explained in Forced PNG rendering

If you've never used TeX before, here's a crash course:

Fractions
To make a fraction use:

\frac{foo}{bar}

These render as: $$\frac{foo}{bar}$$

Superscript and Subscript
To make superscripts and subscripts, use:

x^2 y_0

These render as: $$x^2~y_0$$

Greek Letters
To make greek letters, you just need to know their names. Use a capital for the capital letter, a lower-case for the lower-case letter:

\pi \theta \omega \Omega \gamma \Gamma \alpha \beta

These render as like: $$\pi~\theta~\omega~\Omega~\gamma~\Gamma~\alpha~\beta$$

Trig Stuff
You can use the following to render trig functions without italics so it looks nicer:

\cos(\theta) \sin(\theta) \tan(\theta)

These render as: $$\cos(\theta)~\sin(\theta)~\tan(\theta)$$, as opposed to:

cos(\theta) sin(\theta) tan(\theta)

Which look like: $$cos(\theta)~sin(\theta)~tan(\theta)$$

In general, if you want to make words not in italics in math, use

\text{foo bar}

Which looks like $$\text{foo bar}$$ instead of $$foo bar$$

Big Brackets
Usually, a normal parenthesis or bracket will do fine:

x^2 (2x + y)

Renders as: $$x^2 (2x + y)$$

But if you have big stuff like fractions, it doesn't always look as nice:

(\frac{\pi}{2})

renders as: $$(\frac{\pi}{2})$$

Instead, use:

x^2 \left(2x + y\right) \left( \frac{\pi}{2} \right)

Which looks like: $$ x^2 \left(2x + y\right)~\left( \frac{\pi}{2} \right)$$

Notice that these kinds of brackets are always the right size. They also work with square brackets:

\left[ \frac{\pi}{2} \right] \left[ x^2 (2x + y) \right]

Renders as: $$ \left[ \frac{\pi}{2} \right]~\left[ x^2 (2x + y) \right]$$

Other
These are some other things that may be useful. In general, if you want to know how to make a type of symbol, you can find many usefuly lists by searching for TeX or LaTeX math symbols.

\sqrt{foo}

$$\sqrt{foo}$$

\int_a^b f(x)dx

$$\int_a^b f(x)dx$$

\pm

$$\pm$$

\mp

$$\mp$$

\approx

$$\approx$$

One thing you may notice is that adding spaces between symbols will not add more space in the rendered output.

a_0        a_1 a_0 a_1

These will both render as: $$a_0        a_1$$ $$a_0 a_1$$

If you want to force spacing between symbols, you have to use the "~" symbol:

a_0a_1

renders as: $$a_012:43, 23 October 2013 (PDT)Wikiadmin (talk) 12:43, 23 October 2013 (PDT)a_1$$

Also, it can be useful to note that there as two kinds of math font that the wiki will try to use. One is a smaller font which fits better into a line of normal text, and the other is a larger font which looks nicer when you have an equation on its own line. Whenever you make somthing "big" like a fraction or square root symbol, the wiki will automatically use bigger font. Sometimes you may want to force a line to be bigger because it looks nicer. I have found no nice way to do this other than it just so happens that if you put a "~" at the end of a line that line will be rendered in the bigger font; since the "~" is at the end you won't notice that there is technically an extra blank space there.

A\cos(\omega t) A\cos(\omega t)~

These will render as:

$$A\cos(\omega t)$$ $$A\cos(\omega t)~$$

Lastly, don't be afraid to nest things together to make really complicated looking expressions:

v_2 = \sqrt{\frac{2\left(P_1 - P_2\right)}{\rho \left(1 - {\left(\frac{A_2}{A_1}\right)}^2\right)}}

will render as: $$v_2 = \sqrt{\frac{2\left(P_1 - P_2\right)}{\rho \left(1 - {\left(\frac{A_2}{A_1}\right)}^2\right)}}$$