Steps to reproduce
- Create a new note (A) and input
$$
\DeclareMathOperator{\cov}{cov}
\DeclareMathOperator{\var}{var}
\newcommand{\E}{\mathbb E}
$$
- Create a second note (B) and input
$$\cov(X,Y) = E((X-\E X)(Y-\E Y))$$
- Restart Obisidian and open note B without first opening note A
- Switch to preview mode. Result:
- Now preview note A and then switch back to preview note B. Result:
Comment
Although this is not a bug per se, it seems like inconsistent behavior to me.
It is obviously caused by the fact that Obsidian uses a global Mathjax interpreter. If Mathjax first interprets the definitions in note A, it then understands how to display note B.
I would, in fact, like some consistent version of this behavior. For example, Neuron uses a head.html
file that is included in every note. You can place your Latex header definitions in there. Is there anything like this for Obsidian at this point? I don’t want to copy all my definitions for math notes to every single note.
Environment
- Operating system: Windows 10
- Obsidian version: v0.12.15