3rd / image.nvim

🖼️ Bringing images to Neovim.
MIT License
1.18k stars 53 forks source link

feature:could this support latex? #189

Open dirichy opened 5 months ago

dirichy commented 5 months ago

I want to let this support some latex code, such as \includegraphic, is it possible?

3rd commented 5 months ago

Hey, it could through an integration, no built-in support for that.

dirichy commented 5 months ago

is there some example? I want to use this in latex. Thank you for your resposing.

3rd commented 5 months ago

Hey, the integrations are here: https://github.com/3rd/image.nvim/tree/master/lua/image/integrations Do you want it inside .tex files or something like markdown blocks?

dubrayn commented 2 months ago

Automatic preview of math blocks in markdown would be SO nice... I wiil take a look at the integrations. Vaisakhkm2625/hologram-math-preview.nvim can be a nice inspiration too.

artkpv commented 4 weeks ago

@3rd I'm also interested

Do you want it inside .tex files or something like markdown blocks?

I would like to see my math formulas rendered while I edit markdown files. Like:

Content of "mymarkdownfile.md":

$$a_k = \text{argmax}_{a_k}  \sum_{o_k, r_k} \dots \max_{a_m} \sum_{o_m, r_m} [ r_k + \dots r_m ] \sum_{ q : U(q, a_1, \dots, a_m) = (o_k, r_k, \dots o_m, r_m ) } 2^{-l(p)}$$

And it displays the formula under the formula or when I hover my cursor over it. Thanks!

dubrayn commented 4 weeks ago

A recent plugin started implementing LaTeX preview for markdown files. Another one can render latex blocks on demand.

3rd commented 4 weeks ago

I think it would be something to add to https://github.com/3rd/diagram.nvim instead, keeping the built-in integrations slim. What's the best supported (and easiest to setup) way to get an image out of LaTeX source?

dubrayn commented 4 weeks ago

A simple way to generate a .png file from some LaTeX content is the preview function from the python sympy module.