Skip to content

KaTeX auto equation numbering stopped working #3438

@disberd

Description

@disberd

I was made aware of this issue via an issue on PlutoExtras and while debugging I realized that since version 0.20.16 of Pluto, the automatic equation numbering of KaTeX is broken, as it shows all equations with the same number (1).

See below a minimal reproducer example screenshot:

Image

The KaTeX implementation relies on CSS counters for numbers, but plain use of HTML with CSS counters still seem to work on v0.20.16 (see image below) so it must be something a bit more convoluted.

Image
HTML reproducer
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
    
    <div id="eq1"></div>

    <div id="eq2"></div>

    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"></script>
    <script>
        const equations = [
            '\\begin{equation}\nE = mc^2\n\\end{equation}',
            '\\begin{equation}\na^2 + b^2 = c^2\n\\end{equation}',
        ];

        equations.forEach((eq, index) => {
            const container = document.getElementById(`eq${index + 1}`);
			katex.render(eq, container, {
				displayMode: true,
				throwOnError: false
			});
        });
    </script>

@fonsp any idea on what might have caused it? I don't see anything obvious from the v0.20.16 release page

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions