RyotaUshio / obsidian-latex-theorem-equation-referencer

A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
https://ryotaushio.github.io/obsidian-latex-theorem-equation-referencer/
MIT License
177 stars 8 forks source link

Bug: Pasting makes the third latex element render the second equation instead. #225

Open PhysicsInformedNoodle opened 8 months ago

PhysicsInformedNoodle commented 8 months ago

Obsidian Debug Info

SYSTEM INFO: Obsidian version: v1.5.8 Installer version: v1.4.14 Operating system: Windows 10 Pro 10.0.19045 Login status: logged in Catalyst license: none Insider build toggle: off Live preview: on Base theme: adapt to system Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 2 Plugins enabled: 2 1: MathLinks v0.5.3 2: LaTeX-like Theorem & Equation Referencer v2.2.0

Bug

It's possible to construct much smaller MRE, but I eventually stop since sometimes reducing the note made the bug disappear. I'll post where I left off.

I created a note with a bunch of equations, some tagged. And as I was editing the second equation, I saw that the third equation mirrored the second one exactly, even though I was not touching the third equation at all. This is triggered by my pasting a few lines into the second equation.

Steps to recreate

  1. Create a sandbox vault. Install "mathlinks" and "theorem equation referencer". Enable them.

  2. Create a new note. Use "live-preview mode".

  3. Put code (1) into your new note.

  4. Copy the content of code (2).

  5. Put the cursor at the right of the lone character a in line 39. Paste, ie press Ctrl+V.

  6. Bug Occurs: Notice that the third equation is gone and in its place you see the second equation.

  7. To temporarily fix this, change the third equation in any way and it'll be back to normal.

Code1:

Assume: ${H^{*} =H}$
For ${\Omega}$ hermitian as well?

$$
\frac{d}{dt} \langle \Omega \rangle
=
\braket{ \partial_{t} \Omega }
+ \frac{1}{i \hbar} 
 \braket{ 
  [\Omega, H ]
}
\tag{Ehrenfest}
$$

$$
\begin{align}
& \mathrm{d}_{t} \braket{\Omega} 
\\ &=
\mathrm{d}_{t} \braket{ \psi | \Omega | \psi }

\\ &=
\braket{ \partial_{t} }
\braket{ \partial_{t} }

\\ &=
\braket{ \partial_{t} }

\\ &=
\braket{ \partial_{t} }

\\ &=
\braket{ \partial_{t} }

a

\end{align}
$$

dddd

$$
\partial_t \psi = \frac{1}{i \hbar} l
 H \psi dudd
\tag{SE}  pdds a 8
$$

$$
\partial_t \psi ^{*}= -\frac{1}{i \hbar} 
\psi ^{*} H h
\tag{*} a
$$

Code2:


\\ &=
\braket{ \partial_{t} }