DEV Community

Aaditya Sinha
Aaditya Sinha

Posted on

Latex with Vim

Latex

A LaTeX document is a text file that contains the markup code for a document that will be typeset by LaTeX. The markup code specifies the structure and formatting of the document, such as the headings, paragraphs, lists, figures, and tables. LaTeX documents typically have the file extension .tex.
LaTeX documents can be used to create a wide variety of documents, including technical papers, books, presentations, and even letters. They are especially well-suited for documents that contain complex mathematical equations or other specialized formatting.

Vimtex

So as you have already know about vim and latex, there is a plugin which is called vimtex that can be used to compile the .tex file and shows you the output just like the screenshot above. But before diving into the features of this plugin you must add this plugin into you lvim or nvim config file.

Writing latex using vim

" vim-plug
Plug 'lervag/vimtex'

" packer.nvim
use 'lervag/vimtex'

Enter fullscreen mode Exit fullscreen mode

After installing vimtex you must add the latex_compiler to compile the .tex file using this line into you .vimrc or init.vim
let g:vimtex_compiler_method = 'latexrun'
There are so many commands for vimtex, the commands which I use everytime is \ll (to compile the latex file).
For pdf viewer I have used zathura which is minimalistic pdf viewer with vim key bind.

Conclusion

I hope this article helped you getting to know about latex file and vimtex plugin, how we can use it in vim :)
See you in the next article.
https://github.com/lervag/vimtex.git

Enter fullscreen mode Exit fullscreen mode

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay