mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-05 02:31:40 -05:00
c997d1dc2b
GitOrigin-RevId: 32a43361cfc883aa1a5ed85f6be5432b6e838b9d
17 lines
553 B
TypeScript
17 lines
553 B
TypeScript
import { loadMathJax } from '@/features/mathjax/load-mathjax'
|
|
import { debugConsole } from '@/utils/debugging'
|
|
import getMeta from '@/utils/meta'
|
|
|
|
window.addEventListener('DOMContentLoaded', function () {
|
|
const elements = document.querySelectorAll('[data-ol-mathjax]')
|
|
if (elements.length > 0) {
|
|
loadMathJax({
|
|
enableMenu: true,
|
|
numbering: 'ams',
|
|
singleDollar: !getMeta('ol-no-single-dollar'),
|
|
useLabelIds: true,
|
|
})
|
|
.then(MathJax => MathJax.typesetPromise([...elements]))
|
|
.catch(debugConsole.error)
|
|
}
|
|
})
|