Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: LaTeX numbered equations (#733)

Myles Scolnick3d980d0ee688
diff --git a/frontend/src/css/katex.min.css b/frontend/src/css/katex.min.css
index 0d6c0318f9..5de68f37be 100644
--- a/frontend/src/css/katex.min.css
+++ b/frontend/src/css/katex.min.css
@@ -1,3 +1,5 @@
+/* Slightly adapted from https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css */
+
@font-face {
font-family: "KaTeX_AMS";
font-style: normal;
@@ -229,7 +231,7 @@
}
.katex .katex-version::after {
- content: "0.16.0";
+ content: "0.16.9";
}
.katex .katex-mathml {
@@ -317,6 +319,12 @@
font-family: "KaTeX_Fraktur";
}
+.katex .mathboldfrak,
+.katex .textboldfrak {
+ font-family: "KaTeX_Fraktur";
+ font-weight: 700;
+}
+
.katex .mathtt {
font-family: "KaTeX_Typewriter";
}
@@ -1384,6 +1392,7 @@
text-align: left;
}
-body {
+body,
+.katex-display {
counter-reset: katexEqnNo mmlEqnNo;
}
diff --git a/marimo/_smoke_tests/latex.py b/marimo/_smoke_tests/latex.py
new file mode 100644
index 0000000000..a3a2908432
--- /dev/null
+++ b/marimo/_smoke_tests/latex.py
@@ -0,0 +1,39 @@
+import marimo
+
+__generated_with = "0.2.1"
+app = marimo.App()
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+def __(mo):
+ mo.md(
+ """
+ # Incrementing functions
+ Bug from [#704](https://github.com/marimo-team/marimo/discussions/704)
+ """
+ )
+ return
+
+
+def __(mo):
+ mo.md(
+ r"""
+ \begin{align}
+ B' &=-\nabla \times E,\\
+ E' &=\nabla \times B - 4\pi j\\
+ e^{\pi i} + 1 = 0
+ \end{align}
+ """
+ )
+ return
+
+
+if __name__ == "__main__":
+ app.run()