Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support equation auto-numbering across widgets #9

Open
amake opened this issue May 1, 2021 · 1 comment
Open

Support equation auto-numbering across widgets #9

amake opened this issue May 1, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@amake
Copy link
Owner

amake commented May 1, 2021

As reported at amake/orgro#42 (comment)

Each TexImage widget is an independent rendering "context" in which equation numbering starts over from 1. However in "normal" usage KaTeX can do the expected thing and number equations correctly across environments:

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-ThssJ7YtjywV52Gj4JE/1SQEDoMEckXyhkFVwaf4nDSm5OBlXeedVYjuuUd0Yua+" crossorigin="anonymous">
        <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-Bi8OWqMXO1ta+a4EPkZv7bYGIes7C3krGSZoTGNTAnAn5eYQc7IIXrJ/7ck1drAi" crossorigin="anonymous"></script>
        <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous"
                onload="renderMathInElement(document.body);"></script>
    </head>
    <body>
        <p> foo

            \begin{equation}
            a + b = c
            \end{equation}

            bar

            \begin{equation}
            d + e = f
            \end{equation}
        </p>
    </body>
</html>

image

Auto-numbering with "normal" usage of KaTeX is possible because KaTeX has access to the full document, whereas with multiple TexImage widgets the "document" is split up.

It's not clear that there is a way to supply the necessary information to KaTeX to make this work.

@amake amake added the enhancement New feature or request label May 1, 2021
@amake amake changed the title Support equation auto-numbering Support equation auto-numbering across widgets May 1, 2021
@amake
Copy link
Owner Author

amake commented May 1, 2021

It's possible that the globalGroup option might help, but without having tried it I think that re-renders would incorrectly bump the equation numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant