Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display MathJax expression on the same line of the statement

Tags:

mathjax

see the coding snippet

<div id="MathOutput" class="output">What will be the output of  $${x^2}$$</div>

This displays the string "What will be the output of" on a single line and the expression on the second line enter image description here

How can I make the expression display beside the line in continuation?

like image 485
Ck Maurya Avatar asked Oct 16 '14 07:10

Ck Maurya


1 Answers

Use $x^2$ or \(x^2\) rather than $$x^2$$. The single dollars are for in-line math equations, and double dollars are for equations displayed on a separate line.

Single dollars are not enabled by default in MathJax, so if you want to use those, you need to include them in the inlineMath array in your tex2jax block in your MathJax configuration. See the tex2jax documentation for details.

like image 86
Davide Cervone Avatar answered Sep 30 '22 16:09

Davide Cervone