Install a relative Tex-Master file in Latex

I use Aquamacs and TeX Live 2009 to edit my LaTeX files. Since my publications tend to get quite large, I want to structure the source folder containing all my LaTeX files. For instance,

  • [bib]
  • [Images]
  • [chapters]
    • chapter1.tex
    • chapter2.tex
  • main.tex

At the end of each "under" file, you can define the local variable %%% TeX-master: "main" to determine the main file containing all the headers, etc. This works fine if the subfiles are in the same directory as the main file. If I try to define the main file here (for example, main.tex in chapter1.tex), LaTeX cannot find the specified file.

What can I do in this case?

+4
source share
3 answers

From the Aquamacs menu bar, select Latex / Multifile/Parsing / Reset Buffer or the ^C ^N shortcut. When specifying %%% TeX-master: "../main" in one of the chapters of the subfolders, the main tex file is correctly compiled!

+5
source

Just an idea (not tested):

 %%% TeX-master: "../main" 

.. is a regular Unix shortcut for one level up. I don't know if this works for the TeX-master AUCTeX variable, but it's worth a try.

+3
source

The main latex file, which contains all the headers and is compiled, can include all section files using:

 [...] \input{chapters/chapter1.tex} \input{chapters/chapter2.tex} \input{chapters/chapterTitleOfChapter.tex} [...] 

You do not need each chapter to include a main file. Or am I missing what you do?

0
source

All Articles