I'm using MathJax to display math in a webpage. My MathJax code looks like this:
<script type="text/javascript" src=".js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript"
src=".js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
</script>
MathJax seems to work great, however I simply can't figure out how on earth to write multi-line equations. For example, this multi-line equation doesn't render properly. The entire equation is on one line instead of 3:
$$
\begin{eqnarray}
y &=& x^4 + 4 \nonumber \\
&=& (x^2+2)^2 -4x^2 \nonumber \\
&\le&(x^2+2)^2 \nonumber
\end{eqnarray}
$$
I'm using MathJax to display math in a webpage. My MathJax code looks like this:
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
</script>
MathJax seems to work great, however I simply can't figure out how on earth to write multi-line equations. For example, this multi-line equation doesn't render properly. The entire equation is on one line instead of 3:
$$
\begin{eqnarray}
y &=& x^4 + 4 \nonumber \\
&=& (x^2+2)^2 -4x^2 \nonumber \\
&\le&(x^2+2)^2 \nonumber
\end{eqnarray}
$$
Share
Improve this question
edited Sep 17, 2013 at 22:22
turtle
asked Sep 17, 2013 at 22:06
turtleturtle
8,07320 gold badges70 silver badges103 bronze badges
7
|
Show 2 more comments
2 Answers
Reset to default 15The $$ wants to be touching the math in order to be recognized as delimiters. To make your sample work, remove the newlines after/before the opening/closing $$:
$$\begin{eqnarray}
y &=& x^4 + 4 \nonumber \\
&=& (x^2+2)^2 -4x^2 \nonumber \\
&\le&(x^2+2)^2 \nonumber
\end{eqnarray}$$
(This works for me using Marked2 in MathJax mode):
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: false,
}
})
\[
to open and\]
to close, does it work with those? – Mike 'Pomax' Kamermans Commented Sep 17, 2013 at 22:13\\
is being turned into\
. Use the MathJax contextual menu to view the TeX source of your equation and see if the double backslashes are really there. I'll bet they are single ones. You may also lose all the other backslashes, too. So it may be that you have to double them all. – Davide Cervone Commented Sep 19, 2013 at 9:55