export const TypeSet = async function (elements: any) {
  try {
    if (!window.MathJax) {
      return
    }
    window.MathJax.startup.promise = window.MathJax.startup.promise
      .then(() => {
        return window.MathJax.typesetPromise(elements)
      })
      .catch((err: any) => console.log('Typeset failed: ' + err.message))
    return window.MathJax.startup.promise
  } catch {}
}
