Replied: 09 Jul 84 16:54:26 PDT (Mon) Replied: To: "Tim Shimeall" Replied: cc: augusto@UCI-750a Date: 09 Jul 84 14:35:36 PDT (Mon) To: augusto@UCI-750a cc: milne@UCI-750a Subject: itroff -ms cheat sheet From: "Tim Shimeall" Note: the following information is intended to apply to input files for "troff" with the -ms macro package. "troff" is executed by typing one of the two following commands: itroff -ms or ditroff -ms where is a list of input files, seperated by blanks. All commands starting with a "." must start in the leftmost column of the line, and must appear in a line of their own. All commands starting with a backslash "\" may appear anywhere in the input text, as needed. Available units (appear only in command arguments): i inches c centimeters m width of the letter M in the current font (max letter width) n width of the letter N in the current font (Ave letter width) p points (1/72 inch) u basic unit (1/6 point) Basic Formatting commands: .PP Start paragraph: sets font size, line length, and hyphenation; indents first line about 0.25 inch .LP Similar to .PP but with no indentation of first line .IP Indented Paragraph: entire paragraph is indented by about 0.5 in. Has an optional argument which is text to "label" the paragraph. .br start a new line .bp start a new page numbered by the optional argument .sp n produce a space of n lines. Note: n can be negative for upward moves .in n set the indentation to n (default is 0) default units are inches can specify an addition/subtraction to current indentation by using + or - in front of argument .ti n indent just the next line by n .ce n center the next n lines .ll n set line length to n (default is 6.5 in) default units are inches .po n offset page by n (default is 0) default units are inches .DS start diagram; turns off formatting (useful for program text) .DE end diagram .nf turn off filling .na turn off adjustment .fi turn on filling .ad b turn on adjustment .ls n set the inter-line spacing to n (.ls 2 doublespaces text) Font changing commands: .nr PS n change the font size to n point .nr VS n change the vertical spacing to n points \fR change the font to the normal font at the current size \fI change the font to the italic font at the current size \fB change the font to the bold font at the current size \s+n increase the size of the font by n points \s-n decrease the size of the font by n points Note: not all sizes are available! \s+2 \s-2, which are almost all that are needed, work. Use others at your own risk. Commands to use when writing papers: .TL The following lines are the title of the paper .AU The following lines are the autors of the paper .AI The following lines are the address of the author .AS Start abstract .AE End abstract .ND turn off printing of date at the bottom of each page .RF Report format: Bell Labs Memorandom Style .SH Section Heading .FS Start Footnote .FE End Footnote Other formatting commands: \u go up 1/2 line \d go down 1/2 line \h'n' move right n (which must include units) (negative left) \w'string' return the width of string \kx store the current horizontal position in register x \nx return the value of the register x .de xx start the definition of a macro named xx .. end definition or addition to macro .am xx add commands to the end of a macro named xx Special Character Commands: \(bu bullet \(hy hyphen \(dg dagger \(dd double dagger \(*a - \(*z lower case greek alphabet \(*A - \(*Z upper case greek alphabet \(es empty set \(mo member of \(co copyright \(tm trademark (ditroff only) \(rg registered (ditroff only) \ space sized character (that's a backslash-space) Examples (nifty things to try): Definition of a macro to underscore one word: .de us \\$1\l'|0\(ul' .. Turn off hyphenation in each paragraph: .am PP .nh .. Produce side-by-side blocks of text, left justified: .nf .na There was a young lady named Bright\h'10m'\kxThere once was a lady from Niger .br Who's speed was faster than light\ky\h'\nxu-\nyu'Who smiled as she rode on a tiger .br She went out one day\ky\h'\nxu-\nyu'They came back from the ride .br In a relative way\ky\h'\nxu-\nyu'With the lady inside .br And came back on the previous night!\ky\h'\nxu-\nyu'And the smile on the face of the tiger! Produce a block of text adjusted at the end of a string .in \w'TYPE TxPort = \ \ 'u .ti 0 TYPE TxPort = RECORD .br Top, Left, Width, Height:INTEGER; .br Opts: TxpOptSet; .in -\w'\ \ 'u END; Note: most of the preceeding information came from the document: Nroff/Troff User's Manual Joseph F. Ossanna Bell Laboratories, Oct. 11,1976. I have a copy, as does many of the manual racks.