Cannot use the same \label after it has been used

Steps to reproduce

$$e=mc^2 \label{eq0}$$
works fine. However, if you edit anything under this label, e.g. change it to:
$$E=mc^2 \label{eq0}$$
It will cause an error in the preview.

Expected result


Actual result



  • Operating system: Windows 10
  • Obsidian version: v0.12.15

Additional information

If I change the name of the label to another one that I have never used, it will solve the problem. It’s just I can never use any label after I have used it once. Even using ctrl+z cannot change this back.
I just downloaded Obsidian and haven’t installed any plugin.

1 Like

Thank you for your reply! However, I failed to see the connection between the feature request and this. For this bug, even I changed it back – e.g.:

  1. Change $$e=mc^2 \label{eq0}$$ to $$=mc^2 \label{eq0}$$ (delete ‘e’)
  2. Change $$=mc^2 \label{eq0}$$ to $$e=mc^2 \label{eq0}$$ (adding ‘e’ back)

–will not work. It will be rendered correctly before the first change but falsely after the second change (so pressing ctrl+z will not change it back).

Sorry, the connection is that we don’t support it.

1 Like

I see. Thank you so much!