Difference between revisions of "User:TW466/MathJaxTest"

From CUGC Wiki
(Fix formula.)
(Fix both formula and sample.)
Line 7: Line 7:
 
<tt>\<span></span>( ... \<span></span>)</tt> can also be used as maths delimiters, for instance:
 
<tt>\<span></span>( ... \<span></span>)</tt> can also be used as maths delimiters, for instance:
 
<tt>\<span></span>( \nabla B = \nabla \cdot \vec Q \<span></span>)</tt>
 
<tt>\<span></span>( \nabla B = \nabla \cdot \vec Q \<span></span>)</tt>
becomes \( \nabla \vec B = \nabla \cdot Q \).
+
becomes \( \nabla B = \nabla \cdot \vec Q \).
 
<nowiki><nowiki></nowiki> tags don't escape them unfortunately (but do escape <nowiki><math></nowiki> tags).
 
<nowiki><nowiki></nowiki> tags don't escape them unfortunately (but do escape <nowiki><math></nowiki> tags).
  

Revision as of 14:45, 12 March 2019

\(\LaTeX\) can be included in wiki articles by using <math>...</math> tags.

For instance, the following line results in:

<math>x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}</math>

[math]x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}[/math]

\( ... \) can also be used as maths delimiters, for instance: \( \nabla B = \nabla \cdot \vec Q \) becomes \( \nabla B = \nabla \cdot \vec Q \). <nowiki> tags don't escape them unfortunately (but do escape <math> tags).

SimpleMathJax also supports <chem> tags, like so:

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

[math]\ce{CO2 + C -> 2 CO}[/math]

Unfortunately, maths don't show up in editing previews. <math>-enclosed maths show up in grey, but \(-enclosed maths aren't converted at all until the page is saved.