Inisialisasi
<script>
window.MathJax = {
loader: {
load: [
'input/tex-full',
'[tex]/ams',
'[tex]/amscd',
'[tex]/mhchem',
'[tex]/physics',
'[tex]/newcommand',
'[tex]/noundefined',
'[tex]/require',
'[tex]/autoload',
'[tex]/configmacros',
'[tex]/action',
'[tex]/noerrors',
'output/chtml',
'a11y/explorer'
]
},
tex: {
inlineMath: [ ['[latex]','[/latex]']],
displayMath: [ ['[latex]','[/latex]']],
processEscapes: true,
packages: {
'[+]': ['ams','amscd','mhchem','amssymbols','physics','noerrors','noundefined','action']
},
macros: {
minormal: ["\{\\mathrm #1\}", 1],
sb: ["\{\_ \{#1\}\}", 1],
mn: ["\{\\mathrm #1\}", 1],
textellipsis: ["\{\\dots #1\}", 1],
}
},
svg: {
fontCache: 'global'
}
};
</script>
Konten Dinamis via Ajax
Setelah konten via ajax selesai diload, jalankan script berikut :
MathJax.texReset();
MathJax.typesetClear();
MathJax.typesetPromise().then(() => {
// modify the DOM here
MathJax.typesetPromise();
}).catch((err) => console.log(err.message));
Ukuran Huruf
Untuk mengubah ukuran huruf MathJax, dapat menggunakan CSS :
.MathJax {
font-size: 1.3em;
}
Referensi
- MathJax, http://docs.mathjax.org/en/v3.0-latest/
- LaTeX Tabular environment, https://github.com/mathjax/mathjax-docs/wiki/LaTeX-Tabular-environment
- coexist character MathJax - Latex, http://tancro.e-central.tv/grandmaster/textex/coexist-character.html