Latex code with \ stored in java script array not working

13 views
Skip to first unread message

visha...@gmail.com

unread,
Apr 1, 2018, 6:07:17 AM4/1/18
to MathJax Users
I have stored the equations in java script array  ex"\\(\frac{1}{2}\\)","\\(\Delta\\)" are not being displayed ..insted it displays ...rac12  ..please suggest corrections.

David Farmer

unread,
Apr 1, 2018, 7:08:47 AM4/1/18
to MathJax Users

Maybe double all the backslashes?

\\\\(\\frac{1}{2}\\\\)","\\\\(\\Delta\\\\)



On Sun, 1 Apr 2018, visha...@gmail.com wrote:

> I have stored the equations in java script array  ex"\\(\frac{1}{2}\\)","\\(\Delta\\)" are not being
> displayed ..insted it displays ...rac12  ..please suggest corrections.
>
> --
> 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.
>
>

VISHAL PAWAR

unread,
Apr 1, 2018, 7:22:21 AM4/1/18
to mathja...@googlegroups.com
it's not working..

On Sun, Apr 1, 2018 at 4:38 PM, David Farmer <far...@aimath.org> wrote:

Maybe double all the backslashes?

\\\\(\\frac{1}{2}\\\\)","\\\\(\\Delta\\\\)



On Sun, 1 Apr 2018, visha...@gmail.com wrote:

I have stored the equations in java script array  ex"\\(\frac{1}{2}\\)","\\(\Delta\\)" are not being
displayed ..insted it displays ...rac12  ..please suggest corrections.

--
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

For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
With Regards,

VISHAL PAWAR

David Farmer

unread,
Apr 1, 2018, 7:26:51 AM4/1/18
to mathja...@googlegroups.com

"Not working" is not a helpful way to describe your problem.

Probably only some of the backslashes in your original
example need to be doubled.

If fiddling around with doubling some of the backslashes does
not work, then provide a live example.

On Sun, 1 Apr 2018, VISHAL PAWAR wrote:

> it's not working..
>
> On Sun, Apr 1, 2018 at 4:38 PM, David Farmer <far...@aimath.org> wrote:
>
> Maybe double all the backslashes?
>
> \\\\(\\frac{1}{2}\\\\)","\\\\(\\Delta\\\\)
>
>
>
> On Sun, 1 Apr 2018, visha...@gmail.com wrote:
>
> I have stored the equations in java script array 
> ex"\\(\frac{1}{2}\\)","\\(\Delta\\)" are not being
> displayed ..insted it displays ...rac12  ..please suggest corrections.
>
> --
> 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.
>
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups
> "MathJax Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mathjax-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> With Regards,
>
> VISHAL PAWAR
>
> --
> 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.

VISHAL PAWAR

unread,
Apr 1, 2018, 8:06:16 AM4/1/18
to mathja...@googlegroups.com
Here is the code i have used

Javascript code

************************************
i=0;
var questions = [
    ["\\(\frac{1}{2}\\)","\\(\frac{1}{2}\\)","12","14","18","C"],
];
//function myfunc(clkid){
// alert(clkid);
// }

function renderquestion(){
document.getElementById("test").innerHTML="Q "+ (i+1) + "/" + (questions.length);
document.getElementById("question").innerHTML=questions[i][0];
document.getElementById("chA").innerHTML="A "+ " . "+questions[i][1];
document.getElementById("chB").innerHTML="B "+ " . "+questions[i][2];
document.getElementById("chC").innerHTML="C "+ " . "+questions[i][3];
document.getElementById("chD").innerHTML="D "+ " . "+questions[i][4];
}

window.addEventListener("load",renderquestion,false);


************************************

On Sun, Apr 1, 2018 at 4:56 PM, David Farmer <far...@aimath.org> wrote:

"Not working" is not a helpful way to describe your problem.

Probably only some of the backslashes in your original
example need to be doubled.

If fiddling around with doubling some of the backslashes does
not work, then provide a live example.


On Sun, 1 Apr 2018, VISHAL PAWAR wrote:

it's not working..

On Sun, Apr 1, 2018 at 4:38 PM, David Farmer <far...@aimath.org> wrote:

      Maybe double all the backslashes?

      \\\\(\\frac{1}{2}\\\\)","\\\\(\\Delta\\\\)



      On Sun, 1 Apr 2018, visha...@gmail.com wrote:

            I have stored the equations in java script array 
            ex"\\(\frac{1}{2}\\)","\\(\Delta\\)" are not being
            displayed ..insted it displays ...rac12  ..please suggest corrections.

            --
            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

            For more options, visit https://groups.google.com/d/optout.



      --
      You received this message because you are subscribed to a topic in the Google Groups
      "MathJax Users" group.
      To unsubscribe from this topic, visit
      https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
      To unsubscribe from this group and all its topics, send an email to

      For more options, visit https://groups.google.com/d/optout.




--
With Regards,

VISHAL PAWAR

--
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

For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
exp1.html
exp1.css

David Farmer

unread,
Apr 1, 2018, 8:45:42 AM4/1/18
to mathja...@googlegroups.com

And I suggested that for some of the backslashes, such as the one
one in front of "frac", that you put two backslashes instead of
one backslash.

Try that and carefully examine how the output changes.

If you end up with the required number of backslashes in
the output, but the math does not render as you expect,
then you need to call MathJax to render the content before
you display it.

But first, spend some time adding more backslashes and looking at the
effect on the output.
>             mathjax-user...@googlegroups.com.
>             For more options, visit https://groups.google.com/d/optout.
>
>
>
>       --
>       You received this message because you are subscribed to a topic in the
> Google Groups
>       "MathJax Users" group.
>       To unsubscribe from this topic, visit
>      
> https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
>       To unsubscribe from this group and all its topics, send an email to
>       mathjax-user...@googlegroups.com.
>       For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> With Regards,
>
> VISHAL PAWAR
>
> --
> 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.
>
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups
> "MathJax Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mathjax-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> With Regards,
>
> VISHAL PAWAR
>
> --
> 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.

VISHAL PAWAR

unread,
Apr 1, 2018, 12:31:14 PM4/1/18
to mathja...@googlegroups.com
Thanks a lot..it worked.

                        mathjax-users+unsubscribe@googlegroups.com.

                        For more options, visit https://groups.google.com/d/optout.



                  --
                  You received this message because you are subscribed to a topic in the
            Google Groups
                  "MathJax Users" group.
                  To unsubscribe from this topic, visit
                 
            https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
                  To unsubscribe from this group and all its topics, send an email to
                  mathjax-users+unsubscribe@googlegroups.com.

                  For more options, visit https://groups.google.com/d/optout.




            --
            With Regards,

            VISHAL PAWAR

            --
            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

            For more options, visit https://groups.google.com/d/optout.



      --
      You received this message because you are subscribed to a topic in the Google Groups
      "MathJax Users" group.
      To unsubscribe from this topic, visit
      https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
      To unsubscribe from this group and all its topics, send an email to

      For more options, visit https://groups.google.com/d/optout.




--
With Regards,

VISHAL PAWAR

--
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

For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/RHpuZFGLMGo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages