Pergunta

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?

Foi útil?

Solução

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!

Outras dicas

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.

The main latex file which contains all the headers and gets compile can include all the chapter files via:

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

You do not need to have each chapter include the main file. Or am I missing something you are doing?

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top