16 lines
422 B
JavaScript
16 lines
422 B
JavaScript
$("script[type='math/tex']").replaceWith(
|
|
function(){
|
|
var tex = $(this).text();
|
|
return "<span class=\"inline-equation\">" +
|
|
katex.renderToString(tex) +
|
|
"</span>";
|
|
});
|
|
|
|
$("script[type='math/tex; mode=display']").replaceWith(
|
|
function(){
|
|
var tex = $(this).text();
|
|
return "<div class=\"equation\">" +
|
|
katex.renderToString("\\displaystyle "+tex) +
|
|
"</div>";
|
|
});
|