# Changes

## User:TW466/MathJaxTest

, 17:09, 12 March 2019
Add display formula delimiters; layout improvements.
$$\LaTeX$$ can be included in wiki articles by using <ttcode><nowiki>$...$</nowiki></ttcode> tags, <code>\<span></span>( ... \<span></span>)</code> or <code>\<span></span>[ ... \<span></span>]</code>.
For instance, the following line results in: == <nowiki><math>x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}</math></nowiki>$x_{1,2} tags == \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}$
For instance, the following line...  Quadratic equations of the form <nowiki>$0 = ax^2 + bx + c$</nowiki> can be solved by using <nowiki>$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}$</nowiki>. ...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 == <code>\<span></span>[ ... \<ttspan></span>]</code> 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: \<span></span>[ x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a} \<span></span>]$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}$ <code>\<span></span>( ... \<span></span>)</ttcode> can also be used as delimiters for inline maths delimiters, for instance:<ttcode>\<span></span>( \nabla B = \nabla \times \vec Q \<span></span>)</ttcode>
becomes $$\nabla B = \nabla \times \vec Q$$.
== Escaping == <nowiki><nowiki></nowiki> tags don't escape them the bracket delimiters unfortunately (but do escape <nowiki>[itex]</nowiki> tags). Brackets can be escaped by including a <code><nowiki><span></span></nowiki></code> between the <code>\</code> and the opening/closing bracket, like so:  <nowiki>\<span></span>( \nabla B = \nabla \times \vec Q \<span></span>)</nowiki> == Chemical formulas ==
[https://www.mediawiki.org/wiki/Extension:SimpleMathJax SimpleMathJax] also supports [https://mhchem.github.io/MathJax-mhchem/ <nowiki><chem></nowiki> tags], like so:
<nowiki><chem>CO2 + C -> 2 CO</chem></nowiki>
<chem>CO2 + C -> 2 CO</chem>

== Edit previews ==
Thanks to a hack in [[MediaWiki:Common.js]], maths now show up in edit previews. At least sometimes.