2011/5/22 Aditya Mahajan <adit...@umich.edu>:
> On Sat, 21 May 2011, Przemysław Pawełczyk wrote:
>> ### Issue
>> For larger LaTeX documents splitting text between many files is a
>> common practice. And here comes the problem with package detection in
>> Vim-LaTeX. If I open the main `.tex` file (i.e. the one including
>> other `.tex` files), where `\usepackage{polski}` is present, then
>> space substitution works fine. It's not the file where you are writing
>> much, thus it's not really useful here. But if I open any other `.tex`
>> file (which is included by the main `.tex` file), which obviously does
>> not have preamble (thereby there is no `\usepackage{polski}` in it),
>> package detection fails, therefore space substitution is not working
>> here.
> Have you tried setting the master tex file:
> :he latex-master-file

Not before I received this mail from you. Thanks for sharing.

I have to admit I wasn't carefully browsing vim-latex docs. Now I can
press `\lv` to run the viewer from any file below the document root,
so it is overall helpful, but not solving my problem.

I removed mentioned before `au FileType tex call
Tex_pack_one('polski')` line from `.vim.rc` to avoid any clashes and
added empty `main.tex.latexmain` file. From polski package PoV
situation is the same as with my partial solution. Only first opened
file works properly, another windows with `.tex` files do not.

I am starting to think that problem is in how package loading works
internally in vim-latex (as oriented mostly for rarely used menus
[correct me if I'm wrong], that should be extended only once)
preventing executing packages' scripts more than once. Also polski
package may have some bugs. I know Vim and can conveniently use its
editing powers, but I haven't learned Vim scripting language yet
(writing simple `.vimrc` doesn't require any special knowledge), thus
I cannot judge here and need help of advanced Vim users/programmers. I
believe there are some subscribed to this mailing list.

Side note: In `main.tex` I am inputting `packages.tex`. If you use
many packages, it's convenient to have separate file with some
comments. But vim-latex is not checking inputted files. I've had
`\usepackage{polski}` in `main.tex` already (because it should be
loaded quite early and it eases distinguishing Polish texts just by
looking at their headers), but in general this requirement of loading
packages only in `main.tex` is inconvenient. Adding packages-oriented
`.tex` files to `.latexmain` and automatically parsing listed files
could be an acceptable solution IMO. Not that I need it now, just
saying about possible TO DO task.


Przemysław 'Przemoc' Pawełczyk

What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
Vim-latex-devel mailing list

Reply via email to