From 0c92bc4e1907576be299f8ac7c6f9e625d3515fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CKatrinBistreck=E2=80=9D?=
 <“katrin.bistreck@tuhh.de”>
Date: Tue, 4 Feb 2025 15:44:23 +0100
Subject: [PATCH] Adds mathjax

---
 docs/assets/javascripts/mathjax.js            | 19 +++++++++++++++
 .../ecological_assessment/basic-concepts.md   | 24 ++++++++++---------
 mkdocs.yml                                    |  2 ++
 3 files changed, 34 insertions(+), 11 deletions(-)
 create mode 100644 docs/assets/javascripts/mathjax.js

diff --git a/docs/assets/javascripts/mathjax.js b/docs/assets/javascripts/mathjax.js
new file mode 100644
index 0000000..0679bf6
--- /dev/null
+++ b/docs/assets/javascripts/mathjax.js
@@ -0,0 +1,19 @@
+window.MathJax = {
+  tex: {
+    inlineMath: [["$", "$"]],
+    displayMath: [["$$", "$$"]],
+    processEscapes: true,
+    processEnvironments: true
+  },
+  options: {
+    ignoreHtmlClass: ".*",
+    processHtmlClass: "mathjax-render"
+  }
+};
+
+document$.subscribe(() => {
+  MathJax.startup.output.clearCache()
+  MathJax.typesetClear()
+  MathJax.texReset()
+  MathJax.typesetPromise()
+})
\ No newline at end of file
diff --git a/docs/documentation/analysis/ecological_assessment/basic-concepts.md b/docs/documentation/analysis/ecological_assessment/basic-concepts.md
index cfef150..5c78702 100644
--- a/docs/documentation/analysis/ecological_assessment/basic-concepts.md
+++ b/docs/documentation/analysis/ecological_assessment/basic-concepts.md
@@ -574,11 +574,11 @@ with
 
 The forcing factors can be interpolated from given data and average values per mission are determined, considering climb, cruise and approach phase.
 
-In a next step, the radiative forcing is normalized with the species' efficacy f and $RF_{2xCO_2}$, the RF which would result from a doubling of CO2:
+In a next step, the radiative forcing is normalized with the species' efficacy f and $RF_{2\times CO_2}$, the RF which would result from a doubling of CO2:
 
-$$
-  RF^{*}_{i}(t,h) = f_i \cdot \frac{RF_i(t,h)}{RF_{2xCO_2}}
-$$
+<div class="mathjax-render">
+$ RF^{*}_{i}(t,h) = f_i \cdot \frac{RF_i(t,h)}{RF_{\left(2 \times CO_2\right)}} $
+</div>
 
 With these values, a temperature change can be determined:
 
@@ -597,12 +597,14 @@ $\Delta T_{weighted}(t) = \Delta T(t) \cdot w(t)$
 
 with the weighting function:
 
-$w(t) = \begin{cases}
-      1, & t < H \\
-      \frac{1}{(1 + r)^{(t - H)}}, & H < t\le t_{max}\\
-      0, & t > t_{max}
-      \end{cases}
-$
+<div class="mathjax-render">
+  $ w(t) = \begin{cases}
+        1, & t < H \\
+        \frac{1}{(1 + r)^{(t - H)}}, & H < t\le t_{max}\\
+        0, & t > t_{max}
+        \end{cases}
+  $
+</div>
 
 with
 
@@ -613,7 +615,7 @@ with
 
 In a last step, the average temperature response ATR is calculated:
 
-$ATR_i = \frac{1}{H} \cdot \int_{0}^{t_{max}} \Delta T_{weighted}(t) $
+$ ATR_i = \frac{1}{H} \cdot \int_{0}^{t_{max}} \Delta T_{weighted}(t) $
 
 The overall ATR is then:
 
diff --git a/mkdocs.yml b/mkdocs.yml
index 0282aae..367eebe 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -53,6 +53,8 @@ extra_javascript:
   - assets/javascripts/katex.js           # Local KaTeX script.
   - https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.js  # CDN KaTeX script (same as local but hosted externally).
   - https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/contrib/auto-render.min.js  # KaTeX auto-render script (converts Latex syntax in formatted math).
+  - assets/javascripts/mathjax.js         # Local MathJax script
+  - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js  # MathJax renderer can be used for more complex formulas
 
 # Additional CSS files to include for styling of website and mathematical notations (font, size etc.)
 extra_css:
-- 
GitLab