Showing posts with label Latex-Suite. Show all posts
Showing posts with label Latex-Suite. Show all posts

2013-12-11

Vim-$\rm \LaTeX$'s \lv command with Sumatra PDF

Why do I switch my PDF viewer?

  • Ado* Read* is proprietary. (EULA)
  • Sumatra PDF is free. (GPLv3)
Go for FLOSS! Go for freedom!

Actual process

Original settings for Ado* Read*: let g:Tex_ViewRuleComplete_dvi='C:/.../AcroRd32' in _vimrc (No extension name)
Problem: How to change Vim-$\rm \LaTeX$'s setting of \lv?
Trial 1: Set g:Tex_ViewRuleComplete_dvi='C:/.../SumatraPDF' in _vimrc (No effect)
Trial 2: Set g:Tex_ViewRule_dvi='C:/.../SumatraPDF' and disable g:Tex_ViewRuleComplete_dvi in _vimrc (No effect)
Trial 3: Set g:Tex_ViewRule_pdf='C:/.../SumatraPDF' and keep g:Tex_ViewRuleComplete_dvi='C:/.../AcroRd32' in _vimrc (Ado* Read* launched instead)
...
Trial n: Set g:Tex_ViewRule_pdf='C:/.../SumatraPDF' and disable g:Tex_ViewRuleComplete_dvi='C:/.../AcroRd32' in _vimrc (No effect)
Solution:
  1. Change PATH environment variable. (You can change it for vim runtime and keep the original one in other programs. See my newer post for details.)
  2. Set g:Tex_ViewRule_pdf='SumatraPDF'
  3. Disable g:Tex_ViewRuleComplete_dvi in _vimrc

2013-10-18

A Bug in Vim-$\rm \LaTeX$

It's a small syntax error, and can be easily fixed with the addition of a space character. I found it from a Google search result. (I've forgotten the query string.)
This shows to good things of free and open source software:
  • Find bugs quickly through effective communication between users and developers
  • Fix bugs quickly through hands-on configuration of source code
From the Vim plugins in the GitHub, you can see even more:
  • Everyone can tune the software to adapt to his/her needs.
  • Everyone can share and contribute their changes.
  • and more ...
The more the developers, the further they can see!

2013-08-16

Edit $\rm \LaTeX{}$ equations on Vim

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

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/GVim on UNIX/Linux and M$. 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$
    • $\rm \TeX \text{Live}$ (found in package manager on *nix)
    • $\text{Mik}\rm \TeX$ (have a $\rm \LaTeX$ package manager)
  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)


Software Centre in Ubuntu 12.04 LTS


PackageKit in Fedora 17

You can also type the install commands for these packages on the terminal. For example:
  1. Ubuntu
    # Also include `vim-gnome' if you'd like to install GVim.
    $ sudo apt get install vim-gnome vim-latexsuite texlive
    
  2. Fedora
    # Also include `vim-X11' if you'd like to install GVim.
    [root@localhost]# yum install vim-latex latex
    
Unlike M$, the dependencies will be automatically resolved.

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

  1. Go to the official websites of GVim and $\text{Mik}\rm \TeX$ (or equivalent packages) and download the packages.
  2. Put $\text{Mik}\rm \TeX$ portable and GVim portable to any folder you like
    • e.g. C:\Temp
    • DON'T put them under C:\Program Files
  3. Download Vim-$\rm \LaTeX$ from SourceForge
  4. Follow the steps here
Remarks: The installation of Vim-$\rm \LaTeX$ (items 3 and 4) is the same for portable and non-portable versions of GVim.