Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to indicate main LaTeX file to Vim-LaTeX

📅 2014-Jun-12 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ vim, vim-latex ⬩ 📚 Archive

Large LaTeX documents are usually created by including multiple smaller LaTeX files. These could be arranged flatly in the same directories or hierarchically across subdirectories. This is similar to how source files are managed in a project.

However, in Vim-LaTeX, the compilation command can be invoked only from the main LaTeX file. If you have a multi-document LaTeX setup, then you might want to issue a compilation when any of the child files is open in Vim-LaTeX. To do this, we need to indicate which is the main file to Vim-LaTeX. This is done by creating an empty file with the same name as the main file, but with an extra .latexmain extension.

For example, if your main file is foobar.tex, create an empty file named foobar.tex.latexmain. Place it in the root directory, since Vim-LaTeX will search up the directory tree until it finds this file.

Reference: Multiple file LaTeX projects

Tried with: Vim 7.4