[Tex/LaTex] Restructure classic thesis project with subfolders using Kile

auxiliary-filesbuild-systemkile

I would like to change the folder structure of the ClassicThesis project. My current folder setup looks like this.

|-- bib // Some *.bib files.
|-- bst // Some *.bst files.
|-- cfg // Configuration tex file and sty file.
|-- fbm // Front back matter.
|-- img // Images
|-- prj // The main tex file.
|-- src // All tex files that contain content.
|-- CHANGES
|-- COPYING
|-- README

I changed all the paths to match the new directory structure. Thus Kile complains about accessing the various files.

/usr/local/bin/pdflatex: Not writing to ../fbm/Titlepage.aux (openout_any = p).

! I can't write on file `../fbm/Titlepage.aux'.
\@include ...\immediate \openout \@partaux #1.aux 
                                                  \immediate \write \@partau...
l.87 \include{../fbm/Titlepage}

(Press Enter to retry, or Control-D to exit; default file extension is `.tex')
Please type another output file name
! Emergency stop.
\@include ...\immediate \openout \@partaux #1.aux 
                                                  \immediate \write \@partau...
l.87 \include{../fbm/Titlepage}

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on ClassicThesis.log.

When I remove the subdirectory path Kile produces a PDF with zero bytes.

Optional:
If possible, I would also like to have separate folder for the binary and temporary files. Saying, the PDF would go into bin/ and the *.aux files would go into tmp/.

Best Answer

Your setup clashes with the "paranoid" setting of TeX Live (and MiKTeX, also) when it comes to writing files. You see it in the information line

/usr/local/bin/pdflatex: Not writing to ../fbm/Titlepage.aux (openout_any = p)

The distribution is set up so that TeX programs never open for writing files whose path includes going up from the working directory, or an absolute path; if you use \include, then you run into this limitation, as

\include{<path>/filename}

starts writing a filename.aux file in the same directory as filename.tex.

An easy solution is to use \input instead of \include, because reading files has no limitation about paths.

You can also set the output directories, using a command line option for pdflatex, namely --output-dir=./tmp, for example; but this will be used also for the produced PDF file.