Blog 1

Random Talk on Random Thoughts

Edit $\rm \LaTeX$ Equations in Vim

| Comments |

With Vim-$\rm \LaTeX$, it’s possible to edit $\rm \LaTeX$ equations with Vim quickly without making syntax errors. (e.g. undefined control sequence caused by mismatched braces ‘{}’)

YouTube video
Please view it fullscreen in HD. Sorry for the inconvenience caused.
For the sample files, please click the above “YouTube” button.

Why use Vim? Please refer to my post on Vim.

For a quick startup guide, see the official tutorial. If you’ve learnt those keyboard mappings, here’s a quick review of some commands. For detailed list of all keyboard shortcuts and customizations (e.g. custom compile rule: use pdflatex instead of latex and dvipdfm), you can refer to the user manual.

There’re many blog entries about how to install $\rm \LaTeX$ on Vim on *nix and M$ Win*. Searching “vim latex” gives you millions of search results. Summarizing the articles, the three major components are:

  1. Editor
    • Vim (found on almost every distribution of *nix)
    • GVim (on GUI of any platform)
  2. $\rm \LaTeX$
  3. Vim plugin for writing $\rm \LaTeX$: Latex-Suite

For *nix, you may find some GUI tools for installing packages. (especially in some popular distributions)

fig1

fig2

You can also type the install commands for these packages on the terminal.

For Ubuntu:

# Also include `vim-gnome' if you'd like to install GVim.
$ sudo apt get install vim-gnome vim-latexsuite texlive

For Fedora:

# Also include `vim-X11' if you'd like to install GVim.
[root@localhost]# yum install vim-latex latex

Unlike M$ Win*, the dependencies will be automatically resolved.

For M$ Win*, the installation procedures for GVim (portable), Vim-$\rm \LaTeX$ and Mik$\rm \TeX$ (portable) are as followed:

  1. Go to the official websites of GVim and Mik$\rm \TeX$ (or equivalent packages) and download the packages; or

    Put Mik$\rm \TeX$ portable and GVim portable to any folder you like.

    • e.g. C:\Temp
    • Don’t put them under C:\Program Files.
  2. Download Vim-$\rm \LaTeX$ from SourceForge.
  3. Follow the steps in Download on $\rm \LaTeX$.

Remarks: The installation of Vim-$\rm \LaTeX$ (items 3 and 4) is the same for portable and non-portable versions of GVim.

Comments