-
I'm building a math website and I'm wondering whether it would be possible to somehow generate the equation in such a way that it is possible to copy its ID to be able to create a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 So why not do the following: For each expression that you want to link to, add a Here is Euler's formula <span id="euler_formula"> \( e^{i\pi}+1 = 0 \) </span> and now for a display integral: <span id="int_sin">$$ \int \sin (x) dx = -cos(x) + C $$</span>. Then you can link to those, something like: Earlier, we saw <a href="#euler_formula">Euler's formula</a> and a random <a href="#int_sin">sin integral</a>. |
Beta Was this translation helpful? Give feedback.
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: