* add math typesetting support with KaTex * Simplified the syntax for checking "math" property * save katex files to local * use local katex file to render math typesetting * revert changes in scripts.html and styles.html * Save math.js as a file, not inline script. * move it into "assets/js" folder * Load all necessary scripts and styles in math.html
23 lines
656 B
JavaScript
23 lines
656 B
JavaScript
/**
|
|
* @file
|
|
* A JavaScript file for render math with KaTex.
|
|
*/
|
|
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
renderMathInElement(document.body, {
|
|
// customised options
|
|
// • auto-render specific keys, e.g.:
|
|
delimiters: [{left: '$$', right: '$$', display: true}, {
|
|
left: '$',
|
|
right: '$',
|
|
display: false
|
|
}, {left: '\\(', right: '\\)', display: false}, {left: '\\[', right: '\\]', display: true}],
|
|
// • rendering keys, e.g.:
|
|
throwOnError: false
|
|
});
|
|
});
|
|
})();
|