Menu

Usage

Johnny Tremblay

jquery-mathview

The Tool

Jquery-mathview is a tool wich allow to visualize and write an equation in LaTeX. Although it has been made for WeBWorK, it can easily fit in any websites. It is made of a "window" appearing beside the textbox containing the latex code. The tool is using Mathjax as renderer for the equation.

Context

Jquery-mathview has been created in a programming course. The main goal of the tool was to facilitate the use of WeBWorK so that frenches schools could use it. It is a part of a bigger project wich includes the traduction of the whole software.

Adding Jquery-mathview to your website

  1. First of all, make sure your page include Mathjax and jQuery:

  2. Add the lines:

    <script type="text/javascript" src="operations.js"></script>
    <script type="text/javascript" src="jquery-mathview-1.0.0.js?auto=4"></script>  
    <script type="text/javascript">
        $(
        function() 
        {
             //Enter here your code to select your textbox. See number 3  
        });         
    </script>
  • Code to select your textbox:
    • You have to get all the textbox you want to decorate with the tool. Do it the way you like.
    • Once you know how you'll pick these textbox, you just have to call the function addMathEditor() this way:

      ~~~~~~
      $('#yourIDName').addMathEditor();

      or
      

      $('.yourClassName').addMathEditor();
      ~~~~~~

LATEX and PG

Mathjax works with LAtex, but Jquery-mathview can convert PG to Latex so that Mathjax can render it. PG is a math langage included in WeBWorK. Although, some of the code is present, there's a missing file so the PG won't work unless you're working on WeBWorK. Anyways, stick with LATEX.