mathjax with table

312 views
Skip to first unread message

kal_e...@yahoo.com

unread,
Mar 6, 2016, 11:03:46 AM3/6/16
to MathJax Users
I have a table where I am trying to include mathjax. The user should be able to type latex into a cell and it displays properly. Currently, it will display properly for the first latex equation entered into a cell however, if I type another equation into a different cell then it will display same answer in both cell.

Example: 
user enters \pi into cell 1. 
cell 1 gets rendered.
cell 1 displays pi.
user enters \frac {1} {2} into cell 1
cell 1 gets rendered.
cell 1 displays \frac {1} {2}
user enters \frac {pi} {4} into cell 2
cell 1 and cell 2 re-render and display \frac {pi} {4}


this is my current code:

<div id="MathOutput" style="display:none;">$${}$$
  </div>


//called whenever user enters formula into a cell
MathEnteredInCell = function (formula)
  {
  MathJax.Hub.queue.Push( function ()
  {
  math = MathJax.Hub.getAllJax("MathOutput")[0];
  } );
 
     MathJax.Hub.queue.Push(["resetEquationNumbers", MathJax.InputJax.TeX], ["Text", math, "\\displaystyle{" + formula + "}"]);
    
    return $('#MathOutput').html();
  };

I tried to copy MathOutput and then return the copy and remove() MathOutput but that doesn't work either. I don't want to put a div into every cell. Am i doing this completely wrong? I am new to mathjax
Anyone have ideas ?

Not So Cheerio

unread,
Mar 6, 2016, 11:13:02 AM3/6/16
to MathJax Users
I guess the problem is that whenever I change the value in 1 cell. The entire page is re-rendered so all the cells get the most recent value from MathOutput. Can I set MathJax to only render the cell currently being modified instead of the entire page?

Peter Krautzberger

unread,
Mar 7, 2016, 3:40:44 AM3/7/16
to mathja...@googlegroups.com
Hi,

You might want to add a live example of what you've tried via jsbin, codepen etc.

Regards,
Peter.

On Sun, Mar 6, 2016 at 5:13 PM, 'Not So Cheerio' via MathJax Users <mathja...@googlegroups.com> wrote:
I guess the problem is that whenever I change the value in 1 cell. The entire page is re-rendered so all the cells get the most recent value from MathOutput. Can I set MathJax to only render the cell currently being modified instead of the entire page?

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages