https://www.nomodes.com/history/pub-manual 0 Skip to Content Larry Tesler Home CV Summary 1997 - 2020 1980 - 1997 1962 - 1980 More... Computing History Complexity Law PUB Manual Films and Podcasts A CHI Retrospective 1973 User Study Notes Personal Home (Personae) Birthday Math Primes ACO Search Open Menu Close Menu Larry Tesler Home CV Summary 1997 - 2020 1980 - 1997 1962 - 1980 More... Computing History Complexity Law PUB Manual Films and Podcasts A CHI Retrospective 1973 User Study Notes Personal Home (Personae) Birthday Math Primes ACO Search Open Menu Close Menu Home Folder: CV Back Summary 1997 - 2020 1980 - 1997 1962 - 1980 More... Folder: Computing History Back Complexity Law PUB Manual Films and Podcasts A CHI Retrospective 1973 User Study Notes Folder: Personal Back Home (Personae) Birthday Math Primes ACO Search PUB Manual Overview PUB was an early scriptable markup language. It was similar in concept to today's web scripting languages, especially PHP and JavaScript. But, like Microsoft Word, its purpose was to create paginated documents. PUB was the brainchild of Les Earnest (also see his own page) of the Stanford Artificial Intelligence Laboratory. Under his direction, I designed the language and implemented the compiler in 1971. It ran on the Digital Equipment Corporation (DEC) PDP-10. PUB's intended users were computer programmers working at the AI Lab. The brand new ARPANET made it easy to transmit the PUB application, source code, and documents to other research universities, several of which had PDP-10 systems. In the next few years, dozens of Ph.D. candidates around the U.S. chose PUB to format their dissertations. Russ Taylor of Stanford modified the open source to add support for the Information International Inc. FR-80 Microfilm Recorder. Rich Johnsson of Carnegie-Mellon University (CMU) did the same for the Xerox Graphics Printer (XGP), a predecessor to the laser printer. Examples of documents which used PUB: * Info and sample sheets for Xerox Graphics Printer (XGP); notes on how to use with PUB, July 1980. * The MDL Programming Language manual, Stu Galley and Greg Pfister. Laboratory for Computer Science, Hieronymous Massachusetts Institute of Technology, June 1979. The Bosch manual documents the Muddle interpreter version 55 Woodcut of (ITS) and version 105 (TENEX and TOPS-20). an English pub PUB offered considerable power. But its target audience was small. The software was ridden with quirks that only became apparent after running the compiler and examining the output. At least two PUB users reacted to these shortcomings by developing a better language. Brian Reid, then at CMU, developed Scribe for nontechnical users. He implemented the first version (Cafe) entirely in PUB (see "Chapter 9: An Evaluation of the System" on page 110 of Scribe: A Document Specification Language and Its Compiler). Don Knuth developed TeX for authors of mathematical texts. The solution I favored was what we would now call a WYSIWYG interactive text editing and page layout system. I felt that, if the effect of any change was immediately apparent, users would feel more in control. I soon left Stanford to pursue my dream at Xerox PARC (1973-80) and Apple Computer (1980-1997). In 1980, Les Earnest founded Imagen, a pioneering desktop publishing company. He sold it to QMS in 1987. PUB is all but forgotten. It is not even mentioned in most histories of Scribe and TeX. But its reinventions, JavaScript and PHP, have become indispensible in the world of web authoring. As such, history has confirmed what Les postulated at least as early as 1971: built-in markup tags will never be able to handle the variety of formatting effects that authors and publishers require. To achieve effects that a markup language designer could not have anticipated, a powerful scripting language should be provided. SAIL was an acronym with two meanings: Stanford Artificial Intelligence Laboratory and Stanford Artificial Intelligence Language. The SAIL language (see original manual and CS-TR-73-373 report) was a dialect of Algol-60. I worked at SAIL, the lab, as a consultant in 1967, and as an employee of Kenneth Colby, M.D., from 1968 to mid-1970. Around 1968, Jim Warren and I were laying out the Midpeninsula Free University catalog using traditional cut-and-paste methods, i.e., with scissors and glue. I had been involved in computer animation since 1962 when I worked on the Stanford Card Stunt Program. I had used graphic displays since at least 1963 when the LINC came to Stanford. I had recently seen a demo of Doug Engelbart's hypertext system, NLS. It was obvious to me that cut-and-paste would eventually be done using a computer display and something like a mouse. I mentioned this STANFORD ARTIFICIAL INTELLIGENCE PROJECT AUGUST 1972 thought to Jim, OPERATING NOTE 70 who knew nothing about computers at the time. He asked to visit PUB SAIL, where I showed him the The Document Compiler facility and such toys as Steve Russell's SpaceWar!, the by first video game. That Larry Tesler visit led to Jim's entry into the computer industry. For me, it reinforced a desire to make ABSTRACT: interactive page layout a PUB is an advanced text justifier and page formatter intended reality. primarily for use by programmers. It can automatically number pages, sections, figures, footnotes, etc. and can print their numbers in In 1970, I roman numerals as well as in digit or letter form. It can generate became cross references, tables of contents, and indexes. Page layout is disillusioned flexible, and allows multiple column output. Line formatting with the slow includes tabs, underlining, superscripts, subscripts, centering, and pace of justification. Macros programmed in a SAIL-like string-processing artificial language can generate text to be printed in the document. The output intelligence of the compiler is a file which can be printed on the terminal, on research. I the line printer, or on microfilm. took almost a year off from the industry. When I returned in the spring of 1971, I ACKNOWLEDGMENTS: asked if I could work on Les Earnest created the concept of the Document Compiler and something specified most of its capabilities. unrelated to AI. Prof. John Dan Swinehart provided invaluable advice and aid throughout the McCarthy, development of PUB. inventor of LISP and Russ Taylor programmed the FR-80 preprocessor. academic leader of the lab, sent me to Les Earnest, the lab's administrative head. Les suggested a few possible projects. The one that interested me the most was his idea for a document compiler for technical manuals. I told Les that I'd rather implement an interactive layout system for a broader audience. He persuaded me that the document compiler should come first. I felt I'd learn useful things, and I needed the job, so I agreed. Les specified the general approach and most of the features. As I designed and implemented PUB, I naturally put my own spin on it. Once people began using it, features were driven mainly by user feedback. I released the first version of PUB around September, 1971. The implementation language was SAIL, and the syntax of the scripting language was as SAIL-compatible as I could manage. Les deserves credit for the strengths of PUB, and I the blame for its quirks. About this manual To navigate the manual, scroll down, or use the links in the table of contents and index. Many, but not all, pages have commentary alongside. The original PUB manual contained no links. PUB did not support hypertext. Its purpose was to generate printed documents. The manual was first produced in late 1971. The manual reproduced here is a 1972 revision that included documentation of a few added features, including output to the FR-80. The character set of the SAIL keyboard and display was not fully supported by the lab's high-speed impact printer. In the hard copy manual, I had to hand print some non-ASCII characters. For this HTML reproduction, SAILON-70 PUB Page i I have translated those TABLE OF CONTENTS characters to ----- -- -------- Unicode. I have also SECTION PAGE corrected a number of typos in the text and 1 INTRODUCTION examples. 1.1 PURPOSE . . . . . . . . . . . 1 The cover 1.2 CAPABILITIES . . . . . . . . . . 1 image is a 1.3 OPERATION . . . . . . . . . . . 2 Hieronymous 1.4 COMPILER OUTPUT . . . . . . . . . 4 Bosch woodcut 1.5 READING THIS MANUAL . . . . . . . . 5 of an English 1.6 TUTORIAL FOR BEGINNERS . . . . . . . 5 pub. I found 1.7 SAMPLE COMPILATION . . . . . . . . 9 the image in 1971 in an off-copyright 2 TEXT CONVENTIONS book in the Stanford 2.1 ILLEGAL CHARACTERS . . . . . . . 13 Library. It 2.2 COMMAND AND TEXT LINES . . . . . . 13 became the 2.3 PARAGRAPHING . . . . . . . . . 14 cover of the 2.4 FILL MODE . . . . . . . . . . 14 hard copy 2.5 JUSTIFICATION . . . . . . . . . 14 version of 2.6 BREAKING AT BLANK LINES . . . . . . 15 the manual. 2.7 BREAKING AT TABS . . . . . . . . 15 We had no way 2.8 BREAKING AT CARRIAGE-RETURNS . . . . 15 to 2.9 NOFILL MODE . . . . . . . . . . 15 incorporate 2.10 HORIZONTAL SPACE COMPACTION . . . . 16 the image 2.11 VERTICAL GROUPING . . . . . . . . 17 into the 2.12 MODE AND SWITCH SETTING COMMANDS . . . 17 digital 2.13 WORD BREAKS . . . . . . . . . . 18 version. 2.14 CONTROL FUNCTIONS . . . . . . . . 18 2.15 CONTROL CHARACTER ACTIVATION . . . . 21 The digital 2.16 COMPUTED TEXT . . . . . . . . . 23 version of the manual survived 3 MACROS thanks to Bruce 3.1 CALLING A MACRO FROM A COMMAND LINE . . 25 Baumgart, who 3.2 CALLING A MACRO FROM A TEXT LINE . . . 25 laboriously 3.3 TEMPLATES . . . . . . . . . . 26 transferred 3.4 MACRO DECLARATION . . . . . . . . 27 all SAIL 3.5 MACRO CALLS . . . . . . . . . . 27 backup tapes 3.6 OMISSIONS . . . . . . . . . . 28 from the 3.7 RECURSIVE MACROS . . . . . . . . 29 period 1972 to 1990 into a web-based archive. At the time of this writing, February 2005, Bruce is an employee of The Internet Archive, and plans to add the SAIL archive to their holdings. The manual was, naturally, produced in PUB. We have not yet located the source code, but expect to find it soon. It took considerable JavaScript and CSS machinations to emulate the behavior of SAIL's line printer in HTML. The manual is best viewed in Microsoft Internet Explorer for Windows, FireFox, or Safari. In older browsers, you may see mispositioned characters as well as numerous backquotes where there ought to be spaces. Even in the recommended browsers, many non-ASCII characters will appear too wide. Antecedents and contemporaries PUB was by no means the first computer-based markup language. In 1963, Jerry Saltzer developed RUNOFF, the first known computer-based system in which an author could insert markup codes into a digital manuscript and run the file through a markup processor to generate a formatted document. Around the same time, inspired by a demo of RUNOFF or a similar program, John Seybold founded a typesetting service bureau, ROCAPPI (1963-70). ROCAPPI is said to have developed powerful editing and layout systems and even a form of generic markup. RUNOFF spawned Joe Ossanna's troff/nroff (1973), later enhanced by Brian Kernighan, co-developer of Unix and C, and still popular on Unix systems. IBM's SCRIPT, released circa 1967, had a similar syntax to RUNOFF. By 1974, SCRIPT had spawned the PUB-like NSCRIPT and Waterloo Script, as well as the generalized markup language, GML. Before GML, most markup Page ii TABLE OF CONTENTS SAILON-70 was specific, e.g., indent the next line 4 EXPRESSIONS 3 spaces. In GML, which was 4.1 DATA TYPE . . . . . . . . . . 30 conceived in 4.2 VARIABLES . . . . . . . . . . 30 1969 and 4.3 AUTOMATICALLY DECLARED VARIABLES . . . 31 realized in 4.4 SIMPLE EXPRESSIONS . . . . . . . 32 1971, all 4.5 GENERAL EXPRESSIONS . . . . . . . 33 markup was 4.6 CONSTANTS . . . . . . . . . . 34 general, e.g., make the next line a heading 5 STATEMENTS . A document thus prepared 5.1 STATEMENT TYPES . . . . . . . . 35 could be 5.2 BLOCK . . . . . . . . . . 35 formatted for 5.3 COMPOUND STATEMENT or CLUMP . . . . 35 different page 5.4 ONE PARAGRAPH SCOPE . . . . . . . 36 sizes, different output 6 DECLARATIONS devices, etc., without 6.1 SCOPE . . . . . . . . . . 37 altering the 6.2 MODE DECLARATIONS . . . . . . . . 37 markup. 6.3 TABS DECLARATION . . . . . . . . 37 6.4 INDENT DECLARATION . . . . . . . 38 GML was 6.5 PREFACE DECLARATION . . . . . . . 39 concerned with 6.6 DOUBLE SPACING . . . . . . . . . 39 the syntax of 6.7 AREA DECLARATION . . . . . . . . 39 a document 6.8 MARGIN CONTROL . . . . . . . . . 40 type, which it 6.9 PLACE DECLARATION . . . . . . . . 42 expressed in a 6.10 TEMPORARY AREAS . . . . . . . . 42 standardized 6.11 COUNTER DECLARATION . . . . . . . 43 form, the document type definition or 7 IMPERATIVES DTD. The syntactic 7.1 ASSIGNMENT STATEMENT . . . . . . . 45 rules 7.2 CONDITIONAL STATEMENT . . . . . . 45 governing a 7.3 NEXT COUNTER VALUE STATEMENT . . . . 45 new structural 7.4 NEXT PAGE STATEMENT . . . . . . . 47 element could 7.5 HEADINGS AND FOOTINGS . . . . . . 48 be defined in 7.6 SECTIONING . . . . . . . . . . 48 a DTD. Its 7.7 COMMAND CHARACTER STATEMENT . . . . 49 implementation 7.8 PORTION DEMARCATION . . . . . . . 49 required 7.9 SEND STATEMENT . . . . . . . . . 50 recoding of 7.10 RECEIVE STATEMENT . . . . . . . . 52 the markup 7.11 REQUIRE STATEMENT . . . . . . . . 53 processing 7.12 SKIP STATEMENTS . . . . . . . . 53 application. 7.13 PAGE FRAME STATEMENT . . . . . . . 55 PUB, SCRIPT, and other scripted markup languages provided a form of generic markup using macros. In PUB, new elements and new behavior could, in many cases, be defined within the PUB language itself. As stated earlier, Brian Reid's SCRIBE-a complete markup language-was originally implemented in PUB. Similarly, IBM's first version of GML was implemented in SCRIPT. In 1978, Charles Goldfarb, the principal developer of GML, joined with other advocates of generalized markup to begin work on SGML. SGML has become a widely used language for describing industrial documents. In 1990, Tim Berners-Lee chose SGML as the basis for his World Wide Web hypertext language, the original HTML. The success of HTML spawned XML, now (February 2005) the favored format for structured data exchange. Was any feature of PUB without precedent? I do not know enough about the features of similar systems in 1971 to be sure. I am hoping that readers of this manual can help me answer this question. SAILON-70 TABLE OF CONTENTS Page iii 7.14 BREAK STATEMENT . . . . . . . . 55 7.15 CONTINUE STATEMENT . . . . . . . 55 7.16 DEVICE STATEMENT . . . . . . . . 55 7.17 UNIMPLEMENTED STATEMENTS . . . . . 56 8 COMMENTS 9 LABELS AND CROSS-REFERENCES 9.1 CROSS-REFERENCES . . . . . . . . 59 9.2 LABELS . . . . . . . . . . 60 10 RESPONSES 10.1 TEXT RESPONSES . . . . . . . . . 63 10.2 TRANSITION RESPONSES . . . . . . . 64 11 FOOTNOTES APPENDICES ---------- A THOROUGHLY EXPLAINED EXAMPLES A.1 SECTIONING MACROS . . . . . . . . 68 A.2 SAMPLE TABLE OF CONTENTS . . . . . 69 A.3 ONE-LEVEL INDEXES . . . . . . . . 70 A.4 TWO-LEVEL INDEXES . . . . . . . . 72 A.5 KWIC INDEXES . . . . . . . . . 74 SUBJECT AND COMMAND INDEX . . . . . . . . . . I Terminology The name PUB was short for PUBlication language. SAILON-70 PUB Page 1 The PDP-10 operating system was TENEX, later SECTION 1 called TOPS-10. INTRODUCTION SOS (Son of Stopgap) was a line-oriented text editor. For more information about 1.1 PURPOSE PUB, SAIL, SOS, _______ and related topics, see Les PUB is a compiler which translates a manuscript into a Earnest's __________ extensive but document. concise memoire, ________ SAIL Away. A "manuscript" is an SOS file containing the text of a TECO was a publication interspersed with control characters and character-oriented commands. The function of the compiler is to arrange text editor, ________ originally this text on formatted pages under the direction of developed in the control characters and commands. 1962-63 for the DEC PDP-1. Dan Output is written on a ".DOC" file known as the Murphy developed "document". TYPE, SPOOL or PRINT it. Under certain TECO and was one conditions, the document can be edited with TECO (see of the developers Section 7.16), but it is wiser to make corrections in of TENEX. the manuscript and then rerun the compiler. The TENEX TYPE MANUSCRIPT -------- DOCUMENT command displayed COMPILER a file on the terminal, which, at SAIL, was a display that every 1.2 CAPABILITIES programmer had on ____________ his desk-a rare indulgence at the PUB provides the usual capabilities of a simple text- time. The PRINT justifier, including: and SPOOL commands sent a document to >Page numbering the line printer. >Optional justification to the right margin >Centering of titles "The usual >Headings and footings capabilities of a >Control of Spacing and Indentation simple >Underlining text-justifier" refers to In addition, it features advanced documentation preexisting markup capabilities, such as: processors like RUNOFF. PHP remark 1.1 - 1.2 The advice that "it is wiser to make corrections in the manuscript and then rerun the compiler" would apply today to the HTML output from PHP. Terminology Core meant magnetic core memory, the prevalent technology before the invention of semiconductor memory. Even Page 2 INTRODUCTION SAILON-70 today, Unix systems are said to "dump >Columnar output core" to disk >Footnote placement when unable >Macros to recover >Index Generation from an >Table of contents generation error. >Cross-reference to a variable target >Automatic numbering of equations, tables, notes, etc 40K meant >Superscripts and Subscripts 40x1024 >Microfilm Output words. A PDP-10 36-bit The command language is a dialect of SAIL Algol, word could providing the user with: hold five 7-bit ASCII >Block structure characters or >Conditional command execution four 9-bit >Conditional text inclusion SAIL >Arithmetic and String calculations characters. >Embedded Source Files In units of eight-bit bytes, PUB needed 330K 1.3 OPERATION of available _________ memory. The compiler is "two-pass". The first pass interprets Why two the manuscript and outputs several intermediate files passes were with extensions ".PUG", ".PUZ", and ".PUI". The necessary second pass is a separate program automatically called which makes one pass through the ".PUI" files and There were produces the document. The ".PUG" and ".PUZ" files several are automatically deleted at the end of Pass One. The reasons that ".PUI" files are read by Pass Two, then deleted PUB required (unless deletion is waived by a switch setting -- see two passes. below). Pass 1 generated The first pass typically requires 40K of core and runs front matter at the rate of 15 pages per minute. The second pass such as the needs 18K and runs at 50 pages per minute. If the Table of system should crash during Pass Two, and you wish to Contents that restart without rerunning Pass One, R PUB2. "R PUB2" Pass 2 had to also gives you an opportunity to specify a different output before output device than originally requested. other pages. Pass 1 You may run the document compiler with or without RPG. determined A manuscript file which is ".PUB" or a document file the targets extension which is ".DOC" need not be mentioned. of cross Examples: references so that Pass 2 could fill 1.3 them in. Pass 1 automatically ran Pass 2, but the user could run Pass 2 separately to generate output for another device. Terminology REQUIRE was like include in C and other modern languages. RPG was like Unix's SAILON-70 INTRODUCTION Page 3 make. Tables in command typed input file output file switches PUB vs. _______ _____ _____ ____ ______ ____ ________ HTML .COM FOO FOO.PUB FOO.DOC ___ ___ PUB had no .COM FOO-BAZ`````````````````BAZ.PUB````````FOO.DOC element ___ _______ equivalent .COM /PUB FOO.OOF-BAZ.ZAB````BAZ.ZAB````````FOO.OOF to HTML's ___ ____ _______________ table. .COM /PUB FOO.OOF FOO.OOF FOO.DOC Instead, it ___ ____ _______ provided .COM FOO(DN) FOO.PUB FOO.DOC /D /N two poorly ___ _______ documented .R PUB methods of _ ___ generating *FOO/D/N FOO.PUB FOO.DOC /D /N a table. _______ To generate Do not specify more than one input file nor more than a table row one output file. Multiple input files are handled by row, the using the REQUIRE statement (see Section 7.11). PUB author set tabs WARNING (RPG users): If in addition to file X.PUB you stops and have a file X.SAI (or X.FAI, etc.) and if you type inserted "COM X", RPG will do a SAIL (or FAIL) compilation. tab SOLUTION: Type "COM X.PUB". characters between the FURTHER WARNING (RPG users): If you have a file X.REL cells in which is newer than X.PUB, then RPG won't do any each row. compilation. SOLUTION: Type "COM /COM X.PUB". That is probably Presently available switches are: how I made the table nS Change intra-paragraph line spread: 1S=Single on the Space, 2S=Double Space, etc adjacent B Big Document -- allocates hashed space for 3000 page. identifiers instead of 1000 H Huge Document -- allocates maximum symbol table To generate space (8191) a table D DEBUG -- prints approximate source file line column by numbers alongside the output column, the L Line Printer output planned (Default) author M Microfilm output planned (produces FR80 command created a file -- see Section 7.16) temporary T Terminal output planned (may produce different area output than /L) (Section Y Yes! Automatically delete ".PUI" files after Pass 6.10) and 2 (Default) inserted N No! Don't delete them (thus allowing Pass 2 to be next column re-run with a different DEVICE) commands A Ask me whether to delete them when it's time. between Z Compiler Debug: see compiler (PUB.SAI[2,TES]) columns. Using macros, it was 1.3 possible to invent a personal notation similar to HTML's table. Whether anyone ever bothered, I do not know. Terminology TVEDIT (1963 or 1965) was a display-oriented text editor originally developed by Page 4 INTRODUCTION SAILON-70 Brian Tolliver for the Stanford PDP-1. Pentti 1.4 COMPILER OUTPUT Kanerva ported ________ ______ it to the PDP-10 around 1969 and During Pass one, whenever PUB reads a "Page Mark" or made a number of Form Feed, it types out the manuscript page number. improvements. It During Pass Two, whenever PUB writes a Form Feed, it was a little types out a count of the number of output pages so less powerful, far. but more user-friendly, During Pass One, PUB also types out error messages. than EMACS ```````````````After each``message, an arrow``(-) or a``question mark (1974). (?) is typed out. You may then respond as in SAIL. If you are not familiar with SAIL, here is a summary Digression of responses: Pentti's Continue compiling after this error. version of Continue compiling, and after subsequent errors, TVEDIT had continue automatically. an oops NOTE: The above two responses are not valid after "?" command that E Edit file . restored E (RPG only) Edit the manuscript file. deleted text S Start Over. to the location of In DEBUG mode (the /D switch), some error messages are the cursor. also output in the right margin of the document. To move text, the Whenever PUB prints a line number in an error message user issued or in the right margin of the document, it is of the a delete form: command, /[/] repositioned the cursor, If the line is from the manuscript, then is and issued empty. If it is from another file (such as one of an oops those ".PUG" files mentioned above), then is command. the first three letters of the first name of that file. That trick gave me the If the file is in SOS format, then the is idea of always five digits, including leading zeroes if using cut necessary. If it is from a TECO or TVEDIT file, then and paste, PUB generates line numbers 1, 2, 3, etc. without not only to leading zeroes. If it is from a ".PUG" file, then the position is the line number/ page number of a blocks of relevant line in your manuscript or in some other lines from a source file. galley proof onto a page, If a macro was being expanded, the line number and but also to move text around 1.4 within a manuscript. I got to implement cut and paste in Gypsy at PARC in 1974. SAILON-70 INTRODUCTION Page 5 page number of its definition are noted within square brackets. The file that contained the definition is not noted, so if can't find it in your manuscript, it probably came from PUBSTD.DFS, the PUB standard macro file, or from one of your REQUIRE files (see Section 7.11). Examples: 02300/10 Manuscript file, page 10, line 2300 (SOS) IND02300/10/1 INDEX.PUG file, page 1, comes from Manuscript 2300/10 PUB25/1 PUB Standard Macro File, Page 1, Line 25 (TVEDIT) 1.5 READING THIS MANUAL _______ ____ ______ This manual is ordered such that as soon as you have learned enough of the system to solve your particular problem, you can skip the rest of the manual. Read at least through Section 2.3 before making any such assumption. In describing the syntax of PUB commands, the following meta-linguistic symbolism is employed: <...> These brackets delimit the name of a syntactic entity [...] These delimit optional components of the command ...|... This character separates alternatives for the same command component Cross-references in this document are always to subsections. Subsection numbers are printed at the bottom of each page. 1.6 TUTORIAL FOR BEGINNERS ________ ___ _________ PUB is a string processing language. Characters can be formed into words, words into lines, lines into paragraphs, paragraphs into columns, columns into "areas" (such as the title areas at the top and bottom of the page), areas into pages, pages into sections, 1.5 - 1.6 The Document Object Model (DOM) PUB did not have a document object model as powerful as that of DHTML. But it did have a hierarchy of elements, at the top of which were portions. Portions were major document divisions like the Table of Contents, the main body of text, and the Index. Like JavaScipt, PUB offered the ability to append text, with or without markup, to elements. PUB offered both a simple and a fancy method of appending to elements. In the simple method, text without markup (i.e., after markup had been applied) was appended to the current line, lines were appended to the current paragraph, etc., up the hierarchy to the current portion. Today, pure HTML without scripts operates the same way. In the fancy method, one portion, usually the main body of text, sent text with Page 6 INTRODUCTION SAILON-70 unapplied markup to another sections into "portions" (such as the Table of portion. For Contents or the Appendices), and portions into a example, the document. The methods of bulding larger units from main body smaller ones are flexible and under control of the could send an programmer. entry to the Table of The most trivial use of PUB is to create a document Contents, that is exactly identical to the manuscript, adding Bibliography, only headings and footings. PUB assumes that the or Index. In format of each output page is as follows. The first pass 2, the three lines are a Heading area of which only the first receiving is usually used. The next 48 lines (lines 4 to 51) portion are the Text area. Line 52 is blank and line 53 is a processed the Footing area. The Footing area is for page numbers markup as if and other reference information, not for footnotes. it had been (Footnotes are placed inside the Text area, towards part of its its bottom). original source code. The width of each page is assumed to be 69 characters. In JavaScript It is assumed that there is only one column of text today, a output. Therefore, the longest an output line can be similar is 69 characters. process applies when The number of lines in each area, the number of a script uses columns of text, and the number of characters in each the writeln column may be changed by declaration. See Section function to 6.7 and Section 7.13 for details. If all you want add markup to to do is widen the page, e.g., to 75 characters, then a related make the following line the first of the manuscript: document in a .PAGE FRAME 53 HIGH 75 WIDE frame. The "Dot" in column one indicates that this line is a The PUB Command Line for PUB to obey and should not be printed compiler had in the document. If you would rather a different no predefined character in column one served for this purpose, see notion of a Section 2.2. table of contents, PUB assumes that you want no headings and footings. bibliography, It will leave the heading and footing areas blank or index. The unless you specify otherwise. The simplest way to author could specify headings and footings is with the standard define as macros "EVERY HEADING" and "EVERY FOOTING". These many portions macros can specify a title for the left edge, center, as desired, and right edge of the heading area and the footing with their area. For example, the macro call: format and .EVERY HEADING(PRELIMINARY REPORT,PARACYBERNETIC PHENOMENA,1972) structure determined by the script and the 1.6 markup. Page layout in PUB vs. RUNOFF Instead of PUB's page frame, RUNOFF had distinct line length and paper length commands. In RUNOFF, the header command took one argument. Alignment was determined by a separate heading mode command. The page command and its partner, paging mode, controlled the printing of page numbers. PUB combined and generalized these facilities. The dot convention The dot convention originated in RUNOFF. Successors such as SCRIPT, GML, and troff followed suit. Commands had to start on a new line. PUB supported both command lines that began with a dot and intra-line switching between command mode and text mode. TeX (1978) and SGML (1986) dropped the dot convention completely, and allowed markup to appear anywhere. SAILON-70 INTRODUCTION Page 7 More about page layout in PUB vs. will print on the top line of every page the three RUNOFF titles shown. RUNOFF To make the top line of every page display the title supported "PRELIMINARY REPORT" on the left and the current date header text on the right, use: but not .EVERY HEADING(PRELIMINARY REPORT, ,{DATE}) footer text. PUB The consecutive commas indicate that the center is symmetrically empty. The curly brackets around the word DATE supported specify that DATE is not a title to be printed but both. rather a variable to be evaluated. The RUNOFF To make the number of each page appear bottom center, equivalent to use: next page was .EVERY FOOTING(,{PAGE},) begin page. I adopted next To learn about fancier headings and footings, you will x as a have to read most of this document, especially Section uniform way 7.5 and Section 10.2. to start a new element PUB will number your pages 1, 2, 3, etc. unless you at any level declare otherwise. To learn how, see Section 6.11. of the A new page of output will be started for one of two hierarchy. reasons: the previous page is full, or a page-changing command is executed. The most common page-changing Unlike command is: RUNOFF, PUB .NEXT PAGE supported multiple This always starts a new page, even if one was just columns per started and nothing is on it yet. To start a new page page. But the only if there is something on the current page, use: word column .SKIP TO COLUMN 1 in the skip to column To leave a few blank lines in the document, use: command .GROUP SKIP 10 referred to character The SKIP command is described in Section 7.12. position, i.e., PUB processes text a paragraph at a time. The usual distance from way to indicate the end of a paragraph in your the left manuscript is by a blank line (that is, just a CR and margin. LF). Oher ways are discussed elsewhere in this manual, beginning at Section 2.3. One application Usually, PUB packs a paragraph as tightly as possible of the group by filling up each output line with words before skip command was to leave space for a 1.6 hand-pasted illustration. Page 8 INTRODUCTION SAILON-70 beginning a new line. This is called "filling". Then PUB inserts extra spaces between words to eliminate a ragged right edge from the paragraph. This is called "justifying". PUB will not indent the first line of paragraphs unless an indent command appears in the manuscript, e.g.: Paragraph .INDENT 6 styles in PUB vs. RUNOFF To learn more about indentation and related matters, and vs. CSS see Section 6.4 through Section 6.7. Indent was PUB assumes you would like your text lines filled out lifted and justified. You can selectively exempt blocks of directly from your manuscript from this fate. Each such block must RUNOFF. The be delimited by ".BEGIN" and ".END". After "BEGIN", CSS specify a formatting mode to persist for the duration equivalent is of the block. Examples: the text-indent Fill, but don't Justify Don't even fill Copy verbatim attribute. _____ ___ _____ _______ _____ ____ ____ ____ ________ .BEGIN NOJUST .BEGIN NOFILL .BEGIN VERBATIM Adjust, ... ... ... nojust, fill .END .END .END and nofill were also In "NOJUST" mode, lines will be filled but not lifted from justified. In "NOFILL" and "VERBATIM" modes, they RUNOFF. The will not even be filled. The difference between corresponding NOFILL and VERBATIM is that VERBATIM is both faster attribute in and dumber. It is faster because it copies the lines CSS is of the manuscript to the document without looking at text-align. them, except to see if there is a dot in column one. It is dumber because it does not recognize text Verbatim's control characters that PUB normally recognizes, and effect was it does not reformat in any way. Thus, VERBATIM is less like used to copy blocks of manuscript that are arlready HTML's pre formatted perfectly. than its deprecated Filling allows the manuscript to be quite ragged, a xmp. great convenience in editing. Short lines are lengthened and long lines are shortened. Be careful in NOFILL or VERBATIM mode that no manuscript line is longer than 69 characters (or whatever limit you have declared), or some of it will be lost and an error message given. 1.6 SAILON-70 INTRODUCTION Page 9 1.7 SAMPLE COMPILATION ______ ___________ You now know enough to use PUB for simple purposes. The next three pages show a sample manuscript and the document that PUB produced from it. 1.7 Page 10 INTRODUCTION SAILON-70 .EVERY HEADING(DAN MATION,PARACYBERNETIC PHENOMENA,{DATE}) .EVERY FOOTING(,{PAGE},) .INDENT 6 .BEGIN VERBATIM .GROUP SKIP 20 PARACYBERNETIC PHENOMENA BY DAN MATION .END .NEXT PAGE It has been observed that the Sigma 3 in Horsetown, Mass. and the CDC 6600 in Liverless, Cal. tend to have parity errors at the same time. When records were compared by Miss Minnie Messer, Director of the Horsetown Chamber of Commerce Computation Facility, and Mr. Solomon Crunch of Liverless Hospital's Organ-Transplant Inventory Project, it was shown that the correlation of parity error occurrences was 0.8, with a probability of random coincidence of <.00000001. Miss Messer and Mr. Crunch revealed these discoveries at the Universal Users Union meeting in Cranchville, Tenn. after they arrived two hours late for Mr. Crunch's scheduled talk there. They said that in the excitement of discovery the meeting slipped their minds. This report has motivated this author to undertake a wider survey to determine if similar phenomena have occurred elsewhere. The author has solicited Miss Messer's assistance in this survey, but without the cooperation of the entire computing community, it is unlikely that sufficient data can be collected. Therefore, we request that interested parties tabulate the exact times of occurrence of parity errors on their computer during the 7 day period 1200 April 18 to 1200 April 25 and send it to: .BEGIN NOFILL Paracybernetic Society c/o Dan Mation Boise Institute of Technology Boise, Idaho .END Results of the study will be presented at the next UUU meeting in December. DAN MATION PARACYBERNETIC PHENOMENA January 15,1972 PARACYBERNETIC PHENOMENA BY DAN MATION 1 DAN MATION PARACYBERNETIC PHENOMENA January 15,1972 It has been observed that the Sigma 3 in Horsetown, Mass. and the CDC 6600 in Liverless, Cal. tend to have parity errors at the same time. When records were compared by Miss Minnie Messer, Director of the Horsetown Chamber of Commerce Computation Facility, and Mr. Solomon Crunch of Liverless Hospital's Organ-Transplant Inventory Project, it was shown that the correlation of parity error occurrences was 0.8, with a probability of random coincidence of <.00000001. Miss Messer and Mr. Crunch revealed these discoveries at the Universal Users Union meeting in Cranchville, Tenn. after they arrived two hours late for Mr. Crunch's scheduled talk there. They said that in the excitement of discovery the meeting slipped their minds. This report has motivated this author to undertake a wider survey to determine if similar phenomena have occurred elsewhere. The author has solicited Miss Messer's assistance in this survey, but without the cooperation of the entire computing community, it is unlikely that sufficient data can be collected. Therefore, we request that interested parties tabulate the exact times of occurrence of parity errors on their computer during the 7 day period 1200 April 18 to 1200 April 25 and send it to: Paracybernetic Society c/o Dan Mation Boise Institute of Technology Boise, Idaho Results of the study will be presented at the next UUU meeting in December. 2 SAILON-70 PUB Page 13 SECTION 2 TEXT CONVENTIONS 2.1 ILLEGAL CHARACTERS _______ __________ If the following characters occur in the manuscript, they may cause problems: '177 Rubout '175 Altmode '13 Vertical Tab These characters are ignored in the manuscript: Special '0 Null characters '14 Form Feed (except after LF, where it is a page mark) The single quote A manuscript prepared using SOS or TVEDIT is character legitimate if it has no vertical tabs. If it is in SAIL prepared using TECO, be sure as well that every line and in PUB ends with CR LF. introduced an octal Tabs are expanded to the appropriate number of spaces, number. as in the line editor. 2.2 COMMAND AND TEXT LINES _______ ___ ____ _____ Every line with a dot (".") in column 1 is processed as a command line. Every other line is processed as a _______ ____ text line. ____ ____ If you would prefer a different character to introduce command lines, e.g., $, use the command: COMMAND CHARACTER "$" ; 2.1 - 2.2 Terminology Terms I coined like crown, vest, and hem never caught on. Page 14 TEXT CONVENTIONS SAILON-70 Paragraph breaks 2.3 PARAGRAPHING ____________ RUNOFF and PUB: The text is processed in logical units called "paragraphs". A paragraph is the accumulation of .break words from one or more text lines, terminated by the occurrence of a paragraph break. HTML: _________ _____ A paragraph break can be caused by the command BREAK
_________ _____ as well as by several other commands. In addition, a FILL mode paragraph break can be caused by signals in the text. RUNOFF and Paragraphing conventions can be varied by the use of PUB: various mode and switch settings. .FILL Lines of text up to a 2.4 FILL MODE negating ____ ____ command such as: In FILL mode, the compiler puts as many words as can .NOFILL fit on each output line before beginning a new line -- each line is "filled" with words. DHTML: For convenience of exposition, names have been given
_____ Lines of text the lines are called the vest. It is common to indent
____ the crown and not the vest, or vice versa, or to Justification indent them different amounts. The last line of the vest is called the hem. While the other lines of the RUNOFF: ___ paragraph can be subject to justification, the hem .ADJUST line is never justified. Lines of text up to a negating command such 2.5 JUSTIFICATION as: _____________ .NOFILL In FILL mode, whether or not output lines are PUB: justified to the right margin is determined by the setting of the "ADJUST-NOJUST" switch; but the hem .ADJUST line is never justified in any case. Lines of text up to a negating command such as: .NOJUST 2.3 - 2.5 DHTML:
Lines of text
SAILON-70 TEXT CONVENTIONS Page 15 2.6 BREAKING AT BLANK LINES ________ __ _____ _____ In FILL mode, a BREAK is caused by every blank line (just CR-LF). Redundant blank lines have no effect. To disable this response, see Section 10.1. 2.7 BREAKING AT TABS White space in ________ __ ____ PUB vs. HTML Tabs are converted to an appropriate number of spaces White space by PUB. If you would like a single tab at the interpretation beginning of a text line to cause a paragraph break, differed put this command at the beginning of your manuscript: significantly .TABBREAK from HTML. This makes text lines that are indented exactly 8 NOFILL mode spaces cause a break. Since an initial TAB is converted to 8 spaces, it will also break. The RUNOFF and inverse of TABBREAK is TABSPACE. PUB: .NOFILL Lines of text 2.8 BREAKING AT CARRIAGE-RETURNS up to a ________ __ ________________ negating command such In FILL mode, PUB usually converts every carriage- as: return at the end of a text line to a space. If it is .FILL at the end of a sentence, it converts the carriage- return to two spaces. If you would rather that every HTML carriage-return ending a text line caused a paragraph approximation: break, use this command: .CRBREAK
                                                                      Lines of text
               The inverse of CRBREAK is CRSPACE.                     
2.9 NOFILL MODE ______ ____ In NOFILL mode, one input line produces one output line, even if it falls far short of the right margin; if the line is too long, characters will be lost. Every carriage-return ending a text line in NOFILL 2.6 - 2.9 CENTER mode RUNOFF: Page 16 TEXT CONVENTIONS SAILON-70 .CENTER One line of text to mode causes a paragraph break. The commands ADJUST, center CRSPACE, and TABBREAK do not affect this mode. .CENTER Another line of NOFILL mode has several variations, which differ text to center mainly in the final treatment of the output line: PUB: NOFILL: (Standard variation) No special treatment. .CENTER CENTER: Center the output line between the margins. Lines of text up to a negating command FLUSH RIGHT: Shove it against the right margin. such as: .FILL FLUSH LEFT: Shove it against the left margin. HTML: JUSTJUST: Justify it by the insertion of spaces.
VERBATIM: Copy text lines to output exactly as written, Lines of text without changing
```indentations.``Ignore all control characters {a|[#]&|b\[?]-[?]--. Dot in column 1 still signals a command line. DHTML: This mode speeds text processing when no formatting is needed.
except every n'th line. Lines of text < | < ! [?] [?] [?] ~ % 7 Z
| | > ? / [?] [?] . \ - - SUPERIMPOSE mode PUB: 2.10 HORIZONTAL SPACE COMPACTION __________ _____ __________ .SUPERIMPOSE 2 X ~ 7 In COMPACT mode, redundant spaces in the input line X . - are discarded. In RETAIN mode, they are retained. DHTML: More precisely, in COMPACT mode, a sequence of two or
               more spaces is reduced to one space, except at the end X ~ 7
               of a sentence, where it is only reduced to two spaces, 
during justification. X . -
COMPACT and RETAIN modes 2.10 There is no exact equivalent in other markup languages of which I am aware. Pagination in PUB vs. HTML Grouping and many other features of PUB were concerned with pagination, a non-concept in HTML. Naming inconsistencies in PUB The group/apart SAILON-70 TEXT CONVENTIONS Page 17 pairing was one example of inconsistent 2.11 VERTICAL GROUPING naming that ________ ________ made PUB hard to learn. In my In GROUP mode, all output lines are forced to appear original in an unbroken column. Its inverse is APART mode. If design, all the bottom of the output page is encountered while in open/close GROUP mode, the whole group is moved to the top of the pairs were next column or page. consistently named, e.g., It is unwise to use GROUP mode for more than a few GROUP and lines that must appear undivided in the output. NOGROUP. Paul Example: Heckel paid me a visit one day .GROUP in 1971 to EQUATION 6 inform me that m = vt someone had .APART hired him to This would prevent "Equation 6" from appearing at the develop bottom of one page and "m = vt" at the top of the software whose next. functionality was between that of RUNOFF and PUB. He 2.12 MODE AND SWITCH SETTING COMMANDS begged me to ____ ___ ______ _______ ________ make my command suite a The commands that select the paragraphing mode are superset of FILL, NOFILL, CENTER, FLUSH RIGHT, FLUSH LEFT, his. I JUSTJUST, VERBATIM, and SUPERIMPOSE [n], where n foolishly [optional] is any "SAIL" expression. succumbed to the pressure. The commands ADJUST and NOJUST set the FILL-mode justification switch. TABBREAK, TABSPACE, CRBREAK, Ironically, and CRSPACE control the reaction to initial tabs and Paul's project to carriage-returns in FILL mode. was canceled before I The commands RETAIN and COMPACT, GROUP and APART completed PUB. select the space compaction and column grouping modes. If he had informed me, I At the outset of compilation, the settings in force could have are: restored .FILL ADJUST TABSPACE CRSPACE RETAIN APART parsimony. WARNING: Switching to NOFILL or to any of its Digression variations automatically switches to RETAIN mode. This can be overridden by following the command by Years COMPACT. later, Paul wrote a book on 2.11 - 2.12 friendly software design, which I endorsed. More irony. Elements and Tags Like RUNOFF and GML, and unlike SGML and HTML, PUB had no uniform tag syntax with which to bracket elements. Page 18 TEXT CONVENTIONS SAILON-70 2.13 WORD BREAKS ____ ______ The compiler processes the input paragraph in units called words. A "word" is roughly defined as a _____ sequence of consecutive visible characters. More precisely, the compiler concatenates characters into a word until the occurrence of a word break. Special ____ _____ characters in A word break is normally signalled by any of the PUB following in a text line: a in PUB >A space (or a sequence of spaces) served the >A carriage-return (the end of an input line) same purpose >The control character b, if activated (as well as some others) as backslash ( \ ) in many Word breaks serve two functions. modern languages. It (1) FILLING: In generating an output paragraph, the escaped the compiler puts as many words as can fit on each line next before beginning a new line. The paragraph will only character. be divided for this purpose at word breaks. # was like & (2) JUSTIFYING: During justification, extra spaces nbsp; will only be inserted at word breaks. (non-breaking space) in HTML. 2.14 CONTROL FUNCTIONS PUB's _______ _________ reliance on non-ASCII Several control functions can be invoked by control SAIL characters in the text line. The user can choose the characters characters he wishes to serve these functions. For like b as simplicity of exposition, a suggested character has language been designated for each function. delimiters was a barrier The following control functions are available. If the to widespread description states: "BLA mode only", then in other adoption. modes, the character is treated no differently than an alphanumeric. ``````````b````````Cause a word break. ``````````a````````Pretend the``next character is``alphanumeric (this lets you slip in control characters); ``````````#````````Same as a ; sneaks spaces into words. 2.13 - 2.14 MOVE LEFT To achieve: ^. rest of line PUB: ^[?]-1. rest of line DHTML, if you know the width of the font:
                                                                      ^. rest
                                                                      of line
          . ! ?    FILL mode  only, and  only at the  end of  a word: 
marks the end of a sentence. This means: MOVE RIGHT and TAB (1) If followed by two or more spaces, COMPACTion only reduces the spaces to two instead of one. The equivalents in (2) If followed by a carriage-return, replaces the DHTML are relative CR by two spaces instead of one. and absolute horizontal - FILL mode only, and not the first character of a positioning with word: a hyphen. This means: positive values of left. (1) If at the end of a line, prevents the word break that usually occurs there. PUB, where the (2) Otherwise, permits the word to be broken after value of VAR is in the hyphen in case it overfills the output line. character units: \ TAB. Insert spaces up to the next tab stop set by [?](VAR) rest of line the TABS command (see Section 6.3). PHP, where the ``````````[?]+n``````MOVE RIGHT.``Leave n spaces in the output line. value of $var is in pixel units: ``````````[?]-n``````MOVE``LEFT```n characters.``Create``new characters (these due to Jerry Agin): ~ ~ O O ~
``````````````````````````````````````````>= ( - | V.                   rest
```````````````left is n=1). ``Both kinds of``TAB (\ and``[?]n) inhibit of line
               insertion of all justification spaces to their left.   
```````````````````For [?]n``and``[?]+n, n``may be any``"SAIL" expression Flush and Center enclosed in parentheses. In the case of a single letter variable or a one-digit number, the parentheses Microsoft Word has ```````````````may``be omitted. ``RESTRICTION...``[?]() may left, center, not appear as the last thing on a text line. right, and decimal tabs. Centered text ``````````-````````Right Flush. ``If a``\ or [?]n``occurs later``in the is centered around line, slide the text that is between here and there a center tab. PUB flush against the column designated by the tab. had only one kind Otherwise, slide the rest of this paragraph against of tab. Centered the right margin, inhibiting justification. text was centered between two ``````````-````````Center.``If a``\ or [?]n``occurs later in``the line, consecutive tabs. center the text that is between here and there halfway between the current column and the column designated PUB: by the tab. Otherwise, center the following text between the margins, inhibiting justification. Left words-Center words-Right words HTML: 2.14
Left words Center words Right words
Page 20 TEXT CONVENTIONS SAILON-70 ``````````[?]x```````Repeat.```x' is``any character. If [?]x``precedes \, ```````````````[?]+, [?]n, -, or -,``then use the character x``instead of spaces as filler to the left of the affected text ```````````````(i.e., [?].\ puts ..... up to the tab column). ``````````[?]x[?]y[?]z...Use the repeating string xyzxyz... as filler. ``````````|_..._|``Underline.```In the``text between``brackets, every __ ___ ____ _______ _________ _____ visible character is underlined. "_" is only a control _______ _________ __ ___________ ```````````````character when``paired with "|".```If you``want spaces underlined as well in a title, simply replace each space by an underbar. _________________________________ ``````````[?]````````[?]nderline```one```word.````The````following```word ____ (consisting of letters and digits only) is underlined. ``````````p````````print a weird character.``The line printer and FR- 80 have these but your terminal doesn't. To get.............Write __ ___ _____ To be `````````````````````````````````[?]``(center dot) ``````p. continued `````````````````````````````````g``(gamma)````````````pG or pg [after 13 `````````````````````````````````d``(apple delta)``````p[?] Feb `````````````````````````````````[?]``(integral)`````````p~ (tilde) 2005]... `````````````````````````````````+-``(plus-minus)```````p- `````````````````````````````````[?]``(circle plus)``````p+ { Switch to Command Processing. To return to text processing, use }. See Section 2.16. ``````````|x```````Subscript.``The text x is````````````````(an extra lowered a line line is reserved for it). x may be any single character except "[" or "_", or may be a sequence of characters bracketed between [...] . A subscript must appear all on one line. ``````````|x```````Superscript.``Analogous to Subscript, except x may also be the single character "_". Collectively, superscripts and are called somescripts. ___________ subscripts These may combine and nest in interesting ways. Super/subscripts may not nest more deeply than 4. x&y Align. "&" is only considered a control character if it is the first character following a somescript x. 2.14 SAILON-70 TEXT CONVENTIONS Page 21 Its effect is to align the leftmost characters of x and y by backspacing after printing x and before printing y, and to align the rightmost characters by forward spacing to the end of the longer of x and y when done. x must be a somescript. y may be any ```````````````single character``except "[", "|",``or "|", or``may be another somescript, or may be any sequence of characters enclosed between [...] . Examples: To get...Write To get....Write __ ___ _____ __ ___ _____ j _ 2 x````````x|j&|i````y`````````|_&y|[i+j]&|[ 2] i i+j 2 x````````x|i|2`````SUM```````|[ t]&[SUM] i t i2 [?]````````|x&[?]``````x`````````x|i|2 x 2 . i t````````|.&t``````x`````````x|[i|2] 2.15 CONTROL CHARACTER ACTIVATION _______ _________ __________ At the outset of compilation, the only control characters recognized are the punctuators ".", "!", and "?" when they appear at the end of a word, and hyphen ("-") when it appears in the middle of a word. NOTE: Not even "{" is recognized unless you activate it. However, "}" is permanently active, because it is not a text control character but really a command language delimiter. To turn on any control function using its suggested ```````````````character ("a" for example), use the command: .TURN ON "a" To activate the control function using a different ```````````````character, such as "%" or "b", write: 2.15 Page 22 TEXT CONVENTIONS SAILON-70 .TURN ON "%" FOR "a" .TURN ON "b" FOR "a" To de-activate a control character, such as "?" or "%", use: .TURN OFF "?" .TURN OFF "%" One TURN command may have several operands separated by commas: .TURN ON "%" FOR "a", "@" FOR "-", "-", "\" .TURN ON "|", "|", "[", "]", "_", "&" The latter may be abbreviated: .TURN ON "||[]_&" There is a subtle problem that arises when control characters have been turned on inside a macro and the macro wants to turn off only the ones that weren't on ```````````````previously. ``If``it``has``done``a ``TURN ON "|",``for ```````````````example,``it can``not undo``it with``TURN OFF "|", for that would always TURN it OFF whether or not it was originally on. There are two ways to do it right. One is to use block structure (see Section 5.2), but sometimes this is impossible, because blocks cause paragraph breaks. The other way is to use the command TURN ON|OFF without arguments. Its effect is to cancel the previous TURN ON|OFF that had arguments, was in the current block, and has not yet been cancelled. For purposes of smooth exposition, in the rest of this manual it is assumed that you have turned on all the control functions and used all the suggested characters for them. Remember, though, that only the punctuators are turned on unless you command otherwise! It is recommended that you don't turn on any characters except in short blocks where you know you'll remember they're on. Ideal places are inside macro bodies (See Section 3.1). 2.15 SAILON-70 TEXT CONVENTIONS Page 23 2.16 COMPUTED TEXT ________ ____ The control character "{" will switch to command processing right in the middle of a text line. This allows the execution of any PUB commands without first causing either a paragraph break or a word break. If you want a word break before the {, force it by means ```````````````of a b or a space. The command most commonly executed after "{" is the Computed Text Command. A variable, a constant, or a ________ ____ _______ parenthesized expression occurring in isolation is _____________ evaluated and its string value is then scanned by the text scanner as text. Example: A = {A}, and B = |_{(2+2)}_|. ```````````````If``the value``of A``was the``string "[?]3",``this would output: A = 3, and B = 4. _ _ Caution: If a {...} construct extends onto a second input line, be sure to begin the continuation line with a "." -- or you won't be in the command scanner! Caution: A string constant following the word BEGIN is considered a block name, as in SAIL, and not computed text. If you put computed text after BEGIN, precede it by a semicolon. Note that a "}" (which can not be TURNed ON and OFF) switches to text processing from command processing at any time. This allows a Short Text Line to be put _____ ____ ____ right into a command line: .NOFILL }I am a short text line.{BREAK FILL which is the compact equivalent of: .NOFILL I am a short text line. .FILL To summarize, there are two ways to switch from command to text processing: 2.16 Page 24 TEXT CONVENTIONS SAILON-70 >New line without "." in column 1 >} and two ways to switch from text processing to command processing: >New line with "." in column 1 >{ 2.16 SAILON-70 PUB Page 25 SECTION 3 MACROS 3.1 CALLING A MACRO FROM A COMMAND LINE _______ _ _____ ____ _ _______ ____ It is common to repeat an identical sequence of commands many times in a manuscript, e.g., .FILL ADJUST COMPACT TURN ON "[?]{ab" You could define the following macro: .MACRO FAC [?] FILL ADJUST COMPACT TURN ON "[?]{ab" [?] and then whenever you want the whole sequence executed, write simply: .FAC ```````````````The``body of``the macro``enclosed between``[?] and``[?] is substituted for its name and then scanned by the command scanner. A macro may also have arguments: .MACRO T(CHR) [?] NOFILL TURN ON "CHR" [?] which when called by: .T(a) expands to: . NOFILL TURN ON "a" 3.2 CALLING A MACRO FROM A TEXT LINE _______ _ _____ ____ _ ____ ____ It is also common to repeat an awkward sequence of control characters many times in the manuscript, e.g., X|i&|[j,k] You could define the following macro: .MACRO XIJK [?]"X|i&|[j,k]"[?] but to call it you must get to the command scanner: {XIJK} 3.1 - 3.2 Page 26 MACROS SAILON-70 When the body is substituted for the name, this becomes a string constant inside curly brackets: {"X|i&|[j,k]"} so it is considered computed text and is scanned by the text scanner, producing the output: i X j,k Again, parameters can be used: .MACRO S(X,I,J,K) [?]"X|i&|[j,k]"[?] If called by {X(i,j,k)} this would expand to the same as above, but called by {S(Y,t,t1,URG)} ```````````````it would expand to "Y|t&|[t1,URG]" which would output: t Y t1,URG Some macros are declared for you in an automatically loaded file PUBSTD.DFS (see Section 7.5). Other useful macros are declared in a file PUBMAC.DFS that you can REQUIRE (see Section 7.11) to be loaded; they are described in PUBMAC.TES[UP,DOC]. 3.3 TEMPLATES _________ A "template" occurs as a part of several commands, including the macro declaration, and requires some explanation. Its purpose is to store away a piece of program for later, instead of immediate, execution. Syntax: [?] [?] The may include other templates, and may span several lines. However, several rules should be followed: (1) The template should begin and end on a command line. 3.3 SAILON-70 MACROS Page 27 ```````````````(2) Every [?] or unpaired``[?] or [?] must be preceded``by a ```````````````[?]. (3) People who change COMMAND CHARACTER in mid- manuscript, note: the character beginning command lines within the template must be the one current at the time of declaration -- not the one current when you invoke it later. 3.4 MACRO DECLARATION _____ ___________ Syntax: MACRO [] [;]