1
votes

I'm developing a math web page. There are textareas created on click, depending on the user needs, in this particular case I know that one text box is the numerator and the other is the denominator of an integral. After the user types this information in the text boxes and click in a bottom I would like to render, using MathJax: (\ \int {text1 \over text2} ). The variables are all good, but it is not being displayed in the mathematical format that MathJax offers.

var numerador = $("#numerador_"+i).val();
var denominador = $("#denominador_"+i).val();
var resHeviside = '<div class="row-fluid"><div class="span11">' +
                    '<div class="row-fluid" id="pasoH_'+contador+'">' +
                      '<div class="span2"><p class="porPartes">Integral '+i+':</p></div>' +
                      '<div class="span3"><p class="algo" id="IntHevi_'+i+'">\\( { '+numerador+' \\over '+denominador+' } \\)</p></div>' +
                      '<div class="span1 regla" id="drop_'+contadorDroppables+'"/></div>' +
                    '</div>' +
                    '<div class="span1"><button class="algo" id="addRow_'+contador+'">+</button></div>' +
                '</div>';
$("#Ejer_"+id).append(resHeviside);
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"#IntHevi_"+i]);

All this is generated by a function on click. The result is being rendered like this: ( { 4 \over x^2 } ) for numerator 4 and denominator x^2. Any idea of what I'm missing?

1

1 Answers

0
votes

I just got it right, Though I don't exactly understand why it wasn't working before. I just moved the MathJax Typeset method below some other commands, but still in the same function. Commands of no actual importance to the

being affected, like disabling some bottoms.