Fix problem pdf
This commit is contained in:
parent
c87566673a
commit
031e4f5f6b
2 changed files with 16 additions and 7 deletions
|
@ -1,13 +1,20 @@
|
|||
window.renderKatex = (elem=document.body) => {
|
||||
var maths = document.querySelectorAll('.arithmatex'),
|
||||
tex;
|
||||
console.log(maths);
|
||||
for (var i = 0; i < maths.length; i++) {
|
||||
tex = maths[i].textContent || maths[i].innerText;
|
||||
if (tex.startsWith('\\(') && tex.endsWith('\\)')) {
|
||||
katex.render(tex.slice(2, -2), maths[i], {'displayMode': false, 'throwOnError': false});
|
||||
katex.render(tex.slice(2, -2), maths[i], {
|
||||
'displayMode': false,
|
||||
'throwOnError': false,
|
||||
'strict': false,
|
||||
});
|
||||
} else if (tex.startsWith('\\[') && tex.endsWith('\\]')) {
|
||||
katex.render(tex.slice(2, -2), maths[i], {'displayMode': true, 'throwOnError': false});
|
||||
katex.render(tex.slice(2, -2), maths[i], {
|
||||
'displayMode': true,
|
||||
'throwOnError': false,
|
||||
'strict': false,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue