HandWiki:Help/Equations
Showing Equations
MediaWiki uses a subset of TeX markup for mathematical equations. As for Wikipedia, one can use the standard "math" tag. See Displaying a formula in Mediawiki. Howerver, HandWiki uses MathJax for rendering which is included in the extension SimpleMathJax. This reduces the load on the HandWiki server since equations are parsed by the web browsers.
You can find more extensive discussion on HandWiki specific rendering using math equation help.
Inline equations
Inline formulas can be inserted in the line where the actual text is. Here is an inline formula [math]\displaystyle{ \sum_{i=0}^\infty 2^{-i} }[/math]. This sentence with this inline formular can be created as shown below:
Here is an inline formula <math>\sum_{i=0}^\infty 2^{-i}</math>
Block equations
Block equations are a special case. They are:
- Positioned on a separate line
- Enumerated using numbers in ()
- Can be referenced inside a text
Here is a simple example without numerating the formula:
- [math]\displaystyle{ \text{geometric series:}\quad \sum_{i=0}^\infty 2^{-i}=2 }[/math]
It is coded like this:
:<math>\text{geometric series:}\quad \sum_{i=0}^\infty 2^{-i}=2 </math>
As you can see, it should be positioned on a new line. For a better style, add a left margin space using ":" when showing a formula. This adds an extra space on the left of the formula
Using the dollar signs
HandWiki also uses another style for block formulas. The equation as this
$F^2\cdot cos(x)$
can be shown using the dollar sign from each side of the equation. Note it is positioned in the middle of the line. It is a preferred method if you need to convert everything to LaTeX:
$F^2\cdot cos(x)$
Equations with cross references
You can reference an equation using CrossReference method. Here is a sentence that reference an equation "1":
This example uses <xr id="eqn:In1"/> and <xr id="eqn:In2"/> that illustrates formulas with an integral. Note that <xr id="eqn:In1"/> displays the equation number between parenthesis.
- <equation id="eqn:In1" shownumber>
[math]\displaystyle{ \Gamma_{2} = \sum_{i=0}^\infty 2^{-i} }[/math] </equation>
or this method:
- <equation id="eqn:In2">
[math]\displaystyle{ \Gamma_{2} = \sum_{i=0}^\infty 2^{-i} }[/math] </equation>
The WikiCode that was used in this example is:
This example uses <xr id="eqn:In1"/> and <xr id="eqn:In2"/> that illustrates formulas with an integral. Note that <xr id="eqn:In1"/> displays the equation number between parenthesis. :<equation id="eqn:In1" shownumber> <math> \Gamma_{2} = \sum_{i=0}^\infty 2^{-i} </math> </equation> or this method: :<equation id="eqn:In2"> <math> \Gamma_{2} = \sum_{i=0}^\infty 2^{-i} </math> </equation>
Note that <xr id="eqn:In1"/> is "clickable" so you can always navigate to the equation you are referencing to. The MediaWiki code that does this is shown below:
- <equation id="eqn:In2">
[math]\displaystyle{ \Gamma_{2} = \sum_{i=0}^\infty 2^{-i} }[/math] </equation>
Additional latex symbols
Similar to Wikipedia, HandWiki supports bold symbols using the capital letter R, T, P etc., which are shortcuts for the LaTeX mathbb keyword. The are from begingroup and mediawiki-texvc TeX extensions This is an example:
[math]\displaystyle{ \P= 28 \; \R=\Q * \T, \lang \O \rang }[/math]
which was programmed as:
<math> \P = 28 \> \R=\Q * \T, \larr \O \rang </math>
Exporting equations
HandWiki allows extorting articles to the LaTeX format. In addition, one can export separate equations to MathML and LaTeX. Navigate the mouse to the equation and use the left button to pop-up the MathJax menu. The select the needed export format. See the example: