You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an equation is outside of the displayed lines of the buffer and you run Neorg render-latex, the latex-renderer will fail to conceal the equation because the image.rendered_geometry == {}, and so image.rendered_geometry.width will be nil, here's the relevant code.
Expected behavior
No error should be thrown.
This could be fixed by getting the width of the image in a different way that does not relay on the image being currently rendered.
A potential solution would be to not conceal equations when width==nil, however in that case the inline_math call should be added to the OnCursorMove event. Currently that change has an unacceptable performance hit.
Steps to reproduce
$\min_\theta \mathbb{E} -\log p_\theta(x)$
$\theta$ and $\tau$ and $\pi$ and $\gamma$ and $\epsilon$
$\min_\theta \mathbb{E} -\log p_\theta(x)$
$e^{i\pi} + 1 = 0$
$a^2 + b^2 = c^2$
$E = mc^2$
$F = ma$
$\hat{H}\psi = E\psi$
$\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}$
$\nabla \cdot \mathbf{B} = 0$
$dS \geq \frac{dQ}{T}$
$\gamma = \frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$
$(i\gamma^\mu\partial_\mu - m)\psi = 0$
$\e$
<add as many lines as needed to push the upper equations outside of the display>
Potentially conflicting plugins
No response
Other information
No response
Help
None
Implementation help
In the branch I'm currently using in my fork I've removed this error, here's the fix, but it relays in the user continuously re-rendering the equations to get the concealment. I can confirm, that with that change the error no longer appears.
The text was updated successfully, but these errors were encountered:
jonboh
added
the
bug
Issues related to bugs. Please attach a severity, a priority and category with this label.
label
Apr 4, 2024
I'll try to test the change with the addition of render_inline_math inOnCursorMove with the changes that @benlubas has made to image.nvim to improved performance and see if that would be sufficient to solve the issue. In that case I'll send a PR.
Prerequisites
Neovim Version
NVIM v0.10.0-dev-00e71d3 Build type: Release LuaJIT 2.1.1693350652
Neorg setup
Actual behavior
When an equation is outside of the displayed lines of the buffer and you run
Neorg render-latex
, the latex-renderer will fail to conceal the equation because the image.rendered_geometry == {}, and so image.rendered_geometry.width will be nil, here's the relevant code.Expected behavior
No error should be thrown.
This could be fixed by getting the width of the image in a different way that does not relay on the image being currently rendered.
A potential solution would be to not conceal equations when
width==nil
, however in that case theinline_math
call should be added to theOnCursorMove
event. Currently that change has an unacceptable performance hit.Steps to reproduce
Potentially conflicting plugins
No response
Other information
No response
Help
None
Implementation help
In the branch I'm currently using in my fork I've removed this error, here's the fix, but it relays in the user continuously re-rendering the equations to get the concealment. I can confirm, that with that change the error no longer appears.
The text was updated successfully, but these errors were encountered: