“\label” in the math block and "\ref" in the content at the same time cause error

Steps to reproduce

  1. Use “\label{example}” in math equation block to label an equation.
  2. And then I can use “$\ref{example}$” as inline math in content, which can make a cross reference in Typora.

Expected result

I know that the support of “label” and “ref” may be a feature that Obsidian hasn’t had yet, but I’d like to see the equation show up even if the \ref is invalid.

Actual result

But when I open the md file in Obsidian, the math block can not show up in the Preview, with an error, “Label ‘example’ multiply defined”.

Environment

  • Operating system: Window 10
  • Obsidian version: 0.7.6

Additional information

As you noted, this is because we don’t support (yet) equation numbering. At some point, we’ll look into it.

Thanks for your reply. I get your point and I think it is a pity that there is no temporary plan. Anyway, looking forward to the support of the equation numbering in Obsidian.

We won’t support equation numbering due to different ways in which Mathjax and Obsidian work. I suggest to leave out or comment the \label in the equations.

Okay, thanks for your suggestion.

Using \tag{#} only and manually making a reference to the equation by type (#) instead of using \label{#} and \eqref{#} temporarily solved my problem.

1 Like