KaVimTex provides a live preview of your LaTeX code within Neovim, using KaTeX and a dedicated QT window. This can be useful for visualizing complex mathematical expressions, matrices, etc in real-time.
Pictured above: KaVimTeX Preview window above nvim, with Zathura on the right hand side.
\newcommand
and \renewcommand
definitions for a seamless editing experience.Prerequisites: Ensure you have the following installed:
luarocks install luasocket
).Install KaVimTex using your preferred plugin manager:
vim-plug
call plug#begin() " Begin managing plugins
Plug 'RohanModi-CA/KaVimTeX'
call plug#end() " End managing plugins
packer.nvim
-- Your other packer configurations...
use {
'RohanModi-CA/KaVimTeX',
-- Optional configuration options can go here
}
-- ... Rest of your packer setup
Restart Neovim: After installing the plugin, either restart Neovim or source your configuration file.
:KVTServer
within Neovim. This will initiate the preview window.Tips:
alias kvt='nvim -c "KVTServer"'
) for a faster startup.backend/resources/i3/
to set up an efficient layout for KaVimTex.let g:KVTRunOnAllFileTypes
to your init.vim
or .vimrc
.I'm a physics undergrad, and Overleaf is frustrating and slow, and I've found the other existing LaTeX quick preview tools (like Obsidian, for example) to be limited in that they don't let you actually type LaTeX, but rather some markdown with TeX support. I still want to be able to use full LaTeX, whatever packages, etc; just while being able to see what I'm writing. Hence this plugin.
KaVimTex provides a live preview within Vim while supporting the large range of syntax that KaTeX supports. While it doesn't render all LaTeX elements, it allows users to write unrestricted LaTeX code; unsupported commands will simply not be rendered in the preview.
Contributions to KaVimTex are welcome! If you have any ideas for improvements, bug fixes, or new features, please feel free to: