Last Updated: November 19, 2020
· itseranga

LaTex with Vim

What is LaTeX

  • LaTex is a document preparation system for high-quality typesetting

  • It can also introduce as a document markup language

  • LaTeX is based on Tex

  • More info -

What is TeX?

  • TeX is a very powerful typesetting language that can be used to write almost anything

  • It was designed and developed by Donald Knuth, a professor at Stanford University

  • TeX is used heavily in the academic and scientific world

How to install LaTex

  • LaTeX version available for Mac is MacTex

  • Please note that, I'm using MacTeX on rest of this protip

  • Installation details are below

  1. Mac OS -
  2. Linux -
  3. Windows -

LaTeX and Vim

Install vim-latex-live-preview

cd ~/.vim
git submodule add bundle/vim-latex-live-preview
  • You have to specify vim-latex-live-preview plugin related configurations in your ~/. vimrc file

vimrc configurations

  • Following are the ~/. vimrc configurations

  • Set the vim option updatetime to a smaller value, which is the frequency that the output PDF is updated

autocmd Filetype tex setl updatetime=1
  • Set the PDF viewer. I'm using Preview viewer here
let g:livepreview_previewer = 'open -a Preview'


Working example

  • First goto your workspace and create a LaTeX document (LaTeX document should be with .tex format)
cd ~/Documents/senzors
touch introduction.tex
  • Add following sample text to the introduction.tex

\author{Sustainable Computing Research}
\date{October 2014}



Real time communication platform for sensor devices

\subsection{What is SneZors}

Secured platform to share your sensor data

\subsection{Why SneZors}

Keep sharing your sensors


\item Websockets 
\item Android
\item IOS





  • Use following command to get the PDF preview of the document
  • This command will generates the PDF preview of you LaTeX document


  • Now when you changing the text in your LaTeX document, you can see the live update of the changes (in PDF document)

  • Following is an example preview



Related protips:

Basic Vim commands - For getting started

2 Responses
Add your response

Nice explanation.

over 1 year ago ·

~ cd .vim
āžœ .vim git submodule add bundle/vim-latex-live-preview
fatal: Not a git repository (or any of the parent directories): .git

over 1 year ago ·