Professional Documents
Culture Documents
You are here: Robert Dale's Home Page > Resources > Writing Advice for Students > Structuri ng Larg e Docume nts
8/17/12
Each i p t file {\em isn't} a standalone LaTeX file (in n u ted particular, it doesn't have a \ o u e t t l { . }line or dcmnsye.. the \ e i { o u e t and \ n { o u e t lines). bgndcmn} eddcmn} You can intersperse calls to i p twith other arbitrary text nu and LaTeX commands. This method is limited, in the following ways: 1. If your intention is to avoid printing the whole file every time you format it, you have to explicitly comment out (or delete) the \ n u s ipt you don't want, and this has the consequence that page numbers, section numbers and so on will only take account of the noncommented-out input files (i.e., if you comment out the \ n u { i s f l }in the example above then s c n f l iptfrtie eodie will start on page 1 as Section 1). 2. Worse, if you have cross-references betwen the different input files (e.g., suppose s c n f l includes a \ e that refers to a eodie rf \ a e in f r t i e then LaTeX won't be able to resolve the lbl isfl) references. As a result, this method is best suited to keeping stuff like figures and pictures in separate files, thus making the editing of the actual text less distracting. So, if you have a very complex figure constructed using the LaTeX p c u eenvironment, you might put it into a separate file and then itr include it in the following way: Yucnsefo teral cmlxfgr o a e rm h ely ope iue i Fgr~rfcmlxfgr}ta m ter n iue\e{ope-iue ht y hoy i bte ta yus s etr hn or. \ei{iue bgnfgr} \nu{yiue} iptmfgr1 \ato{yral cmlxfgr}lblcmlxfgr} cpinM ely ope iue\ae{ope-iue \n{iue edfgr}
8/17/12
.. . \nld{atie icuelsfl} \n{ouet eddcmn} This tells LaTeX to consult the a xfiles corresponding to each included file, u but only to actually include the text of the files listed in the \ n l d o l icueny line. Because LaTeX looks at the other a xfiles, it knows about section and u page numbers, cross-references, and so on. This means that the output will start at the appropriate page for the text in s c n f l . e , with eodietx appropriate section numbers and so on. Simply by changing the \ n l d o l line and reformatting, you can get different parts of the icueny entire document printed, with all the numbering being that which you would get had you printed the entire document. One potential disadvantage of this method is that, unlike \ n u , each ipt included file will automatically begin on a new page: so you don't want to use this for small arbitrary bits of a document (such as the example of an i p t figure in the previous section), but probably only for individual n u ted sections, or, if they are pretty large and deserve to start on a new page, individual subsections. In a document that consists of multiple chapters, each chapter will start on a fresh page anyway; so you can use this method to keep the text of individual chapters in separate files. For texts where you want to keep individual sections in separate files, one approach is to develop a large document using \ n l d s and then for the final printing change icue them all to \ n u s. So, while a text is being written, each chapter might ipt be an included file which consists of multiple included sections; when any particular sections are printed as a result of being mentioned in the i c u e n yline, each section will start on a new page. For the final text, nldol the section \ n l d s can be replaced by \ n u s so that only the icue ipt chapters start on new pages. Note that you can have multiple files specified in the i c u e n yline, nldol but you have to specify the names separated by commas {\em with no intervening spaces}. So this is okay: \nldol{isbtlsbt icuenyfrti,ati} but this is not: \nldol{isbt lsbt icuenyfrti, ati} From the previous example you can see that you can format discontinuous parts of the text. Don't forget that LaTeX can only take account of a xfiles corresponding to u files that are included, but not mentioned in the i c u e n yline, nldol provided those a xfiles exist, so you have to format each bit (or all the bits u at once by specifying them all in the i c u e n yline) at least once first. nldol
web.science.mq.edu.au/~rdale/resources/writingnotes/latexstruct.html
3/4
8/17/12
P lea se sen d com m en t s or qu er ies a bou t t h is web sit e t o R ober t .D a le@m q.edu .a u L a st M odif ied: 2 6 M a r ch 2 0 0 6
web.science.mq.edu.au/~rdale/resources/writingnotes/latexstruct.html
4/4