javascriptlatexmathquill

How to type \sqrt[3]{64}=4 in math quill


If you paste that code \sqrt[3]{64}=4 its working good. enter image description here

But at the time of writing the input \sqrt[3]{64}=4, the root is not renderd as expected. How can I get the result like in the picture above at the time of typing?

This is my code:

  var mathFieldSpan = document.getElementById('math-field');
  var MQ = MathQuill.getInterface(2); // for backcompat
  var mathField = MQ.MathField(mathFieldSpan, {
    spaceBehavesLikeTab: true, // configurable
   
  });
#math-field{
 	position:absolute;
     width:65%;
     left:40px;
     height:40px;  
     border-radius:5px;
     box-shadow:none;
     outline:none;
   font-family:Lato,sans-serif;color:#767676;font-weight:400;
    border:2px solid #20BF9F;
    font-size:15px;
    
    transition:all 0.5s ease-out;
    
    }
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://mathquill.com/lib/mathquill.css">
<script type="text/javascript" src="http://mathquill.com/lib/mathquill.js"></script>
  <span id="math-field" ></span>
 


Solution

  • You can achieve this when typing: \nthroot3{64}=4.
    Note that the latex of the mathfield is converted to: \sqrt[3]{64}=4.