Help:Create a mathematical formula

From Heureka Wiki
Jump to navigation Jump to search

General info

Folmulas are created by using the markup-language LaTeX, a powerful commonly used language in scientific documents.

As a user, the only thing you need to do is wrap your LaTeX formula within a <math>(formula)</math> tag.

For example:

<math>f(x) = \fract{1}{\alpha^2}</math>

Produces the following formula:

How do I use LaTeX

There is really no need to write a long list of commands in this (local) wiki - mediawiki.org has a nice reference manual.

If you have some experience in mathematical expressions or programming, it will be a quick learn. It's all ablut grouping and marking up symbols.

The examples below gives a hint of what is possible to display.

Parentheses and grouping

Worth mentioning is how you group sub-forumlas in a mathematical expression. You can not use just parenthenses, but rather curly brackets: {}. This is because a parenthesis has no syntactic meaning in LaTeX and will be treated as just another character.

The sub-groups will be displayed together when LaTeX renders the formula.

For intsance: if you need to superscript more than a character you need to group those characters within curly brackets. If not, only the first letter will be superscriped.

Code Display Comment
<math>\alpha^2-z</math>
No curly brackets - only one character is superscriped.
<math>\alpha^{2-z}</math>
Curly brackets - the whole expression is grouped (and superscriped).
<math>\alpha^(2-z)</math>
Regular parentheses are treated as any single character, with no grouping effect.
<math>\alpha^{(2-z)}</math>
Combine curly brackets with regular parentheses for syntactic and visual grouping.

Examples

<math>\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}
 {3^m\left(m\,3^n+n\,3^m\right)}</math>

Gives


<math>\phi_n(\kappa) =
 \frac{1}{4\pi^2\kappa^2} \int_0^\infty
 \frac{\sin(\kappa R)}{\kappa R}
 \frac{\partial}{\partial R}
 \left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR</math>

gives


<math>
 f(x) =
 \begin{cases}
 1 & -1 \le x < 0 \\
 \frac{1}{2} & x = 0 \\
 1 - x^2 & \mbox{otherwise}
 \end{cases}
 </math>

Gives:


FAQ

How does it work?

MediaWiki produces images for each formula you type. If you change the formula, a new image is created, and the page referres to the new image.

The image is identified by a (system) unique filename, calculated by a hash function (MD5) based on the formula text. This enables a quick translation between the formula-text and the filename.

Will the server be cluttered with images?

Yes and no. There will indeed be lots of images, but these images lies in a dedicated folder and are relatively small - ranging between <1k to 10k.

Isn't there any nice graphical interface to LaTeX?

Some GUI-based programs does exist, but for now you will have to find them yourself. I would suggest you start at http://en.wikipedia.org/wiki/LaTeX#External_links