0

AMP doesn't allow custom javascript and so I cannot use MathJax or similar solutions to display Latex maths equations on my website.

Is there a workaround to this? Otherwise, are there reasonable non-javascript solutions to having math equations in HTML?

Brian C.
  • 1
  • 2

1 Answers1

0

You are correct that AMP doesn't support custom javascript. Based on this documentation, instead of using JavaScript, interactive page features are handled in custom AMP elements. The custom AMP elements may have JavaScript under the hood, but they’re carefully designed to make sure they don’t cause performance degradation.

The AMP pages only allow third-party JavaScript but only in sandboxed iframes. By restricting them to iframes, they can’t block the execution of the main page. Even if they trigger multiple style re-calculations, their tiny iframes have very little DOM.

Check this SO question, if it can help you in math equations.

Community
  • 1
  • 1
KENdi
  • 7,576
  • 2
  • 16
  • 31