aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-08-11 17:35:56 -0700
committerJohn MacFarlane <[email protected]>2025-08-11 17:40:41 -0700
commit0bbbdbcdb6282c7f63bdc9617455ec088fe7779b (patch)
tree0e1bd192bb2b687d1d205eab3898d6f27ae81135 /test
parent6b2f66507a04b9071fdc2580488594f050ff4a83 (diff)
LaTeX reader/writer: change handling of math environments.
Certain environments in LaTeX will trigger math mode and can't occur within math mode: e.g., `align` or `equation`. Previously we "downshifted" these, parsing an `align` environment as a Math element with `aligned`, and an `equation` environment as a regular display math element. With this shift, we put these in Math inlines but retain the original environments. This works because: 1) texmath handles these environments just fine, 2) and so does MathJax; 3) when writing LaTeX we detect these environments in Math elements and emit them verbatim instead of putting them in `$..$` or `$$..$$`. Closes #9711. Closes #9296.
Diffstat (limited to 'test')
-rw-r--r--test/command/10160.md6
-rw-r--r--test/command/3113.md2
-rw-r--r--test/command/7512.md7
-rw-r--r--test/command/982.md6
-rw-r--r--test/command/macros.md4
-rw-r--r--test/command/refs.md2
6 files changed, 20 insertions, 7 deletions
diff --git a/test/command/10160.md b/test/command/10160.md
index fa3e97cd5..52e512b5a 100644
--- a/test/command/10160.md
+++ b/test/command/10160.md
@@ -7,5 +7,9 @@
\begin{table}[h]
\end{table}
^D
-[ Para [ Math DisplayMath "[0,1)" ] ]
+[ Para
+ [ Math
+ DisplayMath "\\begin{equation}\n [0,1)\n\\end{equation}"
+ ]
+]
```
diff --git a/test/command/3113.md b/test/command/3113.md
index 7746ec14f..96403905e 100644
--- a/test/command/3113.md
+++ b/test/command/3113.md
@@ -11,7 +11,7 @@ E&=&F
[ Para
[ Math
DisplayMath
- "\\begin{aligned}\nA&=&B,\\\\\nC&=&D,\\\\\n%\\end{eqnarray}\n%\\begin{eqnarray}\nE&=&F\n\\end{aligned}"
+ "\\begin{eqnarray}\nA&=&B,\\\\\nC&=&D,\\\\\n%\\end{eqnarray}\n%\\begin{eqnarray}\nE&=&F\n\\end{eqnarray}"
]
]
```
diff --git a/test/command/7512.md b/test/command/7512.md
index 032cfe565..618739acd 100644
--- a/test/command/7512.md
+++ b/test/command/7512.md
@@ -4,7 +4,12 @@
[d,\delta]=0.
\end{equation*}
^D
-[ Para [ Math DisplayMath "[d,\\delta]=0." ] ]
+[ Para
+ [ Math
+ DisplayMath
+ "\\begin{equation*}\n[d,\\delta]=0.\n\\end{equation*}"
+ ]
+]
```
```
diff --git a/test/command/982.md b/test/command/982.md
index 4b997c4c4..bc18fc11c 100644
--- a/test/command/982.md
+++ b/test/command/982.md
@@ -7,5 +7,9 @@
y=x^2
\EEQ
^D
-[ Para [ Math DisplayMath "y=x^2" ] ]
+[ Para
+ [ Math
+ DisplayMath "\\begin{equation}\ny=x^2\n\\end{equation}"
+ ]
+]
```
diff --git a/test/command/macros.md b/test/command/macros.md
index 86f10ea1b..d90498e35 100644
--- a/test/command/macros.md
+++ b/test/command/macros.md
@@ -61,9 +61,9 @@ x &= y\\
^D
\(5-67\)
-\[\begin{aligned}
+\begin{align}
x &= y\\
-\end{aligned}\]
+\end{align}
\emph{hi}
diff --git a/test/command/refs.md b/test/command/refs.md
index f54f4fa8d..63daf81a7 100644
--- a/test/command/refs.md
+++ b/test/command/refs.md
@@ -118,7 +118,7 @@ Accuracy~\eqref{eq:Accuracy} is the proportion, measuring true results among all
, Para
[ Math
DisplayMath
- "\\label{eq:Accuracy}\n Accuracy = \\frac{t_p + t_n}{t_p + f_p + f_n + t_n}"
+ "\\begin{equation}\n \\label{eq:Accuracy}\n Accuracy = \\frac{t_p + t_n}{t_p + f_p + f_n + t_n}\n\\end{equation}"
]
]
```