-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add LaTex rendering for inline equations #1133
Conversation
just a few points
I haven't really looked into the code yet. So perhaps some of those things are already ok |
tysm for this! I won't likely have time today but I should be able to review this tomorrow :) |
end | ||
|
||
module.load = function() | ||
Image = neorg.modules.get_module(module.config.public.renderer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating a global Image
variable here I would rather you do the same thing like in core.integrations.image
- the module.private
contains the image
variable and a pcall
is executed in the load
function. The rest looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the wait, college has kept me really busy these past few weeks, but I finally got some time and I pushed the commit :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks for all the work!
Hi, nice addition @nolbap but it would be nice if you could take a look at this action and fix where there are errors. https://github.com/nvim-neorg/neorg/actions/runs/6906276341/job/18790965878 |
Is this already functional? |
yes it should be |
:*) Thanks @nolbap for your hard work.... i actually have been working on this (https://github.com/Vaisakhkm2625/hologram-math-preview.nvim) few months ago, but life get the way and was really paining me that i didn't able to move forward with this and hoping for someone to do it... but based on what i have done, i like to give few suggestion here... using tectonic instead of normal textlive-latex package give much nicer experience, and it's a single library which will automatically manage dependencies by itself, and actually made for applications like embedded previewing.. and instread of dvipng, we can use i know it's late as you already done all the work, but if you are looking for any improvement, you can take a look at this... |
This commit adds `image.nvim` integration as well as latex rendering integration into Neorg.
Working over the implementation of the
latex-rendering
branch, I added LaTex rendering using theimage.nvim
plugin.Added the Neorg command
render-latex
which upon being called it gets all the inline math snippets using treesitter, parses them into a temp LaTex file, and compiles the snippet into a png, it then renders the png, concealing the equation ifconceal
option is true (which it is by default) or it renders them in a virtual line under the inline equation. I tested these changes and everything seems to work fine :)A preview of the module in action!
finalshowcase.mp4
Note: The concealer uses the
nvim-extmark
optionvirt-text-pos = "inline"
which only works for Neovim 0.10.0+, which I added an assertion for :)P.S. Its my first pull request ever so if anything is wrong let me know 😅