Skip to content

Commit 1e4dcad

Browse files
authored
Merge pull request #12769 from mcanouil/fix/issue12766
fix: use consistent equation numbering display for `html-math-method` and `html-math-method.method` (MathJax and KaTeX)
2 parents d06ccf5 + d4d50cb commit 1e4dcad

File tree

6 files changed

+74
-0
lines changed

6 files changed

+74
-0
lines changed

news/changelog-1.8.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ All changes included in 1.8:
1616
- ([#12259](https://github.com/quarto-dev/quarto-cli/issues/12259)): Fix conflict between `html-math-method: katex` and crossref popups (author: @benkeks).
1717
- ([#12734](https://github.com/quarto-dev/quarto-cli/issues/12734)): `highlight-style` now correctly supports setting a different `light` and `dark`.
1818
- ([#12747](https://github.com/quarto-dev/quarto-cli/issues/12747)): Ensure `th` elements are properly restored when Quarto's HTML table processing is happening.
19+
- ([#12766](https://github.com/quarto-dev/quarto-cli/issues/12766)): Use consistent equation numbering display for `html-math-method` and `html-math-method.method` (MathJax and KaTeX)
1920

2021
### `revealjs`
2122

src/resources/filters/crossref/equations.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ function process_equations(blockEl)
6363
else
6464
local eqNumber = eqQquad
6565
local mathMethod = param("html-math-method", nil)
66+
if type(mathMethod) == "table" and mathMethod["method"] then
67+
mathMethod = mathMethod["method"]
68+
end
6669
if _quarto.format.isHtmlOutput() and (mathMethod == "mathjax" or mathMethod == "katex") then
6770
eqNumber = eqTag
6871
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
format:
3+
html:
4+
html-math-method: mathjax
5+
_quarto:
6+
tests:
7+
html:
8+
ensureFileRegexMatches:
9+
- ['\\tag\{1\}']
10+
- []
11+
---
12+
13+
$$
14+
\alpha = \beta
15+
$$ {#eq-ab}
16+
17+
This is @eq-ab.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
format:
3+
html:
4+
html-math-method:
5+
method: mathjax
6+
_quarto:
7+
tests:
8+
html:
9+
ensureFileRegexMatches:
10+
- ['\\tag\{1\}']
11+
- []
12+
---
13+
14+
$$
15+
\alpha = \beta
16+
$$ {#eq-ab}
17+
18+
This is @eq-ab.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
format:
3+
html:
4+
html-math-method: katex
5+
_quarto:
6+
tests:
7+
html:
8+
ensureFileRegexMatches:
9+
- ['\\tag\{1\}']
10+
- []
11+
---
12+
13+
$$
14+
\alpha = \beta
15+
$$ {#eq-ab}
16+
17+
This is @eq-ab.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
format:
3+
html:
4+
html-math-method:
5+
method: katex
6+
_quarto:
7+
tests:
8+
html:
9+
ensureFileRegexMatches:
10+
- ['\\tag\{1\}']
11+
- []
12+
---
13+
14+
$$
15+
\alpha = \beta
16+
$$ {#eq-ab}
17+
18+
This is @eq-ab.

0 commit comments

Comments
 (0)