# [texhax] Organizing A Big LaTeX File

Reinhard Kotucha reinhard.kotucha at web.de
Sat Mar 18 20:32:23 CET 2006

>>>>> "Leung" == Leung Ngai-Hang Zachary <leungnga at comp.nus.edu.sg> writes:

> Hi, I'm writing a report for a project, which is about 30 pages or
> so.  It would be good if I could split up things into several
> different folders.  I'm thinking of one folder for my TeX files,
> another for my EPS files.

This is no problem at all, as people already reported.  You can set
\graphicspath or can say \inludegraphic{directory/filename}.

> When I compile with LaTeX, I run through every single file.

If your computer is too slow, you can set the "draft" option.
\documentclass[draft]{article} will draw rectangles instead of
including the graphics.  This is significantly faster, especially for
previewing.  It will also put black rectangles at the end of overlong
lines.  You have to remove this option when you are finished.

> Is it possible to arrange things in such a way that I only compile
> those files which have changed?

No, but you can instruct LaTeX to compile only the files you are
currently working on.

Split up your project into several files:

intro.tex
main.tex
summary.tex
appendix.tex

Then write
_______________________________
\documentclass[draft]{article}

\includeonly{intro,summary}

\begin{document}
\include{intro}
\include{main}
\include{summary}
\include{appendix
\end{document}}
_______________________________

and LaTeX will only process the files mentioned in \includeonly.

> That I can glue the files together in some way at the end?

No.  You have to run LaTeX over the complete project (at least twice)
in order to get cross references, page numbers, and the table of
contents correct.

Regards,
Reinhard

--
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------