.tty1 .vs .hm12 .ff1 .c The TEDI Formatter .s . .c VAX/VMS Version .s2 .c Clair W. Nielson .c Los Alamos National Laboratory .c Los Alamos, New Mexico 87545 .s3 .c INTRODUCTION The TEDI formatter is a computer program, an integral part of the TEDI editor, which takes a source file of text and formatting codes and outputs the text in a form so as to provide pagination, margin alignment, figure and footnote insertion, columnar alignment, and a wide variety of other formatting features. By being an integrated editor and formatter, TEDI can display the consequences of various formatting choices immediately. Some of the formatting features such as equation layout and the positioning of super~scripts and sub~scripts require a daisy-~wheel printer for final output. In addition, the extended character set of 192 characters on-~line is supported only for the Qume Twin-~Track printer. However, most of the formatting features can be effectively used with almost any soft-~copy or hard-~copy terminal or printer. The syntax used for formatting is closely related to that of the DIGITAL formatter RUNOFF. There are enough differences, however, that a previous RUNOFF user should read the following documentation before using TEDI. .s3 .c EXECUTING TEDI Although it is expected that a frequent user of the TEDI formatter will use the TEDI editing commands to prepare the text, this is not mandatory; the source text may be prepared with any editor with which the user is familiar. However, the file must not have internal sequence numbers. If these have been introduced by either the SOS or EDT editors, they should be removed using one of these editors before using the source text as input to the TEDI formatter. The TEDI editor-~formatter may be started up with one of two forms of VAX/VMS command: .ts20 .s !TEDI filename .s or .br !RUN TEDI .br !filename_____. .s The first form requires that a suitable symbol definition for TEDI has been made, either by an individual user or on a system-~wide basis. An example of such a definition if the executable program TEDI.EXE is on disk DBA1: in directory @[NIELSON@] is .s !TEDI:==$DBA1:@[NIELSON@]TEDI_______. .s Such a definition might be put in a STARTUP.COM file. Many installations will make this kind of definition global and it will therefore automatically be available to all users. The second form of running TEDI is appropriate if the file TEDI.EXE is in your current directory. When using this form, the filename may not be put on the same line as the RUN command but is input in response to the prompt "File:". After accepting either of the above initiation commands, TEDI will make a working copy of your file, report the number of lines found in the file, and present the asterisk "*" command prompt. At this point you may use any of TEDI's editing or formatting commands. TEDI is terminated by one of two commands, "END" or "QUIT". If you give the "END" command and you have made any changes in the file, the working copy will be copied to create a new version of the named file. If you give "QUIT", no such copy will be made, the implication being that you do not want to save the changes you have made. Another difference between the two commands is that "END" saves the working file itself. The purpose of this is that on subsequent initiations of the TEDI program, if you do not specify a filename, TEDI assumes you wish to work on the file you were previously working on and immediately reports the number of lines as found in the old working file. This can save time if the file is large since making a new working copy is eliminated. The use of the TEDI editing commands to enter the source text is described elsewhere. Once the source text is prepared, formatting it to the final text form is initiated by one of four variations of the format command: .ts12 32 .s !Fm,n!Format lines m through n to the terminal, .s !FPGp,q!Format pages p through q to the terminal, .s !FPFp,q/filename!Format pages p through q to "filename", and .s !FPPp,q!Format Pages p through q to logical .br !!device "TEDI$PRINT". Note that lines m and n refer to line numbers in the text whereas pages p and q refer to page numbers in the text. The first of these forms, "Fm,n", is used for interactive examination of a small section of text on the terminal; all pagination control is disabled. Typically this command will be used as you check the layout of a table or equation, or perhaps just want to contemplate the wording of a single paragraph. The other commands format at least one entire page, and correctly include all pagination control. In order to accomplish this, the computer must "think through" all pages prior to page p, so for long files there may be a significant delay before output begins. (For this reason, very large documents should be broken up into separate parts--they may be combined later after changes are infrequent.) The logical device TEDI$PRINT must be assigned by you if you wish to use the "FPP", Format Pages to Printer, command. It may be assigned to a disk file or to any spooled output device. An example of such an assignment is .tp8 .s !ASSIGN LP: TEDI$PRINT .s The ASSIGN command is a VAX/VMS command and must be given to the monitor prior to the execution of TEDI. The "Fm,n" command may occasionally use inappropriate values of global parameters which have been changed in a range of lines outside of lines m through n. This problem will usually be corrected by making one use of the "FPG" command to format the entire page containing the section of interest. The global parameters will then be correct for subsequent uses of the local "Fm,n" command. Sometimes it will be necessary to enter redundant settings of global parameters such as tab stops to make local formatting correct. Optional additional numerical arguments on the Format commands will be described in the section entitled "Output Device Selection". .s3 .f .c FILLING AND JUSTIFICATION The most obvious transformation from source text to final output that takes place under the action of the format commands is the redistribution of words between lines and along each line. These two transformations are called filling and justification respectively. Both may be disabled as will be explained later, but both take place by default. Filling takes successive words in the source text without regard to line breaks and puts as many of them as possible in an output line, subject to the margin settings (which initially have default values). Filling then adds space between the words so that the right margin is "smooth". As an example, suppose the source text contains the nine lines: .nt5 .nf "Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and dedicated, can long endure." .en .s .f If these lines are transformed by one of the Format commands using fill, but not justification, they will appear as .s .nj .nt5 "Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and dedicated, can long endure." .en .s .j If they are transformed using both fill justification they will appear as .s .nt5 "Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and dedicated, can long endure." .en .s On ordinary output devices, the extra space is achieved by adding an additional space character between certain words; on daisy-~wheel printers each space may be stretched to the same length, making for better appearance. The principal power of the TEDI formatter (and other similar formatters) is that the source text may be entered and modified without regard to where lines and pages begin and end. This capability frees a writer to make many revisions without any inhibition due to the cost of retyping, since the actual retyping is a purely mechanical step. Format codes are available to disable the automatic fill and justification. They should appear alone at the beginning of separate lines at the point in the text where a change in the mode is desired. They are .nf .s !@.nf!No Fill !@.f!Fill .f .s3 .tp9 .c SPECIAL CHARACTERS .f The source text file contains all of the actual text which will appear in the final text and various indicators of how the material is to be formatted. These indicators are of two types: special characters which appear anywhere in the running text, and format codes which are short commands that begin with a period and must appear as the only content of separate lines. The function of these special characters and codes will be described throughout the remainder of this document. Although the format codes can safely be ignored until needed, the special characters cannot since if they occur in the source text without special prefixing they will have their formatting effect whether intended or not. The special characters are: .nf .ts15,20, 42,47 .s !@!!Exclamation Point!@~!Tilde !@!Right Angle !@_!Underline!@@!At sign !@[!Left Bracket!@]!Right Bracket !@{!Left Brace!@}!Right Brace !@&!Ampersand!@\!Backslash !@|!Vertical Bar!@^!Caret !@#!Sharp!@?!Question .f While this may seem like a large part of the ASCII character set to use for formatting, these characters are infrequently used for other purposes in most kinds of text, so the inconvenience is not great. When one of these characters is desired in the output text, the override at sign "@@" (think "actual") preceding the character will make it appear. For example, if you wish the final text to show "x_@<@<_y_@<@<_z", the source text must read "x_@@@<@@@<_y_@@@<@@@<_z". .s3 .c HYPHENATION AND REQUIRED BLANKS The tilde "@~" special character has different interpretations in fill or no-~fill modes. In fill mode it indicates an optional hyphenation point and in no-~fill mode at the end of a line it indicates a line to be continued. In fill mode, if the tilde "@~" is found in the middle of a word, the formatter will assume it is appropriate to break and hyphenate the word at that point if doing so would make the filling process more complete. The final text hyphenation will be with the actual hyphen, not the tilde. If no break is appropriate because the word falls in the middle of a line, the tilde is deleted and the word appears unbroken. It is desirable to provide these optional hyphenation points in advance in very long polysyllabic words. Occasionally the need for hyphenation will appear only after the first trial formatting pass, and the optional hyphenation points may then be added as needed. If subsequent additions to the text move the previously hyphenated word to the center of the line, the tilde will not appear so it need not be deleted. For words which have required hyphens and which also may need to be broken, put the tilde the required hyphen, e.g., "sub-@~tree". At the end of a line in no-~fill mode, the tilde indicates that the next line of source text should be continued on the same line of final text without interruption. This is convenient if the source text is being prepared on an 80-~column terminal whereas output is to be on a 150-~column printer. Sometimes the addition of non-~printing control characters will make a source text line considerably longer than the corresponding final text line, and this makes breaking the source text into more than one line desirable. This need is especially evident in the formatting of equations which will be described later. As an example, the source text lines .s .nf !.nf !Now is the time@~ !for all good men .s will format to .s !Now is the time for all good men. .f As is evident from many of the examples, in fill mode the formatter may change the spacing between words. For some purposes, it is desirable to specify the exact number of blank spaces that are desired. For this purpose, the underline character "@_" is used. For example, .s !z@_=@_x@_+@_y .s will always format to .s !z_=_x_+_y .s even in fill mode, with no alteration of the blank spacing between the three letters. Moreover, such a unit will never be split across lines. In no-~fill mode, blank spaces are not altered, so the required blank is superfluous. .s3 .c PARAGRAPHS AND MARGINS The example shown earlier of filling and justification did not have any breaks in the continuous stream of sentences. In order to allow for paragraphs, the convention is made that any line beginning with one or more blanks is the first line of a new paragraph. In the formatted output, this line is possibly preceded by some blank lines and the line itself is indented. The default values are skip one line and indent five spaces. Thus, in the preceding example, if lines one and seven were begun with at least one blank in the source text, i.e., .s .nf .nt5 "Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and dedicated, can long endure." .en .f .LM .RM .s the formatted output would appear as two paragraphs of the form: .tp12 .nt5 "Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and dedicated, can long endure." .en .s The specific value of the paragraph parameters may be reset by a format code of the form .ts10,20 .s !.p i,s!Paragraph indent i, skip s .s where i is the number of spaces to indent and s is the number of lines to skip. Thus if earlier in the source text the format code @.p 0,2 had occurred the output would appear as .tp12 .nt5 .p0,2 "Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and dedicated, can long endure." .en .s .p Two additional format codes are used to set the left and right margins. They are .s !.lm m!Left Margin column m .br !.rm n!Right Margin column n .s Margins and many other parameters are specified in terms of column number. The first column that a device can print is called column 1 and column numbers continue from one up to the maximum column number of the device which is often column 80 on an ordinary terminal but which is typically 128 on a line printer and may be 150 or greater on a daisy-~wheel printer. The default settings for left and right margins are .lm_5, .rm_75, which are usable on almost any output device. In the course of a document you may find it advantageous to temporarily change the left and right margins for special effect. One non-~obvious combined use of the margin settings and the paragraph parameter setting codes is to prepare the bibliography section of a technical paper. The technique used is to move the left margin right four spaces, define the paragraph indent as , and then considers each entry in the bibliography as a paragraph. For example, the source text: .s .nf @.lm 9 @.p-4,0 1. Balcomb, J. D., J. C. Hedstrom, and R. D. McFarland, "Simulation Analysis of Passive Solar Heated Buildings - Preliminary Results," Vol. 19, No 3, 1977. 2. Kreith, Frank, @, New York: Intext Educational Publishers, 1973. 3. Balcomb, D., "Designing Passive Buildings to Reduce Temperature Swings", (Los Alamos Report No. LA-UR-78-1316), Tempe, Arizona: Arizona State University, Department of Architecture, 1978. @.p @.lm .s appears formatted as .s .f .lm 9 .p-4,0 1. Balcomb, J. D., J. C. Hedstrom, and R. D. McFarland, "Simulation Analysis of Passive Solar Heated Buildings - Preliminary Results," Vol. 19, No 3, 1977. 2. Kreith, Frank, , New York: Intext Educational Publishers, 1973. 3. Balcomb, D., "Designing Passive Buildings to Reduce Temperature Swings", (Los Alamos Report No. LA-UR-78-1316), Tempe, Arizona: Arizona State University, Department of Architecture, 1978. .p .lm .s2 Moving the left margin four spaces to the right is accomplished by the .lm 9 format code since the default of .lm 5 was in effect. The paragraph indent of -4 then moves the first line of each entry (indicated by the initial blank in the source text) to column 5. The second paragraph parameter of zero eliminates any blank lines between entries as is customary in bibliographies. Note that the final use of the .p and .lm format codes without any numerical arguments restores the default values after the special section is finished. If you were not using default values in the first place, you would need explicit numerical arguments to restore the previous values. Most users like the justified right margin which is provided as a default. However, sometimes it may not be suitable. In particular, if the distance between the right and left margin is reduced, the size of the spaces needed to achieve right justification may be unreasonable. Two format codes allow turning right justification on and off at will. The are .s !.j!Justify .br !.nj!No Justify .s In the no-~justify mode, output has what is called a "ragged right" margin. If the bibliographic example is formatted with the addition of the ".nj" format code, the result is .s .f .lm 9 .p-4,0 .nj 1. Balcomb, J. D., J. C. Hedstrom, and R. D. McFarland, "Simulation Analysis of Passive Solar Heated Buildings - Preliminary Results," Vol. 19, No 3, 1977. 2. Kreith, Frank, , New York: Intext Educational Publishers, 1973. 3. Balcomb, D., "Designing Passive Buildings to Reduce Temperature Swings", (Los Alamos Report No. LA-UR-78-1316), Tempe, Arizona: Arizona State University, Department of Architecture, 1978. .p .lm .j One of the niceties of the TEDI formatter is that widows (the first line of a paragraph alone at the bottom of the page) and orphans (the last line of a paragraph alone at the top of a page) are prevented. This feature is also valuable in the extended use of the paragraph concept such as that just shown for bibliographies. .s3 .tp9 .c BREAKS, SKIPS, INDENTS, AND CENTERING For text containing only regular paragraphs, the setting of paragraph parameters may be sufficent to provide all desired skips and indents. However, most documents will require additional format codes to provide the necessary spacing and indenting for headings, lists, and other special text material. The simplest of these is the break format code, .s !.br!Break .s which causes the next line of source text to be started on a new line of final text, even in fill mode. The break is like going into no-~fill mode for one line. The skip and blank format codes, .s !@.s m,n,f!Skip .br !@.b m,n,f!Blank .s cause a break followed by blank lines. The optional numeric arguments are respectively m, the number of whole spaces, n the number of half spaces, and f, a forcing switch. The difference between skip and blank is that skip spaces are in terms of the current spacing size defined later under the space format code whereas blank is always in terms of single spaces. Thus if the space command has made double spacing operative, a simple ".s" is two blank lines whereas ".b" is one blank line. In single-~space mode, both codes behave identically. The forcing parameter determines what happens if any of the spaces fall at the top or bottom of a page. Normally these would be omitted since the skip is usually meant to set some item apart from the surrounding text, and the new page is sufficient for that purpose. If the forcing parameter "f" is present and non-~zero, the blanks at the top of a page are put in. This will be used principally at the beginning of a new document or chapter to cause the text to begin further down on the page than it will on the second and subsequent pages. The center format code, .s !@.c k!Center .s causes a break in the text and then causes the next line of the source text to be centered on column k/2. If k is omitted, the line is centered at (lm+rm)/2 where lm is the left margin setting and rm is the right margin setting. Normally k will be omitted. If a centering other than between the left and right margins is desired, determine the left column and right column numbers between which centering is desired, add them, and use that number for k. The indent format code, .s !@.i n!Indent .s causes a break in the fill and then starts the next line n spaces to the right of the left margin. For example, at the beginning of a letter one might use the indent code to place the date over to the right, e.g., .s !@.i40 .br !January 1, 1981 .s will format to .s .i40 January 1, 1981 .s For more complicated indentation, as in tables, the tab stop concept described later is more appropriate. .s3 .tp9 .c LINE SPACING AND PAGINATION The default line spacing is single space. Alternate spacing is indicated with the space format code, .s !@.sp m,n!Space .s which sets spacing to m whole spaces plus n half spaces. The half spaces are effective only when output is to a daisy-~wheel printer. For example, .sp2 causes double spacing, whereas @.sp1,1 causes one and one-~half spacing when output to a daisy-~wheel printer, and single spacing when output to other devices. Page breaks are determined automatically by TEDI when formatting with any of the format page commands. The default page size is 55 lines to the page. The page size format code, .s !@.ps k!Page Size .s allows changing the page size to k lines. A forced page break, before the maximum number of lines has been inserted, may be caused with the page format code, .s !@.pg n!Page .s where n may be omitted. If n is omitted, page numbering continues sequentially from the previous page number, whereas if n is present, page numbering is restarted with the new page being numbered "n". The actual behavior of the output at the occurrence of a new page depends on the output device and the setting of the form-~feed format code, .s !@.ff i!Form Feed .s where i is a switch which may have values -1, 0, or 1. If i=1, then a form-~feed character is sent to the output device. Daisy-~wheel printers, line printers, and some hard-~copy terminals will eject the paper to the beginning of a new sheet when the form-~feed character is received. If i=0, the default, three blank lines are inserted between pages, which is all that is appropriate, for example, when proof-~reading output on a CRT terminal or a thermal paper printer. If i=-1, output is stopped between pages and resumed upon receipt of an isolated carriage return from the input terminal. This setting is appropriate only when outputting text on single sheets of paper to a daisy-~wheel printer. Other values for i will be described under the "Double Column" section later. Before new sections of a document and before some special lists, headings, or tables, it may be appropriate to go to a new page if too few lines remain on the present page. However, during the preparation of the source text, the exact position on the page of the final text may not be evident. To allow control of this situation, the test page format code, .s !@.tp k!Test Page .s is used. If fewer than k lines remain on the present page, a page eject is performed. This kind of test page is automatic at the beginning of a new paragraph and in connection with other features to be described later. .s3 .tp9 .c TAB STOPS Columnar alignment of text material is frequently desired, particularly in technical documents. For example, a tabular presentation of the numerical values of various quantities requires such alignment. This material is usually input on a line-~by-~line basis and should therefore usually be put in no-~fill mode with the ".nf" format code. To provide columnar alignment, TEDI uses a symbolic tab character, the exclamation point "@!" in the source text, to indicate where the text to be aligned begins. The information as to it should be aligned must have previously been provided in the tab stop format code, .s !.ts t1,t2,t3,....,t20_____Tab Stops .s which allows the specification of up to 20 separate columns using location specifiers t1, t2, ...., t20. The simplest location specifier is an unsigned integer, which indicates left alignment at the corresponding column number. For example, the source text lines .s .nf @.nf @.ts 10,20,30 @!one@!two@!three @!alpha@!beta@!gamma .s will cause final text of the form .s .nf .ts 10,20,30 !one!two!three !alpha!beta!gamma .s .f Although left adjust tab stops are by far the most common, TEDI provides a total of four different kinds of tab stops. .ls1 .le Left adjust tabs, which are indicated by an unsigned number, e.g., ".ts15". .le Right adjust tab stops, which are indicated by a negative number, e.g., ".ts-15". .le Centered tab stops, which are indicated by a tab stop number preceded by an explicit plus sign, e.g., ".ts+15". .le Decimal adjust tab stops, which are indicated by preceding the number with both a plus and a minus sign, e.g., ".ts +-15". .el .s These may be combined on one line in a multiple tab stop setting, e.g., ".ts 10,+25,+35,+-40,-80". The first tab given that exceeds the number of tab stops specified will cause the remainder of the line to be right adjusted at the right margin. The amount of text which is included in the material for a single column runs from the character following the exclamation point up to just before the next exclamation point or blank. If blanks are to be included in a column, they must be required blanks, the underline "@_". The following example shows the use of decimal adjust tab stops including the use of required blanks to include the dollar sign appropriately. The source text .nf .s @.nf @.ts 20,+-50 @!Housing@!$@_@_250. @!Clothing@!50. @!Utilities@!75.68 @!Tax@!20.13 @.s @!Total@!$@_@_395.81 .s produces the final text .s .nf .ts 20,+-50 !Housing!$__250. !Clothing!50 !Utilities!75.68 !Tax!20.13 .s !Total!$__395.81 .ts12,32 .f .s3 .tp9 .c FIGURES AND FOOTNOTES One of the more tedious aspects of typing technical papers is the insertion of figures and footnotes, since it requires a great deal of line counting and advance planning. The TEDI formatter takes care of this planning automatically. The source text simply includes the footnote or figure caption information at the point of its initial reference, and final placement is determined during the formatting stage according to some simple rules. A footnote is preceded by the footnote format code, .s !@.fn!Footnote .s and followed by the end foot note format code, .s !@.efn!End Footnote .s For example, the insertion in the running source text of the lines .nf .s @.fn *This is a footnote. @.efn .s will cause the formatter to place .s @_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_ .br *This is a footnote. .s .f at the bottom of the current page. If more than one footnote has been specified, they will all appear together preceded by a single horizontal line. Figures are inserted in a similar manner, preceded by the figure format code, .s !.fg n!Figure .s and followed by the end figure format code, .s !.efg!End Figure .s The codes precede and follow the text for the figure caption. In the final output, n additional lines will be left for the figure proper. The lines to be allotted for the figure caption will be computed and added to that specified by the user for the figure itself. Figures will always be placed in groups at the top or bottom of a page, appearing on the first page with sufficient available space. For example, the source text .nf .s @.fg 5 @.c Fig. 1 @.c Vacuum system layout. @.efg .s will lead to final text of the form .s5 .c Fig. 1 .c Vacuum system layout. .s2 .f Five lines have been allotted for the actual insertion of the figure. The final text for this figure will be deferred until the bottom of the current page, the top of the next page, or even further, depending on how much space is available and how many other figures are outstanding. A special use of the figure mechanism is for tables or other text material which should not be broken across pages and whose final placement may follow some lines after the initial reference to it. For this purpose use the figure format code with no line count for the figure. The entire table contents is inserted in the location otherwise used for the figure caption and is followed by the end figure format code. .s3 .tp9 .c PAGE NUMBERS, TITLES, AND SUBTITLES By default, page numbers are output at the top of each page except the first. The number is placed between hyphens. Page numbers may be suppressed with the no number format code, .s .ts12,32 !.nnm!No Numbers .s and reactivated with the number format code, .s !.nm!Numbers_. .s The page numbers normally begin at "1" and increment for each new page. As described under the page format code, ".pg n", the number values may be restarted at any chosen value "n". Page numbers are used as arguments to the format pages commands such as "FPG p,q", format pages p through q. These numbers always start at one and increment with each page output, regardless of changes in page numbers caused by the ".pg n" format code. For example, if a file used default numbering for the first ten pages, and then restarted the page number with a ".pg 1" format code, and then contained ten more pages, the number printed on the output pages would go from "1" to "10" once and then "1" to "10" again. However, for use as arguments to the FPG command, the pages would be considered numbered "1" to "20", i.e., the format page commands always use the ordinal position of the page in the output, not the printed page number. The format code title allows adding titles and subtitles at the top of every page. The simplest form the the title format code, .s !.ti!Title .s causes the next line to be interpreted as a running title which remains in effect until another title code is encountered. When such a title has been encountered, the page number, if activated, is placed over against the right margin, and the hyphens are omitted. One and only one exclamation point tab "@!" may be put in the title text. Its effect is to right adjust the text after the exclamation point just before the page number. Thus, a title specification of the form .s @.ti .br Header Text@!Page- .s will cause the top of page 10 to appear as .s .ts Header Text!Page-10 A subtitle may be added just below the title by another specification using the title format code with the numeric argument "2", e.g., .s @.ti2 .br Subtitle Text .s if specified in conjunction with the previous title example will cause every page except the first to have a heading similar to .s Header Text!Page-10 .br Subtitle Text .s (The title format code without a numeric argument, ".ti" is equivalent to ".ti 1".) .s3 .tp9 .ts12,32 .c NOTES, LISTS, AND HEADERS Several text layouts which can be achieved through combinations of previously described format codes occur often enough to justify special format codes to make their use more convenient. The note format code, .s !.nt i,s,t!Note .s precedes a body of text which is to be indented from both sides by i spaces. The note is preceded and followed in the final text by s line spaces, and a test page of t lines is done before putting the output on the current page. Defaults are i=10, s=1, t=3. Any specific header for the body of text, such as "NOTE", must be put in by the user, including any centering or skip codes. In this way the note concept can be used for a variety of purposes, such as quoted text passages, warnings, or examples, items for which no single heading would be appropriate. The note text is followed by the end note format code, .s !.en!End Note .s which terminates the note and restores the previous margin settings. As an example, the source text .s .nf @.nt @.c WARNING @.s This appliance includes a magnetron tube which emits powerful microwaves. The door interlock must be kept clean at all times so as to prevent the leakage of microwaves outside the cooking area. @.en .s .f will cause text output of the form .nt .c WARNING .s This appliance includes a magnetron tube which emits powerful microwaves. The door interlock must be kept clean at all times so as to prevent the leakage of microwaves outside the cooking area. .en after which the text returns to normal margins. A list is an enumeration of several items in an indented form. The TEDI formatter provides for lists nested to three levels as in an outline. The first level elements are labeled with numerals, the second level elements are labeled with upper case characters, and the third level elements are labeled with lower case characters. Each level is indented from the left, the first by nine spaces and each subsequent level by an additional five. The beginning of a new list is signaled with the list format code, .s !.ls m,n!List .s where the optional arguments indicate that each list element is to be preceded by m whole and n half spaces. The defaults are no spaces. After the list format code has been given, each item is preceded by the list element format code, .s !.le!List Element .s which informs the formatter to increment the label and start a new item. The end list format code, .s !.el!End List .s is placed at the end of all items at a particular level, causing a return to the next higher level, if any. As an example, the following source text .s .nf @.ls @.le Animal @.ls @.le Mammals @.ls @.le Monkey @.le Cat @.le Dog @.els @.le Reptiles @.le Fish @.els @.le Vegetable @.ls @.le Green @.le Red @.els @.le Mineral @.els .s will format to .s .f .ls .le Animal .ls .le Mammals .ls .le Monkey .le Cat .le Dog .els .le Reptiles .le Fish .els .le Vegetable .ls .le Green .le Red .els .le Mineral .els .s The list concept applies in fill mode, and if the text of an element is sufficiently long, it will be filled and justified in a way appropriate to the outline concept. By far the most common use of the list format is for a single level of enumerated items. For example, the listing of the four kinds of tab stops in the TAB STOPS section above was produced with the source text .s .nf @.ls1 @.le Left adjust tabs, which are indicated by an unsigned number, e.g., ".ts15". @.le Right adjust tab stops, which are indicated by a negative number, e.g., ".ts-15". @.le Centered tab stops, which are indicated by a tab stop number preceded by an explicit plus sign, e.g., ".ts+15". @.le Decimal adjust tab stops, which are indicated by preceding the number with both a plus and a minus sign, e.g., ".ts +-15". @.el .s .f Refer to the TAB STOPS section to see the formatted form. The final special formatting layout supported is the decimalized header. These headings are useful in specifications and other kinds of documentation for which the decimalized numbering provides a convenient referencing mechanism. A header is a section title combined with a multi-~part level number of the form i.j.k.l...m, with i being called the zero level, j the first level, up to a maximum of m, the fifth level. The level of a particular header is the level number which changes with that heading. For example, if the previous level number was "2.1.5" and the level number for a new heading is supposed to be "2.1.6", the new header is called a second level header. On the other hand, if the new header number is to be "2.2", the header would be called a first-~level header. A header number such as "2.2" is the same as "2.2.0.0.0.0", but trailing zeros in header numbers are omitted. When you wish to introduce a new heading, you input the header level format code, .s !.hl n,s,t!Header Level .s followed immediately by a line containing the text of the header. The "n" in the format code is the level number. The numerical value of this level is incremented by one and all higher header level numbers are reset to zero. For example, if the previous header number were "2.1", the source text, .s @.hl 1 .br Power Supplies .s the final text would contain a heading of the form .s2 2.2__Power Supplies .s All levels are initially zero unless explicitly initialized with the header number ".hn" code described below, except level zero, which is initially one. The first and second level headers are preceded by s spaces (default two) and followed by a break. Header levels three to five are also preceded by s spaces, but text begins on the same line separated from the header with a hyphen. The t parameter is a test page preceding the header which defaults to five lines. If other than the default initialization of header number is desired, the header number format code, .s !.hn i,j,...n!Header Number .s may be used to initialize the header numbers. Omitted arguments are reset to zero. If the first argument (which specifies the zero level) is negative, the zero level is indicated in alphabetic form, i.e.., -1 for A, -2 for B, etc. The first .hn code that appears causes a switch to be set such that all subsequent page numbers are prefaced by the zero level header number. As an example, the source text .nf .s @.hn -2,3,2 @.hl3 Fonts Daisy Wheel printers may be equipped with a variety of daisy-~wheels giving the user a choice of font. .s .f will cause the output of header and subsequent text of the form .s B.3.2.1__Fonts_-_Daisy Wheel printers may be equipped with a variety of daisy-~wheels giving the user a choice of font. .s3 .tp9 .ts12,30 .c OUTPUT DEVICE SELECTION Most formatting features are effective on any output device, such as a CRT terminal, a hard-~copy terminal, or a line printer. However, the TEDI formatter supports a number of special features for daisy-~wheel printers which have additional capabilities. These include subscripts and superscripts, divided-~fraction equations, and automated double-~column output. In addition, the 192 characters available on a dual-~headed daisy-~wheel printer are supported. In order to specify to the formatter what output device characteristics are available, numeric codes are assigned to devices as these numbers specified in either a format code or a format command. The numeric codes are .lm20 .rm65 .p-6,1,3 "0" Line printer without backspace or overstrike capability, but with hardware form-~feed "1" CRT or hard-~copy terminal without overstrike capability and without form-~feed inter~pretation "2" Hard-~copy terminal with backspace and overstrike, and with or without form-~feed interpretation. "3" DTC-300S daisy-~wheel printer "-3" DTC-382 daisy-~wheel printer "4" Los Alamos modified DTC-300S "5" Diablo or Qume Daisy-~Wheel printers. .lm .rm .p TEDI formatter output may be sent to three distinct output streams by the FPG, FPF, and FPP format commands respectively. Format Pages "FPG" sends output to the controlling terminal, Format Pages to File "FPF" sends it to a disk file, and Format Pages to Printer "FPP" sends it to logical device TEDI$PRINT which must have been assigned to either a disk file or to a spooled device. The default device types are "1" for the terminal and "0" for either a disk file or spooled device. Non-~default device types may be specified in one of two ways: .s (1)__As the third numeric argument on a format pages command; for example "FPP1,10,5" will format pages 1 through 10 to the logical device TEDI$PRINT and include control information suitable for a Qume or Diablo printer. .s (2)__By embedding a format code in the source text. Available format codes are .s .ts12,32 .nf !.tty t!Terminal Type !.fty t!File Type !.pty t!Printer Type .f .s where t is an integer 0 through 5 specifying the device type. If both an embedded format code a format command specify a device type, the format command specification is used. A second argument after t is available for daisy-~wheel printers, the pitch p. For example, ".tty5,12" or "FPG*,,5,12" specifies a Qume or Diablo with twelve pitch spacing. Any reasonable pitch number may be used, even one different from that indicated by the wheel manufacturer, to obtain special effects. A final format code which affects only daisy-~wheel printers is the variable spacing switch, .s !.vs!Variable Spacing .s which causes spaces between words in fill and justify modes to be adjusted to exact equality in width by making fractional spaces between words. Output always looks better with this switch on. The only reason not to use it is if the printer is connected at 300 baud; in this case the extra control information sent to achieve the variable spacing may make output unacceptably slow. .s3 .tp9 .c UNDERLINING AND EXTENDED CHARACTER SET For devices which support backspace and overstrike (device types 2 through 6) the text to be underlined is enclosed by angle brackets in the source text. For example, the source text .s it is @ cold. .s will format to .s It is cold. .s If more than one word is enclosed, the spaces between the words will not be underlined. To obtain a multiple-~word phrase with the underlining continued across words, use the required blank "@_" between words. For example, .s @ .s formats to .s .s whereas .s @ .s formats to .s Most computer terminals and printers have 96 characters on line. These are typically the 96 ASCII characters including upper and lower case. Some daisy-~wheels modify the character set slightly, calling the wheel "word processing" or "legal" and replacing a few of the ASCII characters with characters used frequently in business correspondence or legal documents. Users of these wheels will have to remember the corresponding ASCII character and use them since TEDI makes no special provision for these wheels. Technical documentation requires a very much larger character set. The dual-~headed daisy-~wheel printer provides 192 characters and the TEDI formatter has special provisions for such a printer. The main head is assumed to contain a 96 character ASCII wheel, such as QUME's Prestige Elite ASCII, and the second head is assumed to contain QUME's Greek-~Math wheel. This provides a character set adequate for most technical documentation. To indicate the selection of a character from the second wheel, an ASCII character is preceded by an ampersand "@&". The corrrespondence between the ASCII character and the extended character is tabulated in Appendix I. For example, "@&a" produces "&a", "@&b" produces "&b", "@&@[" produces &[, "@&*" produces "&*", and so forth. This mapping is simply the mechanical correspondence of the print wheels since that correspondence has very limited mnemonic value. Since many users will not have access to a dual-~headed printer, and even those who do may wish to make rough-~drafts on other devices, three alternatives are provided to determine the action taken on output of a character from the extended set. These options are selected with the graphics format code, .s !.gr i!Graphics .s where i is an integer which may take one of the following values: .s .lm20 .p-6,1,3 i=0___leaves a blank space to be filled in later with an ordinary typewriter i=1___causes the ASCII character to be overstruck with a tilde "@~" as a proofreading expedient; this is the default mode i=2___causes the extended character set to be printed on a dual-~headed printer. On a single-~headed daisy-~wheel printer the ASCII character is printed in red if a two-~color ribbon is installed. This is a very effective output mode for proofreading when the dual-~headed printer is not available. .lm5 .p .s3 .tp9 .c SUPERSCRIPTS, SUBSCRIPTS, AND FRACTIONS When outputting to daisy-~wheel printers, device types 3 through 5, carriage motions are possible which allow printing raised superscripts, lowered subscripts, and stacked fractions. Special characters and format codes are used to specify these carriage motions. A carriage motion of three-~eighths space up before a superscript or after a subscript is indicated by the left bracket "@[" while motion down three-~eighths space after a superscript or before a subscript is indicated by the right bracket "@]". Thus .s E = mc@[2@] .s formats to .s E = mc[2] .s and .s H@]2@[O .s formats .s H]2[O More detailed control of the carriage is provided by the caret "@^" followed by an unsigned or negative single-~digit number. The number is the count of eight-spaces to move the carriage, up for positive and down for negative. The backslash "@\" causes the carriage to move backward one space, a coded backspace. Thus .s V@^6@\@&@\@^-6 .s formats to .s V^6\&\^-6 .s on the dual-~headed printer. The vertical bar following a character causes it to be underscored with a tilded "@~", such that .s S@| = E@|@&*B@| .s formats to .s S| = E|&*B| .s This notation is desired by some technical journals to represent vectors. To encode stacked fractions, the braces "@{" and "@}" are used in a quasi-~algebraic notation. Any unit enclosed in these braces is interpreted as a numerator or denominator for a stacked fraction. The numerator and denominator are written separated by the slash "/" with no intervening spaces. For example, .s @{a + b@}/@{c@} . .s formats to .s {a + b}/{c} . .s These numerators and denominators may be compound up to a nesting depth of five. This provides the capability to encode complicated fractions with a very compact and easily entered notation. For example, the encoded fraction .s 1 + @{1@}/@{1 + @{1@}/@{1 + x@}@} . .s will be output on a daisy-~wheel printer as .s 1 + {1}/{1 + {1}/{1 + x}} . .s3 Parentheses must be balanced as is true in any algebraic notation of this type. If these constructs get to be very complicated, appropriate spacing must be provided before and after them. Moreover, no-~fill mode is usually appropriate, unless all blanks are made required blanks, which is usually inconvenient. To make both of these features automatic, the equation and end equation format codes, .s !.eq!Equation .br !.eeq!End Equation .s are provided. These cause a break in the fill, go temporarily into no-~fill mode, and precompute the vertical spacing required by any lines of text included between them. As an example of a typical use of this feature, the source text .nf .s @.ts68 We now eliminate algebraic quantities in Eqs._(3)-(11) to obtain equations constituting the Vlasov-fluid model with finite electron pressure: @.eq @.i5 @{@&Jf@]i@[@}/@{@&Jt@} + v@| @&. @{@&Jf@]i@[@}/@{@&Jx@|@} + @{e@}/@{m@]i@[@} @~ (E@| + @{v@|@}/@{c@} @&* B@|) @&. @{@&Jf@]i@[@}/@{@&Jv@|@} = 0 , @!(12) @.i5 @&(@{@&J@}/@{@&Jx@|@} @&* B@|@&) @&* B@| = @~ 4@&pe @&@| @&(@{1@}/@{n@]e@[@} @{@&JP@]e@[@}/@{@&Jx@|@} + E@| @~ + @{v@|@}/@{c@} @&* B@|@&)f@]i@[d@[3@]v ,@!(13) @.s @.i5 @{@&J@}/@{@&Jx@|@} @&* E@| = - @{1@}/@{c@} @{@&JB@|@}/@{@&Jt@} ,@!(14) @.s @.i5 n = @&@| f@]i@[ d@[3@]v ,@!(15) @.s @.i5 P@]e@[ = P@]e@[(n)__.@!(16) @.eeq A linearized version of these equations is the subject of the remainder of this paper. .s will format to .f .s .ts68 We now eliminate algebraic quantities in Eqs._(3)-(11) to obtain equations constituting the Vlasov-fluid model with finite electron pressure: .eq .i5 {&Jf]i[}/{&Jt} + v| &. {&Jf]i[}/{&Jx|} + {e}/{m]i[} ~ (E| + {v|}/{c} &* B|) &. {&Jf]i[}/{&Jv|} = 0 , !(12) .i5 &({&J}/{&Jx|} &* B|&) &* B| = ~ 4&pe &| &({1}/{n]e[} {&JP]e[}/{&Jx|} + E| ~ + {v|}/{c} &* B|&)f]i[d[3]v ,!(13) .s .i5 {&J}/{&Jx|} &* E| = - {1}/{c} {&JB|}/{&Jt} ,!(14) .s .i5 n = &| f]i[ d[3]v ,!(15) .s .i5 P]e[ = P]e[(n)__.!(16) .eeq A linearized version of these equations is the subject of the remainder of this paper. .s3 .tp9 .ts12,34 .c HARDWARE MARGIN AND DOUBLE COLUMN FORMAT Frequently text will be input and initially formatted on an eighty-~column CRT terminal but will finally be output on a daisy-~wheel printer. The margin settings for the CRT may not be suitable for the final output device, but it would be very undesirable to have to go through and change all margin and tab settings. A way to achieve this with a single format code is provided by the hardware margin format code, .s !.hm m!Hardware Margin .s which sets the left margin stop on daisy-~wheel printers at column m. The internal margin settings and tab stops are then determined starting at this point. The hardware margin code is ignored for device types 0 through 2 and may therefore be left in the source text when doing rough drafts to devices that do not have a setable margin. It is strongly recommended that a standard position of the forms tractor on daisy-~wheel printers be maintained at all times and adjustments of positioning on the paper be achieved solely with the hardware margin format code. The default hardware margin of "12" is generally suitable if the forms tractor is set so that after the printer reset key is activated, the print wheel is at the left edge of the paper. Values of the hardware margin from 8 to 15 will generally accommodate most output formats. A second argument on the hardware margin format code will cause double-~column output on daisy-~wheel printers. For example, ".hm 10,50" will place the hardware margin alternately at 10 and at 50. If the form-~feed code is set to plus or minus 2, ".ff2" or ".ff-2", the paper will be backed up between passes. With the negative argument a pause between full pages will be made to insert new paper while with the positive argument a form-~feed eject will be made as is appropriate for continuous form paper. It is permissible to start a page in single column format and then shift to double column by changing the hardware margin settings appropriately. However, it is permissible to shift back to single column, except after an explicit page eject, since when in double-~column mode the formatter will allocate the remainder of each page in advance. Figures and footnotes in double-~column mode will be placed at the top or bottom of each column independently. A special figure code for wide figures, .s !.dfg n!Double Figure .s provides for full-~width figures or tables. The text of the figure caption or table follows this format code and the text is terminated with the ordinary ".efg" end figure format code. The formatter will allocate space at the top of the next full page for the double-~width figure or table. .s3 .c COMMENTS Any line beginning with ".@!" in the source text will be ignored by the formatter. Such a line may therefore contain comments or other annotations concerning the formatting process and they will not appear in the final output. .pg .c Appendix I .s .c Extended Character Set Mapping .c for Qume Twin-Track .s2 .nf .sp1,1 .ts 10 22 34 46 58 70 .s !!0 &0!@@ &@!P &P!@` &`!p &p !@! &!!1 &1!A &A!Q &Q!a &a!q &q !" &"!2 &2!B &B!R &R!b &b!r &r !@# &#!3 &3!C &C!S &S!c &c!s &s !$ &$!4 &4!D &D!T &T!d &d!t &t !% &%!5 &5!E &E!U &U!e &e!u &u !@& &&!6 &6!F &F!V &V!f &f!v &v !' &'!7 &7!G &G!W &W!g &g!w &w !( &(!8 &8!H &H!X &X!h &h!x &x !) &)!9 &9!I &I!Y &Y!i &i!y &y !* &*!: &:!J &J!Z &Z!j &j!z &z !+ &+!; &;!K &K!@[ &[!k &k!@{ &{ !, &,!@< & &>!N &N!@^ &^!n &n!@~ &~ !/ &/!/ &?!O &O!@_ &_!o &o .pg .c Appendix II .s .c Special Characters .s .nf .ts 10 28 -67 !Character!Function!Page .s !@! Exclamation!Tab!11 !@~ Tilde!Continuation or optional hyphenation!5 !@< Left Angle!Begin underline!21 !@> Right Angle!End underline!21 !@_ Underline!Required blank!6 !@@ At!Actual character follows!5 !@[ Left Bracket!Index up!22 !@] Right Bracket!Index down!22 !@{ Left Brace!Begin numerator or denominator!23 !@} Right Brace!End numerator or denominator!23 !@& Ampersand!Next from extended set!22 !@\ Backslash!Coded backspace!23 !@| Vertical Bar!Undermark previous character!23 !@^ Caret!Explicit vertical carriage motion!23 !@# Sharp!Reserved for future use !@? Question!Reserved for future use .pg .sp1 .nf .ts20 36 -60 .c Appendix III .s .c FORMAT CODE SUMMARY .s2 !Code!Name!Page .s !.b m,n,f!Blanks!9 !.br!Break!9 !.c k!Center!9 !.dfg n!Double Figure!26 !.eeq!End Equation!24 !.efg!End Figure!13 !.efn!End Footnote!13 !.el!End List!17 !.en!End Note!16 !.eq!Equation!24 !.f!Fill!4 !.ff i!Form Feed!11 !.fg n!Figure!13 !.fn!Footnote!13 !.fty k!File Type!20 !.gr k!Graphics!22 !.hl n,s,t!Header Level!18 !.hn i,j,...,m!Header Number!19 !.hm i,j!Hardware Margin!25 !.i n!Indent!10 !.j!Justify!8 !.le!List Element!17 !.lm!Left Margin!7 !.ls m,n!List!16 !.nf!No Fill!4 !.nj!No Justify!8 !.nt i,s,t!Note!16 !.nnm!No Numbers!14 !.nm!Numbers!14 !.p i,s,t!Paragraph!7 !.pg n!Page!10 !.ps k!Page Size!10 !.pty k!Printer Type!20 !.rm m!Right Margin!7 !.s m,n,f!Skip!9 !.sp n,m!Spacing!10 !.ti k!Title!15 !.tp n!Test Page!11 !.ts i1,...,i20!Tab Stops!11 !.tty k,p!Terminal Type!20 !.vs!Variable Spacing!21