From 105444ee8eb73ef9df995b359a46d0faba386a06 Mon Sep 17 00:00:00 2001 From: giocaizzi Date: Tue, 3 Mar 2026 23:44:24 +0100 Subject: [PATCH] fix(docs): render LaTeX formulas and fix build warnings Add MathJax configuration script required by pymdownx.arithmatex generic mode. The config must load before MathJax to register the custom delimiters and arithmatex CSS class. Also fix unrecognized relative link warning for reference/ in index.md. Closes #59 Co-Authored-By: Claude Opus 4.6 --- docs/index.md | 2 +- docs/javascripts/mathjax.js | 19 +++++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 docs/javascripts/mathjax.js diff --git a/docs/index.md b/docs/index.md index 2ad6654..ccabc84 100644 --- a/docs/index.md +++ b/docs/index.md @@ -54,4 +54,4 @@ result = modeler.result # InterpolationResult with .interpolated array - [Installation](getting-started/installation.md) - [Quick Start](getting-started/quickstart.md) -- [API Reference](reference/) +- [API Reference](reference/index.md) diff --git a/docs/javascripts/mathjax.js b/docs/javascripts/mathjax.js new file mode 100644 index 0000000..5209b3c --- /dev/null +++ b/docs/javascripts/mathjax.js @@ -0,0 +1,19 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true, + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex", + }, +}; + +document$.subscribe(() => { + MathJax.startup.output.clearCache(); + MathJax.typesetClear(); + MathJax.texReset(); + MathJax.typesetPromise(); +}); diff --git a/mkdocs.yml b/mkdocs.yml index 5546aef..b81c792 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -69,6 +69,7 @@ markdown_extensions: - toc: { permalink: true } extra_javascript: + - javascripts/mathjax.js - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js nav: