!title{Supplements Style} !pagetitle{Supplements} !author{Norman Gray} !maketitle !begin{TeXtext} ! \begin{abstract} ! This style file allows a possibly complex \LaTeX{} document ! to be split amongst several input files, which are \LaTeX ed ! entirely independently, whilst still ! synchronising a specified list of counters, and allowing ! cross-references, citations, and indexing commands to be used ! in a consistent way. ! \end{abstract} !\end{TeXtext} !activate\\ !def\{{!tt!char"5C}} % make \ print nicely !helpsection 1 Supplements.sty Sometimes, for rather TeXnical reasons, it's convenient to LaTeX parts of a document separately, and collate the separately printed parts later. For example, if you want part of your document to have its own page length or breadth, for some reason, you'll find it's almost impossible to persuade LaTeX to confine those settings to just the pages they're intended. for. Alternatively, you might want some pages to be produced on a colour printer, or else some fiendish TeXing might make your document run out of memory unless it's split up. This style file allows parts of a document to be kept in separate files (which we will describe as supplements files), and LaTeXed separately, but remain fully integrated with the file they belong to (the main file). This means that cross-references, with \ref, citations, with \cite, and indexing should all work properly (though you should pay close attention to the instructions in the `LaTeXing' section, below). Assume a main file called `main.tex', and a file of supplementary pages called `SF.tex' (there can be several of these files, with appropriately distinct names). Both files should include the style option `[...supplements...]' in the \documentstyle command. !helpsection 2 Supplements_file In the supplements file, `SF.tex', the pages to be inserted lie between !verbatimline[3] \begin{supplements}{main}{counters} ... \end{supplements} The first argument is the name of the main file into which the pages are destined to be inserted, and with which they are to be synchronised, and the second argument, `{counters}' contains a list of the counters which are to be synchronised, for example, `{page,table}'. For a list of counters which may be relevant, see the LaTeX book, page 91. The first command reads in `main.aux', if it exists, which sets up cross references and citations, and sets the starting values of the synchronised counters. The `\end{supplements}', just before the `\end{document}', writes the number of supplementary pages to the file `SF.aux'. Although it's not an error, there shouldn't be more than one pair of `\begin...\end{supplements}' in the file. !helpsection 2 Main_file In `main.tex', the command `\thesupplements[SF]' should be given at the point where the supplements in file `SF.aux' are to be inserted. It leaves the appropriate gap in the necessary counters, which are specified in the supplements file. If the argument `[SF]' is omitted, it defaults to `[supplements]'. !helpsection 2 LaTeXing Because a lot of information is being shuffled about between files, the sequence of LaTeX runs can be rather involved. The explanations below are for the most complicated case, of a reference to a table within a supplements file. If you're not interested in the details, just follow the instructions!! These instructions assume that you are starting from scratch, so that you have no aux-files already in your directory. If you don't use BibTeX, you don't have to re-LaTeX your text in step 2. If you're not starting from scratch, you simply need to cycle through steps 3 to the end. !begin{enumerate}!def!Item#1:{!item {!bf #1}} !Item LaTeX the supplements file(s): This works out how many pages, tables,... are in the file of supplements, and puts the information, along with the appropriate \citations, in the .aux file for the main file to read. !Item LaTeX the main file: At the point where `\thesupplements' appears, the necessary counters are incremented, and the main file writes, in turn, the page, table,... at which the supplements file should start numbering. If there are any \cite's within the supplements file, then this run should be arranged to produce a correct bibliography (in other words, if you're using BibTeX, you'll have to LaTeX the text again). !Item LaTeX the supplementary file(s) again: This time, the supplementary file knows the values at which the selected counters should start, also any index entries and list-of-tables entries should have the correct numbers. !Item LaTeX the main file again: If you \ref'er to pages within the supplements file, then you'll have to run LaTeX again to get those cross references right. !Item ...and again: If you have a \listoftables (or figures) command in the main file, and a table (or figure) in the supplements file, then you'll have to run LaTeX one more time, to give the lists of tables the correct page numbers. !end{enumerate} !helpsection 2 Indexing You may give \index commands in the supplements file (you should not give the \makeindex command, though). If the \makeindex command is given in the main file, an appropriate index will be produced. !helpsection 2 Limitations !begin{itemize}!activate`* !let*!item * It shouldn't be terribly difficult to persuade the style to synchronise topmarks, as well, but it doesn't, at the moment. * Although, again, it shouldn't be a terribly difficult thing to implement, the style doesn't allow you to have more than one lot of supplements in a single supplements file. !end{itemize} !tableofcontents