RohanModi-CA / KaVimTeX

A quick preview for your Neovim LaTeX, using KaTeX to render the current line.
GNU General Public License v3.0
0 stars 0 forks source link

KaVimTex: Live LaTeX Preview in Neovim

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.

Screenshot

Pictured above: KaVimTeX Preview window above nvim, with Zathura on the right hand side.

Features

Installation

  1. Prerequisites: Ensure you have the following installed:

    • Luasocket: Install via LuaRocks (e.g., luarocks install luasocket).
    • Python3
    • NodeJS
  2. 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
  3. Restart Neovim: After installing the plugin, either restart Neovim or source your configuration file.

Usage

  1. Start the Server: Run :KVTServer within Neovim. This will initiate the preview window.
  2. Enjoy Live Preview: Start writing LaTeX! Your changes will be reflected in the preview window.

Tips:

Technical Details

Motivation

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.

Contributing

Contributions to KaVimTex are welcome! If you have any ideas for improvements, bug fixes, or new features, please feel free to: