[Help] [LaTeX top]

Handling long documents in latex

If you need to do long document in latex such as a thesis, it helps to know the following few tricks.
  1. Create a separate subdirectory for the paper, this way you will have no confusion about which files belong to which paper.
  2. Arrange you files so that you have one top file and then individual files for each chapter. For example, thesis.tex (your top file) contains
    \documentstyle[12pt,suthesis,mymacros]{report}
    % any personal definitions (or redefinitions) should be in
    % mymacros.sty (or whatever you wish to call the file).
    % No definitions should be in any of the subfiles (preface.tex,
    % chap1.tex...) as definitions there can lead to some odd surprises.
    
    % preliminary comments and information
    
        \title{How to Write Theses\\
     	    With Two Line Titles}
        \author{John Henry Candidate}
        \principaladviser{John Parker}
        \firstreader{John Green}
        \secondreader{John BigBooty\\(Another Department)}
        \thirdreader{Jane Supernumerary} %if needed
    
    % The following stops latex and allows you to select particular
    % chapter(s) that you want latexed.  When it stops, type in
    %   \includeonly{chap1,chap3}
    % and only chap1 and chap3 will be processed.  However, if you have
    % previously processed chap2 it will know that chap3 does not start
    % immediately after chap1.  This allows page numbers to remain
    % consistent (among other things).
    \typein{includeonly command}
    
    % other people prefer putting the \includeonly command directly in the
    % top file and editing it as needed.  If you type a carriage return or
    % there is no \includeonly command, all the included files are processed.
    
    \begin{document}
    
    % each included file must be one that starts on a new page (hence
    % chapter breaks are a good place to do this).  
    % place all text to be printed in the include files.  Ideally if you
    % typed \includeonly{} nothing should be printed.
    % note that includes should only happen in this file. 
    
    \include{preface}  % the file preface.tex
    \include{chap1}    % the file chap1.tex 
    \include{chap2}    % the file chap2.tex 
    \include{chap3}
    \include{chap4}
    \include{chap5}
    
    \end{document}
    
  3. Use previewing and printing selected pages (see 'help tex-preview') to work on your paper.
  4. See the main latex page for some other tricks.

[CSLI] [Help] [Stanford] [Search CSLI help pages] [Search CSLI pages] [Search Stanford]
Emma Pease
Last modified: Fri Nov 12 15:14:37 PST 1999 by emma@csli.Stanford.EDU