Automatic equation numbering (Latex Math)

Unfortunately, due to the way mathjax is implemented this is not just as easy as flipping a switch for us. This is not likely to be implemented in the short term.

4 Likes

That’s okay, I still love you guys. Keep up the good work.

1 Like

As I just saw the notes on 8.2, perhaps this will be solved? @WhiteNoise

no, but we looked into it. We enabled what we could, but we can’t enable that.

1 Like

Cool. Thanks anyways.

Manual equation numbering works:

$$x=y+1 \tag{1} \label{eq1}$$

As shown in $\eqref{eq1}$, $x$ is grether than $y$.
10 Likes

Hey,

did something change with newer Obsidian versions? Copying

$$x=y+1 \tag{1} \label{eq1}$$

does not render for me, because of the “\label{eq1}” part.

Thanks!

7 Likes

Yeah, this has been finicky for me too. It’s been a while, but my recollection is that quitting and reopening obsidian numbering works again.

Anyway, the whole equation numbering issue is unworkable in Obsidian. If one has to put in the numbers with tag{1}, the elegance and power of Latex equation numbering is lost. The whole point is to avoid manual numbering.

This is a fundamental and deep flaw (IMO) that precludes long form writing involving mathematics and equations in Obsidian — without tedious manual intervention, such as tag{1}, and hackery (regex search-replace after moving text into a Latex-friendly environment).

If frustration is evident in this post, it is genuine and not meant to disparage or insult the developers for whom I have great respect and admiration for a stellar app.

11 Likes

Obsidian is very well done in general. It is a rare markdown editor for which I do not have the urge to change its default settings. However, the lack of auto-numbering is a significant drawback. I hope the developers are still working on a full MathJax support.

As a workaround, I found a solution for auto-numbering equations across Apple devices. The “One Markdown” app has both iOS and macOS versions. One Markdown automatically numbers equations as long as they are in the following format:
$$
\begin{equation}

\end{equation}
$$

1 Like

I believe there is full mathjax support now but no equations numbering? Is there any chance this will be added in future?

1 Like
2 Likes

Cool thanks, just as a note, even:

$$ x=1 \tag{1}\label{eq1} $$

As seen in $\eqref{eq1}$

isn’t working for me right now.

1 Like

Huh, well a quick restart of obsidian did the trick.

Edit: well anytime I edit the label or around it it breaks and only a restart solves it.

I remember unpacking obsidian.asar to inspect the MathJax inside. It’s less than 2MB so it cannot be a full MathJax. More powerful MathJax implementation is usually an order of magnitude larger in size.

Auto-numbering aside, Obsidian struggles with complex equations in general. For strange reasons, I get the unrendered display equations with yellow background after a couple of previews of math documents, even though the initial preview is fine. The only way out of it is a relaunch. It’s so exacerbating that I stopped using Obsidian to process any document with display equations.

Obsidian bundles tex-chtml-full. We don’t support currently support equation numbering because the way mathjax works and the way Obsidian works are incompatible. Essentially, mathjax wasn’t designed to be used in an interactive setup.

Hiya WhiteNoise, just wondering if you have any comment about my previous use of \tag and \label then being referenced with eqref only working after a restart/reload until the corresponding block is edited (at which point it breaks). Is this expected behaviour? Or do I need to do a bug report?

1 Like

Unfortunately, that workaround doesn’t work anymore.

2 Likes

Seems the label used will not allowed to be reused. My guess is the recompile didn’t clear the cache for that.

1 Like

An ugly and manual solution: I used \hspace{3em} and added the equation number manually as follows:

$$\Large{\delta_{i}x = logf_{i}x+log\pi_{i}} \hspace{3em}(1)$$

1 Like

Thanks! I found this to be a great manual workaround and have been using it with \begin{split} and & to align equations.

## Euclidean Algorithm In Reverse
Applying the [[Euclidean Algorithm]] normally to find $\large gcd(403, 286)$ yields the following:
$$\large
\begin{split}
403 &= 1\times286 + 117&\hspace{3em}(1)\\
286 &= 2\times117 + 52&\hspace{3em}(2)\\
117 &= 2\times52 + 13&\hspace{3em}(3)\\
52 &= 4\times13 + 0&
\end{split}
$$

Notice however that ==when working backwards, we are **able to express $\large gcd(403, 286)$ as an [[Integers|integer]] [[Linear Combinations|Linear Combination]] of $\large 403$ and $\large 286$**==.

$$\large
\begin{split}
13 &= 117 - 2 \times 52&\hspace{3em}\text{from(3),}\\
   &= 117 - 2 \times (286 - 2 \times 117)&\hspace{3em}\text{substitute from (2),}\\
   &= 5 \times 117 -2 \times 286&\hspace{3em}\text{collecting terms,}\\
   &= 5 \times (403 - 286) -2 \times 286&\hspace{3em}\text{substitute from (1),}\\
   &= 5 \times 403 - 7 \times 286&\hspace{3em}\text{collecting terms.}\\
\end{split}
$$

==This allows us to write $\large gcd(403, 286)$ in the form $\large 403x + 286y$ for all [[Integers]] $\large x$ and $\large y$ where specifically $\large x=5$ and $\large y=-7$.==

This can be used in [[Bezout's Identity]].