Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting relative Tex-Master file in Latex

I use Aquamacs and TeX Live 2009 to edit my LaTeX files. As my publications tend to get quite big, I want to structure the source folder containing all my LaTeX files. Like e.g.

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

One can define the %%% TeX-master: "main" local variable at the end of each "sub" file to define a master file that contains all headers etc. That works fine if the subfiles are in the same directory as the main file. If I try to define the main file here (e.g. main.tex in chapter1.tex), LaTeX cannot find the specified file.

What can I do in this case?

like image 420
Eric Avatar asked Sep 26 '11 16:09

Eric


2 Answers

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

like image 88
Eric Avatar answered Oct 18 '22 11:10

Eric


Just an idea (not tested):

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

.. is the usual Unix shortcut for one directory level above. I don't know if this works for the TeX-master variable of AUCTeX, but it is worth a try.

like image 3
Paŭlo Ebermann Avatar answered Oct 18 '22 13:10

Paŭlo Ebermann