diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index 8d8b3e20651..1813357f21b 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -16,6 +16,7 @@ All changes included in 1.8: - ([#12259](https://github.com/quarto-dev/quarto-cli/issues/12259)): Fix conflict between `html-math-method: katex` and crossref popups (author: @benkeks). - ([#12734](https://github.com/quarto-dev/quarto-cli/issues/12734)): `highlight-style` now correctly supports setting a different `light` and `dark`. - ([#12747](https://github.com/quarto-dev/quarto-cli/issues/12747)): Ensure `th` elements are properly restored when Quarto's HTML table processing is happening. +- ([#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) ### `revealjs` diff --git a/src/resources/filters/crossref/equations.lua b/src/resources/filters/crossref/equations.lua index 0ecb0e430b7..00431e11a16 100644 --- a/src/resources/filters/crossref/equations.lua +++ b/src/resources/filters/crossref/equations.lua @@ -63,6 +63,9 @@ function process_equations(blockEl) else local eqNumber = eqQquad local mathMethod = param("html-math-method", nil) + if type(mathMethod) == "table" and mathMethod["method"] then + mathMethod = mathMethod["method"] + end if _quarto.format.isHtmlOutput() and (mathMethod == "mathjax" or mathMethod == "katex") then eqNumber = eqTag end diff --git a/tests/docs/smoke-all/2025/05/18/issue12766-1.qmd b/tests/docs/smoke-all/2025/05/18/issue12766-1.qmd new file mode 100644 index 00000000000..383df0c7016 --- /dev/null +++ b/tests/docs/smoke-all/2025/05/18/issue12766-1.qmd @@ -0,0 +1,17 @@ +--- +format: + html: + html-math-method: mathjax +_quarto: + tests: + html: + ensureFileRegexMatches: + - ['\\tag\{1\}'] + - [] +--- + +$$ +\alpha = \beta +$$ {#eq-ab} + +This is @eq-ab. diff --git a/tests/docs/smoke-all/2025/05/18/issue12766-2.qmd b/tests/docs/smoke-all/2025/05/18/issue12766-2.qmd new file mode 100644 index 00000000000..e7db4afe2a1 --- /dev/null +++ b/tests/docs/smoke-all/2025/05/18/issue12766-2.qmd @@ -0,0 +1,18 @@ +--- +format: + html: + html-math-method: + method: mathjax +_quarto: + tests: + html: + ensureFileRegexMatches: + - ['\\tag\{1\}'] + - [] +--- + +$$ +\alpha = \beta +$$ {#eq-ab} + +This is @eq-ab. diff --git a/tests/docs/smoke-all/2025/05/18/issue12766-3.qmd b/tests/docs/smoke-all/2025/05/18/issue12766-3.qmd new file mode 100644 index 00000000000..56055291a60 --- /dev/null +++ b/tests/docs/smoke-all/2025/05/18/issue12766-3.qmd @@ -0,0 +1,17 @@ +--- +format: + html: + html-math-method: katex +_quarto: + tests: + html: + ensureFileRegexMatches: + - ['\\tag\{1\}'] + - [] +--- + +$$ +\alpha = \beta +$$ {#eq-ab} + +This is @eq-ab. diff --git a/tests/docs/smoke-all/2025/05/18/issue12766-4.qmd b/tests/docs/smoke-all/2025/05/18/issue12766-4.qmd new file mode 100644 index 00000000000..a1515313650 --- /dev/null +++ b/tests/docs/smoke-all/2025/05/18/issue12766-4.qmd @@ -0,0 +1,18 @@ +--- +format: + html: + html-math-method: + method: katex +_quarto: + tests: + html: + ensureFileRegexMatches: + - ['\\tag\{1\}'] + - [] +--- + +$$ +\alpha = \beta +$$ {#eq-ab} + +This is @eq-ab.