VIM The Editor
Download

User Manual
LaTeX Reference
FAQ
Tutorial
Features
Screenshots

We are ...
Feature Requests
Bug Reports
Mailing List

Package files
Templates

GitHub Project
Sourceforge project
Links

Site hosted by:
SourceForge Logo
Created with Vim

FAQ

Questions

Answers

Q: What are those annoying «» characters whenever I invoke a mapping?
Those are called placeholders and when you get used to them, they will prove invaluable. They are essentially markers left in the text file to tell latex-suite where the next point of interest is. This lets you directly go to the next placeholder with a single key-press. Consider a working example. Pressing EFI will insert the following micro template:
\begin{figure}[h]
    \centerline{\psfig{figure=«eps file»}}
    \caption{«caption text»}
    \label{fig:«label»}
\end{figure}«»
The text «eps file» will be selected and vim will be left in
select-mode so that the user can continue typing straight away. After having typed in the file name, she can press Control-J (while still in insert-mode). This will take her directly to the next "place-holder". i.e, «caption text» will be visually selected with vim in select mode again for typing in the caption. This saves on a lot of key presses.

If you still do not feel like using placeholders, include
let g:Imap_UsePlaceHolders = 0
in your .vimrc.
Q: Compiling does not seem to work for me. My gvim hangs/does nothing.
In order to pin down the problem, please follow these instructions. If things still do not work, contact the developers and let them know what happened when you tried each of the steps below:
  1. What does
    :echo Tex_CompileRule_dvi
    say? This should be a string such as
    latex -interaction=nonstopmode $*
    Make sure that you can get this command to execute on your operating system via Vim. In other words, try the following. Open a very minimal .tex file, for example:
    \documentclass{article}
    \begin{document}
    This is an article.
    \end{document}
    in Vim and type the following sequence of characters inside Vim while in normal mode:
    :!latex -interaction=nonstopmode %
    You should see a command window pop up and the latex executable should begin processing the file. You should get a prompt to hit any key to close the window and when you do, the command window should dissapear. A number of files should be produced in the directory. You should for example, see a .dvi file and a .log file.

    If this command does not work, then it might be due to one of the following reasons:
    1. You do not have any LaTeX distribution installed on your system. Remember, Latex-Suite is simply a set of utilities meant to work with Vim. Installing Latex-Suite does not mean that LaTeX is installed. You will need to install LaTeX seperately.
    2. Your $PATH variable does not contain the directory in which the latex executable resides. See your system documentation on how to set the $PATH variable. On Windows 2000/XP, you can change it from
      Control Panel > System > Advanced > Environment Variables
    If you do have LaTeX installed and the latex executable resides in some directory in your $PATH and the above command still gives an error, then find out what error is being generated on the command prompt.
  2. Make sure that
    :set makeprg?
    shows the same value as Tex_CompileRule_dvi. If it does not, try doing
    :verbose set makeprg?
    to see which script sets this option. Is that part of latex-suite?

  3. What happens when you do
    :call Tex_RunLaTeX()
    from the command line? In normal operation conditions, this should spawn a shell command which looks like Tex_CompileRule_dvi. The shell should call the latex compiler, which should run without user intervention. If this gives any errors, g:Tex_CompileRule_dvi has not been set properly. If the command above gives an error like
    E117: Unknown function: Tex_RunLaTeX()
    you are using an older Latex-suite. Upgrade!

  4. What is your operating system?

  5. What version of latex are you using?

Q: Viewing does not seem to work for me.
First check to make sure that you can call the programs specified by the viewing rules from within vim. For example, if you specified the PDF viewing program as AcroRd32, then you should be able to do
!start AcroRd32
from within vim and get Acrobat reader to launch. On windows, this means setting the PATH variable to include the location in which AcroRd32.exe resides. See the system documentation how to do this. On Windows 2000/XP, the settings can be changed from
Control Panel > System > Advanced > Environment Variables
Some versions of gvim on windows have problems calling external programs which reside in directories containing spaces in their names even if the %PATH% variable contains the correct directories. In this case, you need to change the g:Tex_ViewRule_format variable to use the full path to the viewer. For example:
let g:Tex_ViewRule_pdf = 'c:/Program\ Files/Adobe/Acrobat 5.0/Reader/AcroRd32'
Q: Completion does not work for me on a Microsoft Windows machine.
Q: After a recent upgrade, whenever I launch gvim I get some python-ish errors.
Latex-suite uses python in some of the multiple compilation code if available because it speeds things up and also saves on some unnecessary buffers getting introduced in the buffer list. If your version of python is very old or your python via vim is not working, then you need to tell Latex-suite not to use python if your vim returns 1 for has('python'). This is done by setting the g:Tex_UsePython variable to zero.
Q: Typing some European characters becomes problematic in Latex-suite because those characters seem to be mapped to something.
Latex-suite maps certain Alt key sequences to some functions as described here. If you need to use these keys for regular editing, you will need to remap the Alt keys to something else as described in here. In particular, put the following commands in your ~/.vim/ftplugin/tex.vim file:
imap <C-b> <Plug>Tex_MathBF
imap <C-c> <Plug>Tex_MathCal
imap <C-l> <Plug>Tex_LeftRight
This will make <C-b> etc. assume the functionality of <Alt-b> and so forth without mapping the <Alt> keys to anything. If you wish you can use something like <Plug>foo1 etc in the LHS of the mappings (do not use the same LHS for all three) to effectively disable any mappings.
Q: I cannot insert the e-acute (é) character! HELP!
Insert the following line in your ~/.vim/ftplugin/tex.vim file:
imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
Replace <leader>it with any other key-sequence. This will make <leader>it key insert an \item command corresponding to the last opened environment in the current line in insert mode. The <M-i> key which is used for inserting the e-acute character will remain unmapped.
Q: Sometimes I need to insert a literal double quote. But whenever I press ", I get ``. How do I get around this? Can I disable the " to `` conversion permanently for certain files?
Q: I need to type SSS in my document a lot. But latex-suite always converts it into a \subsection{}<++>. How do I get around this?
To disable a mapping which Latex-suite creates by default, you will need to create a "fake" mapping and place it in a .vim file which gets sourced after Latex-suite. For example, to disable the mapping for SSS, put the line
call IMAP('SSS', 'SSS', 'tex')
in one of the following files (you might need to create these if they do not already exist)
~/.vim/after/ftplugin/tex.vim
~/.vim/after/ftplugin/tex_afterls.vim
~/.vim/after/ftplugin/tex/afterls.vim
Q: Why is vim-latex is no longer loaded when I open an empty .tex file after I upgraded to Vim 7?
If you look at the filetype of your opened file (with :se ft), you will notice, that it is not set to 'tex', but probably to 'plaintex'. To change this, you need to add let g:tex_flavor='latex' to your .vimrc file.
©Vim-latexSuite Team 2002