Math Behavior
To install this JPSWiki extension, you will need Admin rights; and have the Haddock Template activated.

See MathJax™ for more detailed documentation.
MathJax™ uses CSS with web fonts or SVG, instead of bitmap images or Flash, so equations scale with surrounding text at all zoom levels.

Math Behavior is a JSPWiki javascript extension which allows to add math equations in TeX, LaTeX or ASCIImath format.

Find below the installation instructions. See Math for how-to-use examples.

How to install the MathJax behavior#

Step 1: Create a JS file#

Create a javascript behavior file MathJax.js with the following code snippet and put it in <your-wiki-site>/scripts folder. This implementation automatically pulls the library from the MathJax distributed network service(// so you don't need to install anything locally.


Step 2: Update JSP file#

Add following lines to <your-wiki-site>/templates/haddock/commonheader.jsp.

  <!-- existing line -->
  <script async src="<wiki:Link format='url' jsp='scripts/haddock.js'/>"></script>
  <!-- add this line -->
  <script src="<wiki:Link format='url' jsp='scripts/MathJax.js'/>" ></script>

And do the same in <your-wiki-site>/templates/reader/ViewTemplate.js.

You are now ready to render Math formulae on your wiki-pages !
No need to restart your JSPWiki server.

Category.Haddock Behavior