Skip to content

Instantly share code, notes, and snippets.

@bjones1
Created November 15, 2024 16:32
Show Gist options
  • Save bjones1/64630a16473436307767109b0c04fd3d to your computer and use it in GitHub Desktop.
Save bjones1/64630a16473436307767109b0c04fd3d to your computer and use it in GitHub Desktop.
MathJax 4.0.0-beta7 rendering errors in iframe
<!DOCTYPE html>
<html>
<head>
<title>MathJax in iframe</title>
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};
</script>
<!-- <script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/[email protected]/tex-chtml.js"></script> -->
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-chtml.js"></script>
</head>
<body>
<iframe
srcdoc="<!DOCTYPE html>
<html>
<body>
<p>$\frac{a}{b}$</p>
<script>setTimeout(() => parent.window.MathJax.typesetPromise([document.body]), 1000)</script>
</body>
</html>"
>
</iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment