Skip to content

Generate equation number as a span with unique ID #3921

Answered by mbourne
piszczu4 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello piszczu4

I see you already discovered this discussion about \eqref, which still doesn't seem resolved: #2003

At first, I was going to suggest a post-processing step which added an ID to each <span class="katex"> ... </span> and you could link to those. But if you have many KaTeX expressions on a page and later need to add or remove some of them in the middle of the page, you'd need to update all the links going to all the expressions after the change. It would be a nightmare to maintain.

So why not do the following:

For each expression that you want to link to, add a <span> around it and give it an ID, some thing like:

Here is Euler's formula <span id="euler_formula"> \( e^{i\pi}+1 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@piszczu4
Comment options

Answer selected by piszczu4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants