# Difference between revisions of "User:TW466/MathJaxTest"

$$\LaTeX$$ can be included in wiki articles by using $...$ tags, $$...$$ or $...$.

## $tags For instance, the following line... Quadratic equations of the form [itex]0 = ax^2 + bx + c$ can be solved by using $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}$.


...results in:

Quadratic equations of the form $0 = ax^2 + bx + c$ can be solved by using $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}$.

## Brackets and display formulas

$...$ results in a "display" formula instead of an "inline" one. This is best if the equation is meant to stand on its own, without surrounding flow text:

$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}$


$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}$

$$...$$ can also be used as delimiters for inline maths, for instance: $$\nabla B = \nabla \times \vec Q$$ becomes $$\nabla B = \nabla \times \vec Q$$.

## Escaping

<nowiki> tags don't escape the bracket delimiters unfortunately (but do escape [itex] tags).

Brackets can be escaped by including a <span></span> between the \ and the opening/closing bracket, like so:

\<span></span>( \nabla B = \nabla \times \vec Q \<span></span>)


## Chemical formulas

SimpleMathJax also supports <chem> tags, like so:

<chem>CO2 + C -> 2 CO</chem>


$\ce{CO2 + C -> 2 CO}$

## Edit previews

Thanks to a hack in MediaWiki:Common.js, maths now show up in edit previews.