.left margin .ifnot hlp .hl 1 TABLE of CONTENTS .X Table of contents .endif hlp .HELPB TABLE__OF__CONTENTS RUNOFF can produce a table of contents (TOC) for your document that includes all chapters and and section headers at level 1. .ifnot small The _.ENABLE LEVELS command can be used to include other header levels in the TOC. The addition of items to the TOC can be enabled or disabled by the _.ENABLE TOC and _.DISABLE TOC commands. The resulting TOC is not quite the same as that produced by DSR in that the header levels are not indented by the same amount. (This may be changed in future versions.) .x DSR .if hlp .if rsx.i5;ADDITIONAL HELP AVAILABLE: filespec SEND begin figures .endif rsx .endif hlp .HELPC FILESPEC .P A TOC file is produced if you have specified a second output filespec when envoking RUNOFF. The default extension of the TOC file is _.RNT. For example, to get a TOC file and a regular runoff file, type .if RT .i10;RUN RUNOFF .i10;*EXAMPLE,EXAMPLE=EXAMPLE .else rt .i10;>RNO EXAMPLE,EXAMPLE=EXAMPLE .endif rt .s The two files EXAMPLE.DOC and EXAMPLE.RNT will be produced from the input EXAMPLE.RNO. EXAMPLE.RNT file must then be passed through RUNOFF to get the final TOC file. If the _.RNT is not satisfactory, you can edit it before this final step. .if rt For example, .i10;RUN RUNOFF .i10;*EXAMPLE.TOC=EXAMPLE.RNT .else rt .i10;>RNO EXAMPLE.TOC=EXAMPLE.RNT .endif rt .s The final EXAMPLE.DOC and EXAMPLE.TOC files can be printed separately or a new composite file can be created: .if IAS.i10;PDS>COPY EXAMPLE.TOC,EXAMPLE.DOC EXAMPLE.TXT .endif IAS .if VMS.i10;_$ COPY EXAMPLE.TOC,EXAMPLE.DOC EXAMPLE.TXT .endif VMS .if rsx.i10;MCR>PIP EXAMPLE.TXT=EXAMPLE.TOC,EXAMPLE.DOC .endif rsx .if RT.i10;COPY/CONCATENATE EXAMPLE.TOC,EXAMPLE.DOC EXAMPLE.TXT .endif rt .s The composite file EXAMPLE.TXT is now a complete document to be printed. .s The following commands control the TOC output. .HELPC SEND .endif small .left margin +5 .q _.SEND TOC [;]text .qq _.STC text .p.x SEND> TOC sends the "text" to the _.RNT file. .ifnot small The text can be used to control the TOC output. The text can actually be a set of commands. For example, _.REQUIRE "FORMAT" might be used to insert a set of commands to control the format of the TOC. If the same command appears in the text, you insure that the TOC and documentation all have the same format. .endif small .q _.SEND PAGE TOC [n] [;text] .p.x SEND>PAGE TOC sends text and the current page number to the _.RNT file. If n is specified, the text is preceded by _.IF#TOCn and followed by _.ENDIF#TOCn. The parameter n must be in the range 1 to 9. .ifnot small This command facilitates multiple indices. You can use the _.DISABLE UNCONDITIONAL command to turn off regular index entries, and pick up and print the conditional entries in a second or third pass. .HELPC BEGIN .endif small .q _.TOC .qn _.END TOC .x END> TOC .p.x TOC are not normally used. They are automatically placed in the _.RNT file by RUNOFF. _.TOC enables formatting for the table of contents. .ifnot small It does the following: .list 0 .le; New pages for each chapter are inhibited. .le; The _.CHAPTER command uses the paragraph test page to check the number of lines available. .LE; All tab stops are cleared. .le; _.NO NUMBER CHAPTER .le; _.STYLE CHAPTER 1,-1,-1,0,2 .LE; _.STYLE HEADERS ,,,,,0,0,0 .br;This sets "skips" and "test page for levels" to zero. .le; _.INDENT LEVELS 8,8 .END LIST .p _.END TOC is the complement to _.TOC. It ends the table of contents and allows normal text processing. It does the following: .list 0 .LE New pages are allowed at the start of each chapter. .LE Tab stops are ^&NOT\& changed. .LE _.NUMBER CHAPTER .le _.STYLE CHAPTER 12,1,3,-1,-1 .le _.STYLE HEADERS ,,,,,2,1,7 .le _.INDENT LEVELS 0,0 .end list 2 .lm The format of the final table of contents can be altered either by editing the _.RNT file or by using _.STC to add extra commands. The following hints may help you in designing your own format. .LIST 0 .le The _.RNT file needs _.FILL to operate properly so do not edit a _.NO FILL command into it. .LE The page numbers are right justified using tabs without ellipses enabled. If you want ellipses, use the _.SEND TOC _.ELLIPSES command. .le _.ENABLE LEVELS n1,n2 can be used to automatically determine which header levels are printed in the table of contents. The parameter n2 is the maximum header level to output to the _.RNT file and hence the maximum to appear in the table of contents. .le A title page can be placed in front of the table of contents by putting it into a separate file called TITLE and inserting _.STC _.REQUIRE "TITLE" at the front of the _.RNO file. .le You can number the table of contents in lower roman numerals with the command _.STC _.DISPLAY NUMBER RL. .le The _.STYLE commands can be inserted into the _.RNT file to control the actual format of the final table. By doing this you can vary the spacing between the entries, the spacing between items in the entries, the capitalization of the header levels and so on. .le _.INDENT LEVELS can be used to change the HEADER LEVEL indentation. .le A foreword or preface can be inserted into the table of contents file by _.STC _.REQUIRE "PREFACE". The same numbering as the table of contents will be used. You may wish to _.END TOC at the beginning of the PREFACE.RNO file if the preface contains section headers. .end list 1 .HELPC FIGURES .s.c;FIGURES .p Separate tables of contents can be generated for figures and tables. To do this, use the _.SEND PAGE TOC to send the figure names to the _.RNT file, specifying n=1 for figures, n=2 for tables. For example, assume you are creating a document called BUILDING for which you want a separate TOC of figures. At the beginning of the BUILDING.RNO file use the commands: .i5;_.SEND TOC _.IF TOC0 _.DUNC .i5;_.SEND TOC _.ENDIF TOC0 .br;And at the end of BUILDING.RNO: .i5;_.SEND TOC _.EUNC .br;To send a figure title to a separate TOC you could use a command such as .i5;_.SEND PAGE TOC 1;Figure 5 - TOP VIEW OF BUILDING .br;Then create the following _.RNO file that requires 3 passes through BUILDING.RNT: .lm+5.nf _.REQ "BUILDING.RNT" _.VARIANT TOC0 _.VARIANT TOC1 _.PAGE _.C;FIGURES _.REQ "BUILDING.RNT" _.NO VARIANT TOC1 _.VARIANT TOC2 _.PAGE _.C;TABLES _.REQ "BUILDING.RNT" .lm .p;Up to 9 different tables of contents can be created in this fashion. .endif small