4.3 Automatic Package detection

4.3.1 Custom Packages

Whenever Latex-Suite begins editing a new LaTeX file, it scans it for \usepackage{name} lines, and if a supported package is found, then it will create sub-menus and add to the 'dict' setting as described above.

If a master-file has been specified, then it will scan that file instead of the current file. See the section Custom Packages to see which files Latex-Suite will scan in more detail.

For all the packages detected in this manner, Latex-Suite will take certain actions as described in the section package support..

4.3.1 Custom Packages

Often times, the preamble can become too long, and some people prefer to put most of their personalization in a custom package and include that using a \usepackage line. Latex-Suite tries to search such customs package for other \usepackage lines, so that supported packages included in this indirect manner can also be used to create sub-menus, extend the 'dict' setting etc. The most obvious place to place such custom packages is in the same directory as the edited file. In addition, LaTeX also supports placing custom packages in places pointed to by the $TEXINPUTS environment variable.

If you use the $TEXINPUTS variable in LaTeX, and you wish Latex-Suite to search these custom packages for \usepackage lines, then you need to initialize the g:Tex_TEXINPUTS variable.

The g:Tex_TEXINPUTS variable needs to be set in the same format which Vim uses for the 'path' setting. This format is explained in detail if you do

:help file-searching

from within Vim.

Therefore the value of g:Tex_TEXINPUTS will most probably be different from $TEXINPUTS which your native LaTeX distribution uses.


let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**'

The ** indicates that all directories below the directory ~/texmf/mypackages and ./ are to be scanned for custom packages.


The present directory '.' is always searched. You need not include that in g:Tex_TEXINPUTS.