9 Multiple file LaTeX projects

9.1 Latex-Suite project settings
9.2 Specifying which file to compile

Many LaTeX projects contain multiple source files which are \included from a master file. A typical example of this situation is a directory layout such as the following

thesis/
    main.tex
    abstract.tex
    intro/
        intro.tex
        figures/
            fig1.eps
            fig2.eps
    chapter1/
        chap1.tex
        figures/
            fig1.eps
    conclusion/
        conclusion.tex
        figures/

In the above case, main.tex will typically look like

% file: main.tex
\documentclass{report}
\begin{document}

\input{abstract.tex}
\input{intro/intro.tex}
\input{chapter1/chap1.tex}
\input{conclusion/conclusion.tex}

\end{document}

In such situations, you will need to convey to Latex-Suite that main.tex is the main file which \inputs the other files. This is done by creating a file called main.tex.latexmain in the same directory in which main.tex resides. This file is called the master file in this manual. See Tex_MainFileExpression for an alternative way of specifying the master file.

Note

Here main.tex.latexmain is (obviously) a different file from main.tex itself. main.tex need not be renamed. This ofcourse restricts each directory to have a single master file.

Each time Latex-Suite opens a new LaTeX file, it will try to see if it is part of a multiple file project by searching upwards (to the root of the file-system) from the current file's directory to see if it finds a file of the form *.latexmain. If such a file is found, then it is considered that the current file is part of a larger project. The name of the LaTeX master file is inferred directly from the first part of the *.latexmain file as described in the example above.