From 9c2f993d8fa4cc7cfb981fdd3e1cf96b28224337 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Mon, 24 Mar 2025 10:28:03 -0400 Subject: [PATCH] feat(economics): models of production update latex labels --- scripts/posts/models-of-production.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/posts/models-of-production.js b/scripts/posts/models-of-production.js index 29bd8ee..eb14c46 100644 --- a/scripts/posts/models-of-production.js +++ b/scripts/posts/models-of-production.js @@ -662,3 +662,19 @@ document.addEventListener("DOMContentLoaded", function () { drawRomerSolowChangeGraph(); window.onresize = drawRomerSolowChangeGraph(); }); + +document.addEventListener("DOMContentLoaded", function () { + MathJax.typeset() + document.querySelectorAll(".sliders").forEach((slidersDiv) => { + slidersDiv.addEventListener("input", function (event) { + const graphDiv = slidersDiv.previousElementSibling; + if (graphDiv && graphDiv.querySelector("svg")) { + const svg = graphDiv.querySelector("svg"); + svg.querySelectorAll("foreignObject body").forEach((body) => { + MathJax.typesetPromise([body]); + }); + } + }); + }); +}); +