मैं टाइप करते समय पूर्वावलोकन के लिए इस मैथजेक्स उदाहरण को कैसे संशोधित करूं? अभी एंटर दबाए जाने के बाद ही परिणाम दिखाता है। मैं इसे ट्विक करना चाहता हूं ताकि यह एक प्रश्न टाइप करते समय स्टैक ओवरफ्लो/math.stackexchange पूर्वावलोकन दिखाता है।रीयलटाइम में mathjax आउटपुट प्रदर्शित करें
<html>
<head>
<title>MathJax Dynamic Math Test Page</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [["$","$"],["\\(","\\)"]]
}
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full">
</script>
</head>
<body>
<script>
//
// Use a closure to hide the local variables from the
// global namespace
//
(function() {
var QUEUE = MathJax.Hub.queue; // shorthand for the queue
var math = null; // the element jax for the math output.
//
// Get the element jax when MathJax has produced it.
//
QUEUE.Push(function() {
math = MathJax.Hub.getAllJax("MathOutput")[0];
});
//
// The onchange event handler that typesets the
// math entered by the user
//
window.UpdateMath = function (TeX) {
QUEUE.Push(["Text",math,"\\displaystyle{"+TeX+"}"]);
}
})();
</script>
Type some TeX code:
<input id="MathInput" size="50" onchange="UpdateMath(this.value)" />
<p>
<div id="MathOutput">
You typed: ${}$
</div>
</body>
</html>
हाँ, क्योंकि 'ऑनचेंज' केवल तब होता है जब एंटर कुंजी दबाया जाता है या जब फ़ील्ड धुंधला हो जाता है। – think123
भविष्य से नोट करें: cdn.mathjax.org इसके अंत-जीवन के करीब है, माइग्रेशन युक्तियों के लिए https://www.mathjax.org/cdn-shutting-down/ देखें। –
@ पीटर Krautzberger एक WordPress साइट में MathJax के लाइव पूर्वावलोकन को दिखाने का सबसे अच्छा तरीका क्या है जिसमें गणित सूत्रों के साथ प्रश्न/टिप्पणियां लिखने के लिए इनपुट फ़ील्ड है। पूर्ण शुरुआत के लिए, कृपया कुछ "यदि" और "कहां" टाइप करें, तो कुछ स्क्रिप्ट टाइप करें, यदि कोई हो। धन्यवाद – user12345