26/08/2008

Compiling master documents in Kile

Kile has no special "build project" tool for building LaTeX master files (which irritates former TeXnicCenter users like me).
To handle LaTeX master files, e.g. a thesis with chapter input from \include{file} statements, define a Kile project and add all .tex files irrespective of master and child status.
Check the master file in the project options, usually the auto-detect option works (I assume Kile searches all files for \begin{document}/\end{document}). All normal build tools shold now apply only to the master file, no matter which document you are just editing.

Another issue: Using BibTeX in a Kile project. For this you need the QuickBuild tool. PDFLaTeX+BibTeX isn't preconfigured (at least with my Kile version) and has to be added by hand in Settings->Configure Kile…->Tools->Build:
PDFLaTeX
BibTeX
PDFLaTeX
PDFLaTeX
After that, you can run everything from inside Kile with the QuickBuild button.
If you are using a Kile project with a master document, you have to specify the appropriate QuickBuild configuration in the Project->Project Options dialog. (Actually, if you include a BibTeX bibliography in a .tex file, Kile seems to run BibTeX and 3 times LaTeX automatically. Still, it's good to have the QuickBuild handy). Also, there was a bug removing duplicate entries like "PDFLaTeX PDFLaTeX" in the Quickbuild configuration of Kile/KDE4 (fixed by now).

2 comments:

Anonymous said...

Hi,

you are looking for the master document mode given in the settings menu.
This lets you choose a document which is always compiled, and this does not have to be the current one.
See also http://kile.sourceforge.net/Documentation/html/build_master.html

avocadohead said...

I believe that's more or less the gist of what I wrote ;-) And master documents are defined in Project Options and not in the settings menu.