# MathJax Macro

Enter content supported by the MathJax javascript engine |

Type | XAR |

Category | Macro |

Developed by | Vincent Massol, Manuel Leduc, Oana-Lavinia Florean |

Active Installs | 13 |

Rating | |

License | GNU Lesser General Public License 2.1 |

Compatibility | Since v1.1 requires XWiki 14.9 |

# Description

A macro that allows entering content interpreted by the MathJax javascript library.

Note that MathJax allows entering equations but it also supports a lot more, such as equation references, and more.

# Usage

Example usage (input in xwiki/2.1 syntax):

{{mathjax}}

\begin{eqnarray}

1 & = & a x + b y\label{eq:first} \\

0 & = & c x + d y\label{eq:second}

\end{eqnarray}

{{/mathjax}}

Solving equation {{mathjax}}\ref{eq:second}{{/mathjax}} for {{mathjax}}x{{/mathjax}} and substituting back into equation {{mathjax}}\ref{eq:first}{{/mathjax}} yields

{{mathjax}}

\begin{equation}

y = \frac{c}{cb-ad}

\end{equation}

{{/mathjax}}

Renders as:

# LaTeX Export

This macro also provides a LaTeX template for the LaTeX extension, allowing the content to be rendered in LaTeX.

The example above is translated into the following LaTeX content when exported to LaTeX:

\begin{eqnarray}

1 & = & a x + b y\label{eq:first} \\

0 & = & c x + d y\label{eq:second}

\end{eqnarray}

Solving equation \ref{eq:second} for x and substituting back into equation \ref{eq:first} yields

\begin{equation}

y = \frac{c}{cb-ad}

\end{equation}

# Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki

# Dependencies

Dependencies for this extension (org.xwiki.contrib.mathjax:macro-mathjax-ui 1.1.7):

- org.xwiki.platform:xwiki-platform-rendering-macro-velocity 14.10
- org.xwiki.rendering:xwiki-rendering-macro-html 14.10
- org.xwiki.platform:xwiki-platform-skin-skinx 14.10
- org.webjars.npm:mathjax 3.2.2
- org.xwiki.platform:xwiki-platform-rendering-wikimacro-store 14.10