Skip to content
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

Math preview in a floating window: neovim #2006

Closed
JackGin opened this issue Mar 24, 2021 · 5 comments
Closed

Math preview in a floating window: neovim #2006

JackGin opened this issue Mar 24, 2021 · 5 comments

Comments

@JackGin
Copy link

JackGin commented Mar 24, 2021

Can we please have a math preview in a floating window, which was introduced in neovim 0.4.4?
Math preview in a floating window is a useful feature found e.g. in VSC+LatexWorkshop.
Thank you!

@andymass
Copy link
Contributor

Can you give an example of what this would look like? I.e., what it looks like in VSC+LatexWorkshop?

@JackGin
Copy link
Author

JackGin commented Mar 24, 2021

Yes, sure.
image

@lervag
Copy link
Owner

lervag commented Mar 24, 2021

I'm sorry, but it is not possible. The reason is simple: Vim and neovim are terminal applications and do not support graphics, thus we can't show any compiled samples in a popup like this.

The conceal feature is related, but I'm the first to admit it is not anywhere near as good as that kind of popup.

However, IMHO and personal experience, this is not a very important feature. Two reasons: 1) after working with TeX for some time, it should be quite possible to read most math quite fluently without seeing the end result, and 2) having a PDF viewer opened at the side and having it update when you save is almost as good. It will be slower, but if you don't need to see the result immediately this is not a problem.

@clason
Copy link
Contributor

clason commented Mar 24, 2021

In principle(!), this is doable in neovim using https://github.com/latex-lsp/texlab (a LaTeX LSP server that supports equation previews on textDocument/hover requests using markdown inline images) and a neovim GUI that can render markdown in externalized floating windows. (I am not aware that such a GUI exists.)

But:

  1. This only works decently for simple equations and breaks for more complicated equations using macros and packages. (Remember, only TeX (the compiler) can fully parse LaTeX.)
  2. It will only ever work on a small subset of supported platforms, so it's questionable whether it's worth pouring in the massive effort required to support it.

@lervag
Copy link
Owner

lervag commented Mar 24, 2021

Thanks, that's interesting and useful information. I was not aware texlab could do this.

In any case, I think the bottom line is that I will not spend time on this, as I don't see any good way of achieving a good result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants