home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / 1_1_contri / usd / 22_memacro / intro_me next >
Encoding:
Text File  |  1986-04-18  |  41.1 KB  |  2,319 lines

  1. .\" Copyright (c) 1980 Regents of the University of California.
  2. .\" All rights reserved.  The Berkeley software License Agreement
  3. .\" specifies the terms and conditions for redistribution.
  4. .\"
  5. .\"    @(#)intro.me    6.3 (Berkeley) 4/17/86
  6. .\"
  7. .ll 6.5i
  8. .lt 6.5i
  9. .pn 0
  10. .ds MO 2.27\"        version of -me to which this applies
  11. .nr si 3n
  12. \".he 'USING NROFF AND \-ME''%'
  13. .eh 'USD:22-%''Writing Papers with NROFF using \-me'
  14. .oh 'Writing Papers with NROFF using \-me''USD:22-%'
  15. .ds U \s-1UNIX\s0
  16. .ds N \s-1NROFF\s0
  17. .ds T \s-1TROFF\s0
  18. .+c
  19. .(l C
  20. .sz 14
  21. .b "Writing Papers with NROFF using \-me"
  22. .sz
  23. .sp 2
  24. .ul
  25. Eric P. Allman*
  26. .(f
  27. *Author's current address:
  28. Britton Lee, Inc.,
  29. 1919 Addison Suite 105,
  30. Berkeley, California 94704.
  31. .)f
  32. .sp
  33. Project INGRES
  34. Electronics Research Laboratory
  35. University of California, Berkeley
  36. Berkeley, California  94720
  37. .)l
  38. .sp 4
  39. .pp
  40. This document describes
  41. the text processing facilities
  42. available on the \*U\(dg
  43. .(f
  44. \(dg\*U is a trademark
  45. of AT&T Bell Laboratories
  46. .)f
  47. operating system
  48. via \*N\(dg and the
  49. \-me
  50. macro package.
  51. It is assumed
  52. that the reader
  53. already is generally familiar
  54. with the \*U operating system
  55. and a text editor
  56. such as
  57. .b ex .
  58. This is intended to be a casual introduction,
  59. and
  60. as such not all material is covered.
  61. In particular,
  62. many variations and additional features
  63. of the \-me macro package
  64. are not explained.
  65. For a complete discussion of this
  66. and other issues,
  67. see
  68. .ul
  69. The \-me Reference Manual
  70. and
  71. .ul
  72. The \*N/\*T Reference Manual.
  73. .pp
  74. \*N, a computer program
  75. that runs on the \*U operating system,
  76. reads an input file
  77. prepared by the user
  78. and outputs a formatted paper
  79. suitable for publication or framing.
  80. The input consists of
  81. .i text ,
  82. or words to be printed,
  83. and
  84. .i requests ,
  85. which give instructions
  86. to the \*N program
  87. telling how to format the printed copy.
  88. .pp
  89. Section 1
  90. describes the basics
  91. of text processing.
  92. Section 2
  93. describes the basic requests.
  94. Section 3
  95. introduces displays.
  96. Annotations,
  97. such as footnotes,
  98. are handled in
  99. section 4.
  100. The more complex requests
  101. which are not discussed in section 2
  102. are covered in section 5.
  103. Finally,
  104. section 6
  105. discusses things you will need
  106. to know
  107. if you want to typeset documents.
  108. If you are a novice,
  109. you probably won't want to read beyond section 4
  110. until you have tried some of the basic features out.
  111. .pp
  112. When you have your raw text ready,
  113. call the \*N formatter by typing
  114. as a request to the \*U shell:
  115. .(b
  116. nroff \-me \-T\c
  117. .i "type files"
  118. .)b
  119. where
  120. .i type
  121. describes the type of terminal
  122. you are outputting to.
  123. Common values are
  124. .b dtc
  125. for a DTC 300s
  126. (daisy-wheel type)
  127. printer and
  128. .b lpr
  129. for the line printer.
  130. If the
  131. .b \-T
  132. flag is omitted,
  133. a
  134. .q "lowest common denominator"
  135. terminal is assumed;
  136. this is good for previewing output
  137. on most terminals.
  138. A complete description of options
  139. to the \*N command can be found in
  140. .ul
  141. The \*N/\*T Reference Manual.
  142. .pp
  143. The word
  144. .i argument
  145. is used in this manual
  146. to mean a word or number
  147. which appears on the same line
  148. as a request
  149. which modifies the meaning
  150. of that request.
  151. For example,
  152. the request
  153. .(b
  154. \&.sp
  155. .)b
  156. spaces one line,
  157. but
  158. .(b
  159. \&.sp 4
  160. .)b
  161. spaces four lines.
  162. The number
  163. .b 4
  164. is an
  165. .i argument
  166. to the
  167. .b .sp
  168. request
  169. which says to space four lines
  170. instead of one.
  171. Arguments are separated from the request
  172. and from each other
  173. by spaces.
  174. .sh 1 "Basics of Text Processing"
  175. .pp
  176. The primary function
  177. of \*N
  178. is to
  179. .i collect
  180. words from input lines,
  181. .i fill
  182. output lines with those words,
  183. .i justify
  184. the right hand margin by inserting extra spaces
  185. in the line,
  186. and output the result.
  187. For example,
  188. the input:
  189. .(b
  190. Now is the time
  191. for all good men
  192. to come to the aid
  193. of their party.
  194. Four score and seven
  195. years ago,...
  196. .)b
  197. will be read,
  198. packed onto output lines,
  199. and justified
  200. to produce:
  201. .(b F
  202. Now is the time
  203. for all good men
  204. to come to the aid
  205. of their party.
  206. Four score and seven
  207. years ago,...
  208. .)b
  209. Sometimes you may want to start a new output line
  210. even though the line you are on
  211. is not yet full;
  212. for example,
  213. at the end of a paragraph.
  214. To do this
  215. you can cause a
  216. .i break ,
  217. which
  218. starts a new output line.
  219. Some requests
  220. cause a break automatically,
  221. as do blank input lines
  222. and input lines beginning with a space.
  223. .pp
  224. Not all input lines
  225. are text to be formatted.
  226. Some of the input lines
  227. are
  228. .i requests
  229. which describe
  230. how to format the text.
  231. Requests always have a period
  232. or an apostrophe
  233. (\c
  234. .q "\|\(aa\|" )
  235. as the first character
  236. of the input line.
  237. .pp
  238. The text formatter
  239. also does more complex things,
  240. such as automatically numbering pages,
  241. skipping over page folds,
  242. putting footnotes in the correct place,
  243. and so forth.
  244. .pp
  245. I can offer you a few hints
  246. for preparing text
  247. for input to \*N.
  248. First,
  249. keep the input lines short.
  250. Short input lines are easier to edit,
  251. and \*N will pack words onto longer lines
  252. for you anyhow.
  253. In keeping with this,
  254. it is helpful
  255. to begin a new line
  256. after every period,
  257. comma,
  258. or phrase,
  259. since common corrections
  260. are to add or delete sentences
  261. or phrases.
  262. Second,
  263. do not put spaces at the end of lines,
  264. since this can sometimes confuse the \*N
  265. processor.
  266. Third,
  267. do not hyphenate words at the end of lines
  268. (except words that should have hyphens in them,
  269. such as
  270. .q mother-in-law );
  271. \*N is smart enough to hyphenate words
  272. for you as needed,
  273. but is not smart enough
  274. to take hyphens out
  275. and join a word back together.
  276. Also,
  277. words such as
  278. .q mother-in-law
  279. should not be broken
  280. over a line,
  281. since then you will get a space
  282. where not wanted,
  283. such as
  284. .tr @-
  285. .nh
  286. .q "mother@\ in@law" .
  287. .br
  288. .tr @@
  289. .hy 14
  290. .sh 1 "Basic Requests"
  291. .sh 2 "Paragraphs"
  292. .pp
  293. Paragraphs are begun
  294. by using the
  295. .b .pp
  296. request.
  297. For example,
  298. the input:
  299. .(b
  300. \&.pp
  301. Now is the time for all good men
  302. to come to the aid of their party.
  303. Four score and seven years ago,...
  304. .)b
  305. produces a blank line
  306. followed by an indented first line.
  307. The result is:
  308. .(b F
  309. .ti +\n(piu
  310. Now is the time for all good men
  311. to come to the aid of their party.
  312. Four score and seven years ago,...
  313. .)b
  314. .pp
  315. Notice that the sentences
  316. of the paragraphs
  317. .i "must not"
  318. begin with a space,
  319. since blank lines
  320. and lines beginning with spaces
  321. cause a break.
  322. For example,
  323. if I had typed:
  324. .(b
  325. \&.pp
  326. Now is the time for all good men
  327.       to come to the aid of their party.
  328. Four score and seven years ago,...
  329. .)b
  330. The output would be:
  331. .(b F
  332. .ti +\n(piu
  333. Now is the time for all good men
  334.       to come to the aid of their party.
  335. Four score and seven years ago,...
  336. .)b
  337. A new line begins after the word
  338. .q men
  339. because the second line began with a space character.
  340. .pp
  341. There are many
  342. fancier
  343. types of paragraphs,
  344. which will be described later.
  345. .sh 2 "Headers and Footers"
  346. .pp
  347. Arbitrary headers and footers
  348. can be put
  349. at the top and bottom
  350. of every page.
  351. Two requests
  352. of the form
  353. .b .he \ \c
  354. .i title
  355. and
  356. .b .fo \ \c
  357. .i title
  358. define the titles to put at the head and the foot
  359. of every page,
  360. respectively.
  361. The titles are called
  362. .i three-part
  363. titles,
  364. that is,
  365. there is a left-justified part,
  366. a centered part,
  367. and a right-justified part.
  368. To separate these three parts
  369. the first character of
  370. .i title
  371. (whatever it may be)
  372. is used as a delimiter.
  373. Any character may be used,
  374. but
  375. backslash
  376. and double quote marks
  377. should be avoided.
  378. The percent sign
  379. is replaced by the current page number
  380. whenever found in the title.
  381. For example,
  382. the input:
  383. .(b
  384. \&.he \(aa\(aa%\(aa\(aa
  385. \&.fo \(aaJane Jones\(aa\(aaMy Book\(aa
  386. .)b
  387. results in the page number
  388. centered at the top
  389. of each page,
  390. .q "Jane Jones"
  391. in the lower left corner,
  392. and
  393. .q "My Book"
  394. in the lower right corner.
  395. .sh 2 "Double Spacing"
  396. .pp
  397. .ls 2
  398. \*N will double space output text automatically if you
  399. use the request
  400. .b ".ls\ 2" ,
  401. as is done in this section.
  402. You can revert to single spaced mode
  403. by typing
  404. .b ".ls\ 1" .
  405. .ls 1
  406. .sh 2 "Page Layout"
  407. .pp
  408. A number of requests allow
  409. you to change the way the printed copy looks,
  410. sometimes called the
  411. .i layout
  412. of the output page.
  413. Most of these requests adjust the placing
  414. of
  415. .q "white space"
  416. (blank lines or spaces).
  417. In these explanations,
  418. characters in italics
  419. should be replaced with values you wish to use;
  420. bold characters
  421. represent characters which should actually be typed.
  422. .pp
  423. The
  424. .b .bp
  425. request
  426. starts a new page.
  427. .pp
  428. The request
  429. .b .sp \ \c
  430. .i N
  431. leaves
  432. .i N
  433. lines of blank space.
  434. .i N
  435. can be omitted
  436. (meaning skip a single line)
  437. or can be of the form
  438. .i N \^\c
  439. .b i
  440. (for
  441. .i N
  442. inches)
  443. or
  444. .i N \^\c
  445. .b c
  446. (for
  447. .i N
  448. centimeters).
  449. For example, the input:
  450. .(b
  451. \&.sp 1.5i
  452. My thoughts on the subject
  453. \&.sp
  454. .)b
  455. leaves one and a half inches of space,
  456. followed by the line
  457. .q "My thoughts on the subject" ,
  458. followed by a single blank line.
  459. .pp
  460. The
  461. .b .in \ \c
  462. .i +N
  463. request
  464. changes the amount of white space
  465. on the left of the page
  466. (the
  467. .i indent ).
  468. The argument
  469. .i N
  470. can be of the form
  471. .b + \c
  472. .i N
  473. (meaning leave
  474. .i N
  475. spaces more than you are already leaving),
  476. .b \- \c
  477. .i N
  478. (meaning leave less than you do now),
  479. or just
  480. .i N
  481. (meaning leave exactly
  482. .i N
  483. spaces).
  484. .i N
  485. can be of the form
  486. .i N \^\c
  487. .b i
  488. or
  489. .i N \^\c
  490. .b c
  491. also.
  492. For example,
  493. the input:
  494. .(b
  495. initial text
  496. \&.in 5
  497. some text
  498. \&.in +1i
  499. more text
  500. \&.in \-2c
  501. final text
  502. .)b
  503. produces
  504. .q "some text"
  505. indented exactly five spaces
  506. from the left margin,
  507. .q "more text"
  508. indented five spaces
  509. plus one inch
  510. from the left margin
  511. (fifteen spaces
  512. on a pica typewriter),
  513. and
  514. .q "final text"
  515. indented five spaces
  516. plus one inch
  517. minus two centimeters
  518. from the margin.
  519. That is,
  520. the output is:
  521. .(b
  522. initial text
  523. .in +5
  524. some text
  525. .in +1i
  526. more text
  527. .in -2c
  528. final text
  529. .)b
  530. .pp
  531. The
  532. .b .ti \ \c
  533. .i +N
  534. (temporary indent)
  535. request is used like
  536. .b .in \ \c
  537. .i +N
  538. when the indent
  539. should apply to one line only,
  540. after which it should revert
  541. to the previous indent.
  542. For example,
  543. the input:
  544. .(b
  545. \&.in 1i
  546. \&.ti 0
  547. Ware, James R.  The Best of Confucius,
  548. Halcyon House, 1950.
  549. An excellent book containing translations of
  550. most of Confucius\(aa most delightful sayings.
  551. A definite must for anyone interested in the early foundations
  552. of Chinese philosophy.
  553. .)b
  554. produces:
  555. .in 1i+\n($iu
  556. .ti \n($iu
  557. Ware, James R.  The Best of Confucius,
  558. Halcyon House, 1950.
  559. An excellent book containing translations of
  560. most of Confucius' most delightful sayings.
  561. A definite must for anyone interested in the early foundations
  562. of Chinese philosophy.
  563. .pp
  564. Text lines can be centered
  565. by using the
  566. .b .ce
  567. request.
  568. The line after the
  569. .b .ce
  570. is centered
  571. (horizontally)
  572. on the page.
  573. To center more than one line,
  574. use
  575. .b .ce \ \c
  576. .i N
  577. (where
  578. .i N
  579. is the number of lines to center),
  580. followed by the
  581. .i N
  582. lines.
  583. If you want to center many lines
  584. but don't want to count them,
  585. type:
  586. .(b
  587. \&.ce 1000
  588. lines to center
  589. \&.ce 0
  590. .)b
  591. The
  592. .b ".ce\ 0"
  593. request tells \*N to center zero more lines,
  594. in other words,
  595. stop centering.
  596. .pp
  597. All of these requests
  598. cause a break;
  599. that is,
  600. they always start
  601. a new line.
  602. If you want to start a new line
  603. without performing any other action,
  604. use
  605. .b .br .
  606. .sh 2 "Underlining"
  607. .pp
  608. Text can be underlined
  609. using the
  610. .b .ul
  611. request.
  612. The
  613. .b .ul
  614. request
  615. causes the next input line
  616. to be underlined when output.
  617. You can underline multiple lines
  618. by stating a count of
  619. .i input
  620. lines to underline,
  621. followed by those lines
  622. (as with the
  623. .b .ce
  624. request).
  625. For example,
  626. the input:
  627. .(b
  628. \&.ul 2
  629. Notice that these two input lines
  630. are underlined.
  631. .)b
  632. will underline those eight words in \*N.
  633. (In \*T they will be set in italics.)
  634. .sh 1 "Displays"
  635. .pp
  636. Displays are sections of text
  637. to be set off
  638. from the body of the paper.
  639. Major quotes,
  640. tables,
  641. and figures
  642. are types of displays,
  643. as are all the examples
  644. used in this document.
  645. All displays
  646. except centered blocks
  647. are output
  648. single spaced.
  649. .sh 2 "Major Quotes"
  650. .pp
  651. Major quotes
  652. are quotes which are several lines long,
  653. and hence are set in from the rest
  654. of the text
  655. without quote marks
  656. around them.
  657. These can be generated
  658. using the commands
  659. .b .(q
  660. and
  661. .b .)q
  662. to surround the quote.
  663. For example,
  664. the input:
  665. .(b
  666. As Weizenbaum points out:
  667. \&.(q
  668. It is said that to explain is to explain away.
  669. This maxim is nowhere so well fulfilled
  670. as in the areas of computer programming,...
  671. \&.)q
  672. .)b
  673. generates as output:
  674. .lp
  675. As Weizenbaum points out:
  676. .(q
  677. It is said that to explain is to explain away.
  678. This maxim is nowhere so well fulfilled
  679. as in the areas of computer programming,...
  680. .)q
  681. .sh 2 "Lists"
  682. .pp
  683. A
  684. .i list
  685. is an indented,
  686. single spaced,
  687. unfilled display.
  688. Lists should be used
  689. when the material to be printed
  690. should not be filled and justified
  691. like normal text,
  692. such as columns of figures
  693. or the examples used in this paper.
  694. Lists are surrounded
  695. by the requests
  696. .b .(l
  697. and
  698. .b .)l .
  699. For example,
  700. type:
  701. .(b
  702. Alternatives to avoid deadlock are:
  703. \&.(l
  704. Lock in a specified order
  705. Detect deadlock and back out one process
  706. Lock all resources needed before proceeding
  707. \&.)l
  708. .)b
  709. will produce:
  710. .br
  711. Alternatives to avoid deadlock are:
  712. .(l
  713. Lock in a specified order
  714. Detect deadlock and back out one process
  715. Lock all resources needed before proceeding
  716. .)l
  717. .sh 2 "Keeps"
  718. .pp
  719. A
  720. .i keep
  721. is a display of lines
  722. which are kept on a single page
  723. if possible.
  724. An example of where you would use a keep
  725. might be a diagram.
  726. Keeps differ from lists
  727. in that lists may be broken
  728. over a page boundary
  729. whereas keeps will not.
  730. .pp
  731. Blocks are the basic kind of keep.
  732. They begin with the request
  733. .b .(b
  734. and end with the request
  735. .b .)b .
  736. If there is not room on the current page
  737. for everything in the block,
  738. a new page is begun.
  739. This has the unpleasant effect
  740. of leaving blank space
  741. at the bottom of the page.
  742. When this is not appropriate,
  743. you can use the alternative,
  744. called
  745. .i "floating keeps" .
  746. .pp
  747. .i "Floating keeps"
  748. move relative to the text.
  749. Hence,
  750. they are good for things
  751. which will be referred to
  752. by name,
  753. such as
  754. .q "See figure 3" .
  755. A floating keep will appear
  756. at the bottom of the current page
  757. if it will fit;
  758. otherwise,
  759. it will appear at the top
  760. of the next page.
  761. Floating keeps begin with the line
  762. .b .(z
  763. and end with the line
  764. .b .)z .
  765. For an example of a floating keep,
  766. see figure 1.
  767. .(z
  768. .in 1i
  769. .xl -1i
  770. .hl
  771. \&.(z
  772. \&.hl
  773. Text of keep to be floated.
  774. \&.sp
  775. \&.ce
  776. Figure 1.  Example of a Floating Keep.
  777. \&.hl
  778. \&.)z
  779. .sp
  780. .ce
  781. Figure 1.  Example of a Floating Keep.
  782. .hl
  783. .)z
  784. The
  785. .b .hl
  786. request is used
  787. to draw a horizontal line
  788. so that the figure
  789. stands out from the text.
  790. .sh 2 "Fancier Displays"
  791. .pp
  792. Keeps and lists are normally collected in
  793. .i nofill
  794. mode,
  795. so that they are good for tables and such.
  796. If you want a display
  797. in fill mode
  798. (for text),
  799. type
  800. .b ".(l\ F"
  801. (Throughout this section,
  802. comments applied to
  803. .b .(l
  804. also apply to
  805. .b .(b
  806. and
  807. .b .(z ).
  808. This kind of display
  809. will be indented from both margins.
  810. For example,
  811. the input:
  812. .(b
  813. \&.(l F
  814. And now boys and girls,
  815. a newer, bigger, better toy than ever before!
  816. Be the first on your block to have your own computer!
  817. Yes kids, you too can have one of these modern
  818. data processing devices.
  819. You too can produce beautifully formatted papers
  820. without even batting an eye!
  821. \&.)l
  822. .)b
  823. will be output as:
  824. .(b F
  825. And now boys and girls,
  826. a newer, bigger, better toy than ever before!
  827. Be the first on your block to have your own computer!
  828. Yes kids, you too can have one of these modern
  829. data processing devices.
  830. You too can produce beautifully formatted papers
  831. without even batting an eye!
  832. .)b
  833. .pp
  834. Lists and blocks are also normally indented
  835. (floating keeps are normally left justified).
  836. To get a left-justified list,
  837. type
  838. .b ".(l\ L" .
  839. To get a list centered
  840. line-for-line,
  841. type
  842. .b ".(l C" .
  843. For example,
  844. to get a filled,
  845. left justified list, enter:
  846. .(b
  847. \&.(l L F
  848. text of block
  849. \&.)l
  850. .)b
  851. The input:
  852. .(b
  853. \&.(l
  854. first line of unfilled display
  855. more lines
  856. \&.)l
  857. .)b
  858. produces the indented text:
  859. .(b
  860. first line of unfilled display
  861. more lines
  862. .)b
  863. Typing the character
  864. .b L
  865. after the
  866. .b .(l
  867. request produces the left justified result:
  868. .(b L
  869. first line of unfilled display
  870. more lines
  871. .)b
  872. Using
  873. .b C
  874. instead of
  875. .b L
  876. produces the line-at-a-time centered output:
  877. .(b C
  878. first line of unfilled display
  879. more lines
  880. .)b
  881. .pp
  882. Sometimes it may be
  883. that you want to center several lines
  884. as a group,
  885. rather than centering them
  886. one line at a time.
  887. To do this
  888. use centered blocks,
  889. which are surrounded by the requests
  890. .b .(c
  891. and
  892. .b .)c .
  893. All the lines are centered as a unit,
  894. such that the longest line is centered
  895. and the rest are
  896. lined up around that line.
  897. Notice that lines
  898. do not move
  899. relative to each other
  900. using centered blocks,
  901. whereas they do
  902. using the
  903. .b C
  904. argument to keeps.
  905. .pp
  906. Centered blocks are
  907. .i not
  908. keeps,
  909. and may be used
  910. in conjunction
  911. with keeps.
  912. For example,
  913. to center a group of lines
  914. as a unit
  915. and keep them
  916. on one page,
  917. use:
  918. .(b
  919. \&.(b L
  920. \&.(c
  921. first line of unfilled display
  922. more lines
  923. \&.)c
  924. \&.)b
  925. .)b
  926. to produce:
  927. .(b L
  928. .(c
  929. first line of unfilled display
  930. more lines
  931. .)c
  932. .)b
  933. If the block requests
  934. (\c
  935. .b .(b
  936. and
  937. .b .)b )
  938. had been omitted
  939. the result would have been the same,
  940. but with no guarantee
  941. that the lines of the centered block
  942. would have all been on one page.
  943. Note the use of the
  944. .b L
  945. argument to
  946. .b .(b ;
  947. this causes the centered block
  948. to center within the entire line
  949. rather than within the line
  950. minus the indent.
  951. Also,
  952. the center requests
  953. must
  954. be nested
  955. .i inside
  956. the keep requests.
  957. .sh 1 "Annotations"
  958. .pp
  959. There are a number of requests
  960. to save text
  961. for later printing.
  962. .i Footnotes
  963. are printed at the bottom of the current page.
  964. .i "Delayed text"
  965. is intended to be a variant form
  966. of footnote;
  967. the text is printed only 
  968. when explicitly called for,
  969. such as at the end of each chapter.
  970. .i Indexes
  971. are a type of delayed text
  972. having a tag
  973. (usually the page number)
  974. attached to each entry
  975. after a row of dots.
  976. Indexes are also saved
  977. until called for explicitly.
  978. .sh 2 "Footnotes"
  979. .pp
  980. Footnotes begin with the request
  981. .b .(f
  982. and end with the request
  983. .b .)f .
  984. The current footnote number is maintained
  985. automatically,
  986. and can be used by typing \e**,
  987. to produce a footnote number\**.
  988. .(f
  989. \**Like this.
  990. .)f
  991. The number is automatically incremented
  992. after every footnote.
  993. For example,
  994. the input:
  995. .(b
  996. \&.(q
  997. A man who is not upright
  998. and at the same time is presumptuous;
  999. one who is not diligent and at the same time is ignorant;
  1000. one who is untruthful and at the same time is incompetent;
  1001. such men I do not count among acquaintances.\e**
  1002. \&.(f
  1003. \e**James R. Ware,
  1004. \&.ul
  1005. The Best of Confucius,
  1006. Halcyon House, 1950.
  1007. Page 77.
  1008. \&.)f
  1009. \&.)q
  1010. .)b
  1011. generates the result:
  1012. .(q
  1013. A man who is not upright
  1014. and at the same time is presumptuous;
  1015. one who is not diligent and at the same time is ignorant;
  1016. one who is untruthful and at the same time is incompetent;
  1017. such men I do not count among acquaintances.\**
  1018. .(f
  1019. \**James R. Ware,
  1020. .ul
  1021. The Best of Confucius,
  1022. Halcyon House, 1950.
  1023. Page 77.
  1024. .)f
  1025. .)q
  1026. It is important
  1027. that the footnote
  1028. appears
  1029. .i inside
  1030. the quote,
  1031. so that you can be sure
  1032. that the footnote
  1033. will appear
  1034. on the same page
  1035. as the quote.
  1036. .sh 2 "Delayed Text"
  1037. .pp
  1038. Delayed text
  1039. is very similar to a footnote
  1040. except that it is printed
  1041. when called for explicitly.
  1042. This allows a list of
  1043. references to
  1044. appear
  1045. (for example)
  1046. at the end of each chapter,
  1047. as is the convention in some disciplines.
  1048. Use
  1049. .b \e*#
  1050. on delayed text
  1051. instead of
  1052. .b \e**
  1053. as on footnotes.
  1054. .pp
  1055. If you are using delayed text
  1056. as your standard reference mechanism,
  1057. you can still use footnotes,
  1058. except that you may want to reference them
  1059. with special characters*
  1060. .(f
  1061. *Such as an asterisk.
  1062. .)f
  1063. rather than numbers.
  1064. .sh 2 "Indexes"
  1065. .pp
  1066. An
  1067. .q index
  1068. (actually more like a table of contents,
  1069. since the entries are not sorted alphabetically)
  1070. resembles delayed text,
  1071. in that it is saved until called for.
  1072. However,
  1073. each entry has the page number
  1074. (or some other tag)
  1075. appended to the last line
  1076. of the index entry
  1077. after a row of dots.
  1078. .pp
  1079. Index entries begin with the request
  1080. .b .(x
  1081. and end with
  1082. .b .)x .
  1083. The
  1084. .b .)x
  1085. request may have a argument,
  1086. which is the value to print
  1087. as the
  1088. .q "page number" .
  1089. It defaults to the current page number.
  1090. If the page number given is an underscore
  1091. (\c
  1092. .q _ )
  1093. no page number
  1094. or line of dots
  1095. is printed at all.
  1096. To get the line of dots
  1097. without a page number,
  1098. type
  1099. .b ".)x """"" ,
  1100. which specifies an explicitly null page number.
  1101. .pp
  1102. The
  1103. .b .xp
  1104. request prints the index.
  1105. .pp
  1106. For example,
  1107. the input:
  1108. .(b
  1109. \&.(x
  1110. Sealing wax
  1111. \&.)x
  1112. \&.(x
  1113. Cabbages and kings
  1114. \&.)x _
  1115. \&.(x
  1116. Why the sea is boiling hot
  1117. \&.)x 2.5a
  1118. \&.(x
  1119. Whether pigs have wings
  1120. \&.)x ""
  1121. \&.(x
  1122. This is a terribly long index entry, such as might be used
  1123. for a list of illustrations, tables, or figures; I expect it to
  1124. take at least two lines.
  1125. \&.)x
  1126. \&.xp
  1127. .)b
  1128. generates:
  1129. .(x
  1130. Sealing wax
  1131. .)x
  1132. .(x
  1133. Cabbages and kings
  1134. .)x _
  1135. .(x
  1136. Why the sea is boiling hot
  1137. .)x 2.5a
  1138. .(x
  1139. Whether pigs have wings
  1140. .)x ""
  1141. .(x
  1142. This is a terribly long index entry, such as might be used
  1143. for a list of illustrations, tables, or figures; I expect it to
  1144. take at least two lines.
  1145. .)x
  1146. .xp
  1147. .pp
  1148. The
  1149. .b .(x
  1150. request may have a single character
  1151. argument,
  1152. specifying the
  1153. .q name
  1154. of the index;
  1155. the normal index is
  1156. .b x .
  1157. Thus,
  1158. several
  1159. .q indices
  1160. may be maintained simultaneously
  1161. (such as a list of tables, table of contents, etc.).
  1162. .pp
  1163. Notice that the index must be printed
  1164. at the
  1165. .i end
  1166. of the paper,
  1167. rather than at the beginning
  1168. where it will probably appear
  1169. (as a table of contents);
  1170. the pages may have to be physically rearranged
  1171. after printing.
  1172. .sh 1 "Fancier Features"
  1173. .pp
  1174. A large number of fancier requests
  1175. exist,
  1176. notably requests to provide other sorts of paragraphs,
  1177. numbered sections of the form
  1178. .b 1.2.3
  1179. (such as used in this document),
  1180. and multicolumn output.
  1181. .sh 2 "More Paragraphs"
  1182. .pp
  1183. Paragraphs generally start with
  1184. a blank line
  1185. and with the first line
  1186. indented.
  1187. It is possible to get
  1188. left-justified block-style paragraphs
  1189. by using
  1190. .b .lp
  1191. instead of
  1192. .b .pp ,
  1193. as demonstrated by the next paragraph.
  1194. .lp
  1195. Sometimes you want to use paragraphs
  1196. that have the
  1197. .i body
  1198. indented,
  1199. and the first line
  1200. exdented
  1201. (opposite of indented)
  1202. with a label.
  1203. This can be done with the
  1204. .b .ip
  1205. request.
  1206. A word specified on the same line as
  1207. .b .ip
  1208. is printed in the margin,
  1209. and the body is lined up
  1210. at a prespecified position
  1211. (normally five spaces).
  1212. For example,
  1213. the input:
  1214. .(b
  1215. \&.ip one
  1216. This is the first paragraph.
  1217. Notice how the first line
  1218. of the resulting paragraph lines up
  1219. with the other lines in the paragraph.
  1220. \&.ip two
  1221. And here we are at the second paragraph already.
  1222. You may notice that the argument to \c
  1223. .b .ip
  1224. appears
  1225. in the margin.
  1226. \&.lp
  1227. We can continue text...
  1228. .)b
  1229. produces as output:
  1230. .ip one
  1231. This is the first paragraph.
  1232. Notice how the first line of the resulting paragraph lines up
  1233. with the other lines in the paragraph.
  1234. .ip two
  1235. And here we are at the second paragraph already.
  1236. You may notice that the argument to
  1237. .b .ip
  1238. appears
  1239. in the margin.
  1240. .lp
  1241. We can continue text without starting a new indented
  1242. paragraph
  1243. by using the
  1244. .b .lp
  1245. request.
  1246. .pp
  1247. If you have spaces in the label of a
  1248. .b .ip
  1249. request,
  1250. you must use an
  1251. .q "unpaddable space"
  1252. instead of a regular space.
  1253. This is typed as a backslash character
  1254. (\c
  1255. .q \e )
  1256. followed by a space.
  1257. For example,
  1258. to print the label
  1259. .q "Part 1" ,
  1260. enter:
  1261. .(b
  1262. \&.ip "Part\e 1"
  1263. .)b
  1264. .pp
  1265. If a label of an indented paragraph
  1266. (that is, the argument to
  1267. .b .ip )
  1268. is longer than the space allocated for the label,
  1269. .b .ip
  1270. will begin a new line after the label.
  1271. For example,
  1272. the input:
  1273. .(b
  1274. \&.ip longlabel
  1275. This paragraph had a long label.
  1276. The first character of text on the first line
  1277. will not line up with the text on second and subsequent lines,
  1278. although they will line up with each other.
  1279. .)b
  1280. will produce:
  1281. .ip longlabel
  1282. This paragraph had a long label.
  1283. The first character of text on the first line
  1284. will not line up with the text on second and subsequent lines,
  1285. although they will line up with each other.
  1286. .pp
  1287. It is possible to change the size of the label
  1288. by using a second argument
  1289. which is the size of the label.
  1290. For example,
  1291. the above example could be done correctly
  1292. by saying:
  1293. .(b
  1294. \&.ip longlabel 10
  1295. .)b
  1296. which will make the paragraph indent
  1297. 10 spaces for this paragraph only.
  1298. If you have many paragraphs to indent
  1299. all the same amount,
  1300. use the
  1301. .i "number register"
  1302. .b ii .
  1303. For example, to leave one inch of space
  1304. for the label,
  1305. type:
  1306. .(b
  1307. \&.nr ii 1i
  1308. .)b
  1309. somewhere before the first call to
  1310. .b .ip .
  1311. Refer to the reference manual
  1312. for more information.
  1313. .pp
  1314. If
  1315. .b .ip
  1316. is used
  1317. with no argument at all
  1318. no hanging tag will be printed.
  1319. For example,
  1320. the input:
  1321. .(b
  1322. \&.ip [a]
  1323. This is the first paragraph of the example.
  1324. We have seen this sort of example before.
  1325. \&.ip
  1326. This paragraph is lined up with the previous paragraph,
  1327. but it has no tag in the margin.
  1328. .)b
  1329. produces as output:
  1330. .ip [a]
  1331. This is the first paragraph of the example.
  1332. We have seen this sort of example before.
  1333. .ip
  1334. This paragraph is lined up with the previous paragraph,
  1335. but it has no tag in the margin.
  1336. .pp
  1337. A special case of
  1338. .b .ip
  1339. is
  1340. .b .np ,
  1341. which automatically
  1342. numbers paragraphs sequentially from 1.
  1343. The numbering is reset at the next
  1344. .b .pp ,
  1345. .b .lp ,
  1346. or
  1347. .b .sh
  1348. (to be described in the next section)
  1349. request.
  1350. For example,
  1351. the input:
  1352. .(b
  1353. \&.np
  1354. This is the first point.
  1355. \&.np
  1356. This is the second point.
  1357. Points are just regular paragraphs
  1358. which are given sequence numbers automatically
  1359. by the .np request.
  1360. \&.pp
  1361. This paragraph will reset numbering by .np.
  1362. \&.np
  1363. For example,
  1364. we have reverted to numbering from one now.
  1365. .)b
  1366. generates:
  1367. .np
  1368. This is the first point.
  1369. .np
  1370. This is the second point.
  1371. Points are just regular paragraphs
  1372. which are given sequence numbers automatically
  1373. by the .np request.
  1374. .pp
  1375. This paragraph will reset numbering by .np.
  1376. .np
  1377. For example,
  1378. we have reverted to numbering from one now.
  1379. .pp
  1380. The
  1381. .b .bu
  1382. request gives lists of this sort that are identified with
  1383. bullets rather than numbers.
  1384. The paragraphs are also crunched together.
  1385. For example,
  1386. the input:
  1387. .(b
  1388. \&.bu
  1389. \&One egg yolk
  1390. \&.bu
  1391. \&One tablespoon cream or top milk
  1392. \&.bu
  1393. \&Salt, cayenne, and lemon juice to taste
  1394. \&.bu
  1395. \&A generous two tablespoonfuls of butter
  1396. .)b
  1397. produces\**:
  1398. .(f
  1399. \**By the way,
  1400. if you put the first three ingredients in a a heavy, deep pan
  1401. and whisk the ingredients madly over a medium flame
  1402. (never taking your hand off the handle of the pot)
  1403. until the mixture reaches the consistency of custard
  1404. (just a minute or two),
  1405. then mix in the butter off-heat,
  1406. you will have a wonderful Hollandaise sauce.
  1407. .)f
  1408. .bu
  1409. One egg yolk
  1410. .bu
  1411. One tablespoon cream or top milk
  1412. .bu
  1413. Salt, cayenne, and lemon juice to taste
  1414. .bu
  1415. A generous two tablespoonfuls of butter
  1416. .sh 2 "Section Headings"
  1417. .pp
  1418. Section numbers
  1419. (such as the ones used in this document)
  1420. can be automatically generated
  1421. using the
  1422. .b .sh
  1423. request.
  1424. You must tell
  1425. .b .sh
  1426. the
  1427. .i depth
  1428. of the section number
  1429. and a section title.
  1430. The depth
  1431. specifies how many numbers
  1432. are to appear
  1433. (separated by decimal points)
  1434. in the section number.
  1435. For example,
  1436. the section number
  1437. .b 4.2.5
  1438. has a depth of three.
  1439. .pp
  1440. Section numbers
  1441. are incremented
  1442. in a fairly intuitive fashion.
  1443. If you add a number
  1444. (increase the depth),
  1445. the new number starts out
  1446. at one.
  1447. If you subtract section numbers
  1448. (or keep the same number)
  1449. the final number is incremented.
  1450. For example,
  1451. the input:
  1452. .(b
  1453. \&.sh 1 "The Preprocessor"
  1454. \&.sh 2 "Basic Concepts"
  1455. \&.sh 2 "Control Inputs"
  1456. \&.sh 3
  1457. \&.sh 3
  1458. \&.sh 1 "Code Generation"
  1459. \&.sh 3
  1460. .)b
  1461. produces as output the result:
  1462. .(b
  1463. .b
  1464. 1.  The Preprocessor
  1465. 1.1.  Basic Concepts
  1466. 1.2.  Control Inputs
  1467. 1.2.1.
  1468. 1.2.2.
  1469. 2.  Code Generation
  1470. 2.1.1.
  1471. .)b
  1472. .pp
  1473. You can specify the section number to begin
  1474. by placing the section number after the section title,
  1475. using spaces instead of dots.
  1476. For example,
  1477. the request:
  1478. .(b
  1479. \&.sh 3 "Another section" 7 3 4
  1480. .)b
  1481. will begin the section numbered
  1482. .b 7.3.4 ;
  1483. all subsequent
  1484. .b .sh
  1485. requests will number relative to this number.
  1486. .pp
  1487. There are more complex features
  1488. which will cause each section to be indented
  1489. proportionally to the depth of the section.
  1490. For example, if you enter:
  1491. .(b
  1492. \&.nr si \c
  1493. .i N
  1494. .)b
  1495. each section will be indented by an amount
  1496. .i N .
  1497. .i N
  1498. must have a scaling factor attached,
  1499. that is, it must be of the form
  1500. .i Nx ,
  1501. where
  1502. .i x
  1503. is a character telling what units
  1504. .i N
  1505. is in.
  1506. Common values for
  1507. .i x
  1508. are
  1509. .b i
  1510. for inches,
  1511. .b c
  1512. for centimeters,
  1513. and
  1514. .b n
  1515. for
  1516. .i ens
  1517. (the width of a single character).
  1518. For example,
  1519. to indent each section
  1520. one-half inch,
  1521. type:
  1522. .(b
  1523. \&.nr si 0.5i
  1524. .)b
  1525. After this,
  1526. sections will be indented by
  1527. one-half inch
  1528. per level of depth in the section number.
  1529. For example,
  1530. this document was produced
  1531. using the request
  1532. .(b
  1533. \&.nr si 3n
  1534. .)b
  1535. at the beginning of the input file,
  1536. giving three spaces of indent
  1537. per section depth.
  1538. .pp
  1539. Section headers without automatically generated numbers
  1540. can be done using:
  1541. .(b
  1542. \&.uh "Title"
  1543. .)b
  1544. which will do a section heading,
  1545. but will put no number on the section.
  1546. .sh 2 "Parts of the Basic Paper"
  1547. .pp
  1548. There are some requests
  1549. which assist in setting up
  1550. papers.
  1551. The
  1552. .b .tp
  1553. request
  1554. initializes for a title page.
  1555. There are no headers or footers
  1556. on a title page,
  1557. and unlike other pages
  1558. you can space down
  1559. and leave blank space
  1560. at the top.
  1561. For example,
  1562. a typical title page might appear as:
  1563. .(b
  1564. \&.tp
  1565. \&.sp 2i
  1566. \&.(l C
  1567. THE GROWTH OF TOENAILS
  1568. IN UPPER PRIMATES
  1569. \&.sp
  1570. by
  1571. \&.sp
  1572. Frank N. Furter
  1573. \&.)l
  1574. \&.bp
  1575. .)b
  1576. .pp
  1577. The request
  1578. .b .th
  1579. sets up the environment
  1580. of the \*N processor
  1581. to do a thesis,
  1582. using the rules established at Berkeley.
  1583. It defines the correct headers and footers
  1584. (a page number in the upper right hand corner only),
  1585. sets the margins correctly,
  1586. and double spaces.
  1587. .pp
  1588. The
  1589. .b .+c \ \c
  1590. .i T
  1591. request can be used
  1592. to start chapters.
  1593. Each chapter is automatically numbered
  1594. from one,
  1595. and a heading is printed at the top of each chapter
  1596. with the chapter number
  1597. and the chapter name
  1598. .i T .
  1599. For example,
  1600. to begin a chapter called
  1601. .q Conclusions ,
  1602. use the request:
  1603. .(b
  1604. \&.+c "CONCLUSIONS"
  1605. .)b
  1606. which will produce,
  1607. on a new page,
  1608. the lines
  1609. .(b C
  1610. CHAPTER 5
  1611. CONCLUSIONS
  1612. .)b
  1613. with appropriate spacing for a thesis.
  1614. Also, the header is moved to the foot of the page
  1615. on the first page of a chapter.
  1616. Although the
  1617. .b .+c
  1618. request was not designed to work only with the
  1619. .b .th
  1620. request,
  1621. it is tuned for the format acceptable
  1622. for a PhD thesis
  1623. at Berkeley.
  1624. .pp
  1625. If the
  1626. title parameter
  1627. .i T
  1628. is omitted from the
  1629. .b .+c
  1630. request,
  1631. the result is a chapter with no heading.
  1632. This can also be used at the beginning
  1633. of a paper;
  1634. for example,
  1635. .b .+c
  1636. was used to generate page one
  1637. of this document.
  1638. .pp
  1639. Although
  1640. papers traditionally have the abstract,
  1641. table of contents,
  1642. and so forth at the front of the paper,
  1643. it is more convenient to format
  1644. and print them last
  1645. when using \*N.
  1646. This is so that index entries
  1647. can be collected and then printed
  1648. for the table of contents
  1649. (or whatever).
  1650. At the end of the paper,
  1651. issue the
  1652. .b ".++ P"
  1653. request,
  1654. which begins the preliminary part
  1655. of the paper.
  1656. After issuing this request,
  1657. the
  1658. .b .+c
  1659. request will begin a preliminary section
  1660. of the paper.
  1661. Most notably,
  1662. this prints the page number
  1663. restarted from one
  1664. in lower case Roman numbers.
  1665. .b .+c
  1666. may be used repeatedly
  1667. to begin different parts of the
  1668. front material
  1669. for example,
  1670. the abstract,
  1671. the table of contents,
  1672. acknowledgments,
  1673. list of illustrations,
  1674. etc.
  1675. The request
  1676. .b ".++ B"
  1677. may also be used
  1678. to begin the bibliographic section
  1679. at the end of the paper.
  1680. For example,
  1681. the paper might appear
  1682. as outlined in figure 2.
  1683. (In this figure,
  1684. comments begin with the sequence
  1685. .b \e" .)
  1686. .(z
  1687. .hl
  1688. .if t .in 0.5i
  1689. .if t .ta 2i
  1690. .if n .ta 3i
  1691. \&.th    \e" set for thesis mode
  1692. \&.fo \(aa\(aaDRAFT\(aa\(aa    \e" define footer for each page
  1693. \&.tp    \e" begin title page
  1694. \&.(l C    \e" center a large block
  1695. THE GROWTH OF TOENAILS
  1696. IN UPPER PRIMATES
  1697. \&.sp
  1698. by
  1699. \&.sp
  1700. Frank Furter
  1701. \&.)l    \e" end centered part
  1702. \&.+c INTRODUCTION    \e" begin chapter named "INTRODUCTION"
  1703. \&.(x t    \e" make an entry into index `t'
  1704. Introduction
  1705. \&.)x    \e" end of index entry
  1706. text of chapter one
  1707. \&.+c "NEXT CHAPTER"    \e" begin another chapter
  1708. \&.(x t    \e" enter into index `t' again
  1709. Next Chapter
  1710. \&.)x
  1711. text of chapter two
  1712. \&.+c CONCLUSIONS
  1713. \&.(x t
  1714. Conclusions
  1715. \&.)x
  1716. text of chapter three
  1717. \&.++ B    \e" begin bibliographic information
  1718. \&.+c BIBLIOGRAPHY    \e" begin another `chapter'
  1719. \&.(x t
  1720. Bibliography
  1721. \&.)x
  1722. text of bibliography
  1723. \&.++ P    \e" begin preliminary material
  1724. \&.+c "TABLE OF CONTENTS"
  1725. \&.xp t    \e" print index `t' collected above
  1726. \&.+c PREFACE    \e" begin another preliminary section
  1727. text of preface
  1728. .sp 2
  1729. .in 0
  1730. .ce
  1731. Figure 2.  Outline of a Sample Paper
  1732. .hl
  1733. .)z
  1734. .sh 2 "Equations and Tables"
  1735. .pp
  1736. Two special \*U programs exist
  1737. to format special types of material.
  1738. .b Eqn
  1739. and
  1740. .b neqn
  1741. set equations
  1742. for the phototypesetter
  1743. and \*N respectively.
  1744. .b Tbl
  1745. arranges to print
  1746. extremely pretty tables
  1747. in a variety of formats.
  1748. This document will only describe
  1749. the embellishments
  1750. to the standard features;
  1751. consult the reference manuals
  1752. for those processors
  1753. for a description of their use.
  1754. .pp
  1755. The
  1756. .b eqn
  1757. and
  1758. .b neqn
  1759. programs are described fully
  1760. in the document
  1761. .ul
  1762. Typesetting Mathematics \- User's Guide
  1763. by Brian W. Kernighan
  1764. and Lorinda L. Cherry.
  1765. Equations are centered,
  1766. and are kept on one page.
  1767. They are introduced by the
  1768. .b .EQ
  1769. request and terminated by the
  1770. .b .EN
  1771. request.
  1772. .pp
  1773. The
  1774. .b .EQ
  1775. request may take an
  1776. equation number as an
  1777. optional argument,
  1778. which is printed vertically centered
  1779. on the right hand side
  1780. of the equation.
  1781. If the equation becomes too long
  1782. it should be split
  1783. between two lines.
  1784. To do this, type:
  1785. .(b
  1786. \&.EQ (eq 34)
  1787. text of equation 34
  1788. \&.EN C
  1789. \&.EQ
  1790. continuation of equation 34
  1791. \&.EN
  1792. .)b
  1793. The
  1794. .b C
  1795. on the
  1796. .b .EN
  1797. request
  1798. specifies that the equation
  1799. will be continued.
  1800. .pp
  1801. The
  1802. .b tbl
  1803. program produces tables.
  1804. It is fully described
  1805. (including numerous examples)
  1806. in the document
  1807. .ul
  1808. Tbl \- A Program to Format Tables
  1809. by M. E. Lesk.
  1810. Tables begin with the
  1811. .b .TS
  1812. request
  1813. and end with the
  1814. .b .TE
  1815. request.
  1816. Tables are normally kept on a single page.
  1817. If you have a table which is too big
  1818. to fit on a single page,
  1819. so that you know it will extend
  1820. to several pages,
  1821. begin the table with the request
  1822. .b ".TS\ H"
  1823. and put the request
  1824. .b .TH
  1825. after the part of the table
  1826. which you want
  1827. duplicated at the top of every page
  1828. that the table is printed on.
  1829. For example, a table definition
  1830. for a long table might look like:
  1831. .ds TA \|\h'.4n'\v'-.2n'\s-4\zT\s0\v'.2n'\h'-.4n'\(ci\|
  1832. .if n .ds TA \ \o'-T'\ \"
  1833. .(b
  1834. \&.TS H
  1835. c s s
  1836. n n n.
  1837. THE TABLE TITLE
  1838. \&.TH
  1839. text of the table
  1840. \&.TE
  1841. .)b
  1842. .pp
  1843. .sh 2 "Two Column Output"
  1844. .pp
  1845. You can get two column output
  1846. automatically
  1847. by using the request
  1848. .b .2c .
  1849. This causes everything after it
  1850. to be output in two-column form.
  1851. The request
  1852. .b .bc
  1853. will start a new column;
  1854. it differs from
  1855. .b .bp
  1856. in that
  1857. .b .bp
  1858. may leave a totally blank column
  1859. when it starts a new page.
  1860. To revert to single column output,
  1861. use
  1862. .b .1c .
  1863. .sh 2 "Defining Macros"
  1864. .pp
  1865. A
  1866. .i macro
  1867. is a collection of requests and text
  1868. which may be used
  1869. by stating a simple request.
  1870. Macros begin with the line
  1871. .b ".de" \ \c
  1872. .i xx
  1873. (where
  1874. .i xx
  1875. is the name of the macro to be defined)
  1876. and end with the line consisting of two dots.
  1877. After defining the macro,
  1878. stating the line
  1879. .b . \c
  1880. .i xx
  1881. is the same as stating all the other lines.
  1882. For example,
  1883. to define a macro
  1884. that spaces 3 lines
  1885. and then centers the next input line,
  1886. enter:
  1887. .(b
  1888. \&.de SS
  1889. \&.sp 3
  1890. \&.ce
  1891. \&..
  1892. .)b
  1893. and use it by typing:
  1894. .(b
  1895. \&.SS
  1896. \&Title Line
  1897. (beginning of text)
  1898. .)b
  1899. .pp
  1900. Macro names may be one or two characters.
  1901. In order to avoid conflicts
  1902. with names in \-me,
  1903. always use upper case letters as names.
  1904. The only names to avoid are
  1905. .b TS ,
  1906. .b TH ,
  1907. .b TE ,
  1908. .b EQ ,
  1909. and
  1910. .b EN .
  1911. .sh 2 "Annotations Inside Keeps"
  1912. .pp
  1913. Sometimes you may want to put
  1914. a footnote
  1915. or index entry inside a keep.
  1916. For example,
  1917. if you want to maintain a
  1918. .q "list of figures"
  1919. you will want to do something like:
  1920. .(b
  1921. \&.(z
  1922. \&.(c
  1923. text of figure
  1924. \&.)c
  1925. \&.ce
  1926. Figure 5.
  1927. \&.(x f
  1928. Figure 5
  1929. \&.)x
  1930. \&.)z
  1931. .)b
  1932. which you may hope
  1933. will give you a figure
  1934. with a label
  1935. and an entry in the index
  1936. .b f
  1937. (presumably a list of figures index).
  1938. Unfortunately,
  1939. the
  1940. index entry
  1941. is read and interpreted
  1942. when the keep is read,
  1943. not when it is printed,
  1944. so the page number in the index is likely to be wrong.
  1945. The solution is to use the magic string
  1946. .b \e!
  1947. at the beginning of all the lines dealing with the index.
  1948. In other words,
  1949. you should use:
  1950. .(b
  1951. \&.(z
  1952. \&.(c
  1953. Text of figure
  1954. \&.)c
  1955. \&.ce
  1956. Figure 5.
  1957. \e!.(x f
  1958. \e!Figure 5
  1959. \e!.)x
  1960. \&.)z
  1961. .)b
  1962. which will defer the processing of the index
  1963. until the figure is output.
  1964. This will guarantee
  1965. that the page number in the index
  1966. is correct.
  1967. The same comments apply
  1968. to
  1969. blocks
  1970. (with
  1971. .b .(b
  1972. and
  1973. .b .)b )
  1974. as well.
  1975. .sh 1 "\*T and the Photosetter"
  1976. .pp
  1977. With a little care,
  1978. you can prepare
  1979. documents that
  1980. will print nicely
  1981. on either a regular terminal
  1982. or when phototypeset
  1983. using the \*T formatting program.
  1984. .sh 2 "Fonts"
  1985. .pp
  1986. A
  1987. .i font
  1988. is a style of type.
  1989. There are three fonts
  1990. that are available simultaneously,
  1991. Times Roman,
  1992. Times Italic,
  1993. and Times Bold,
  1994. plus the special math font.
  1995. The normal font is Roman.
  1996. Text which would be underlined in \*N
  1997. with the
  1998. .b .ul
  1999. request
  2000. is set in italics
  2001. in \*T.
  2002. .pp
  2003. There are ways of switching between fonts.
  2004. The requests
  2005. .b .r ,
  2006. .b .i ,
  2007. and
  2008. .b .b
  2009. switch to Roman,
  2010. italic,
  2011. and bold fonts respectively.
  2012. You can set a single word
  2013. in some font
  2014. by typing (for example):
  2015. .(b
  2016. \&.i word
  2017. .)b
  2018. which will set
  2019. .i word
  2020. in italics
  2021. but does not affect the surrounding text.
  2022. In \*N,
  2023. italic and bold text
  2024. is underlined.
  2025. .pp
  2026. Notice that if you are setting more than one word
  2027. in whatever font,
  2028. you must surround that word with double quote marks
  2029. (`\|"\|')
  2030. so that it will appear to the \*N processor as a single word.
  2031. The quote marks will not appear in the formatted text.
  2032. If you do want a quote mark to appear,
  2033. you should quote the entire string
  2034. (even if a single word),
  2035. and use
  2036. .i two
  2037. quote marks where you want one to appear.
  2038. For example,
  2039. if you want to produce the text:
  2040. .(b
  2041. .i """Master Control\|"""
  2042. .)b
  2043. in italics, you must type:
  2044. .(b
  2045. \&.i """Master Control\e|"""
  2046. .)b
  2047. The
  2048. .b \e|
  2049. produces a very narrow space
  2050. so that the
  2051. .q l
  2052. does not overlap the quote sign in \*T,
  2053. like this:
  2054. .(b
  2055. .i """Master Control"""
  2056. .)b
  2057. .pp
  2058. There are also several
  2059. .q pseudo-fonts
  2060. available.
  2061. The input:
  2062. .(b
  2063. \&.(b
  2064. \&.u underlined
  2065. \&.bi "bold italics"
  2066. \&.bx "words in a box"
  2067. \&.)b
  2068. .)b
  2069. generates
  2070. .(b
  2071. .u underlined
  2072. .bi "bold italics"
  2073. .bx "words in a box"
  2074. .)b
  2075. In \*N these all just underline
  2076. the text.
  2077. Notice that pseudo font requests
  2078. set only the single parameter in the pseudo font;
  2079. ordinary font requests will begin setting all text
  2080. in the special font
  2081. if you do not provide a parameter.
  2082. No more than one word
  2083. should appear
  2084. with these three font requests
  2085. in the middle of lines.
  2086. This is because
  2087. of the way \*T justifies text.
  2088. For example,
  2089. if you were to issue the requests:
  2090. .(b
  2091. \&.bi "some bold italics"
  2092. and
  2093. \&.bx "words in a box"
  2094. .)b
  2095. in the middle of a line
  2096. \*T would produce
  2097. .bi "some bold italics"
  2098. and
  2099. .bx "words in a box" ,\c
  2100. .if t \p
  2101. .if n \& \"
  2102. .if t which I think you will agree does not look good.
  2103. .if n which would look really lousy in \*T.
  2104. .pp
  2105. The second parameter
  2106. of all font requests
  2107. is set in the original font.
  2108. For example,
  2109. the font request:
  2110. .(b
  2111. \&.b bold face
  2112. .)b
  2113. generates
  2114. .q bold
  2115. in bold font,
  2116. but sets
  2117. .q face
  2118. in the font of the surrounding text,
  2119. resulting in:
  2120. .(b
  2121. .b bold face.
  2122. .)b
  2123. To set the two words
  2124. .b bold
  2125. and
  2126. .b face
  2127. both in
  2128. .b "bold face" ,
  2129. type:
  2130. .(b
  2131. \&.b "bold face"
  2132. .)b
  2133. .pp
  2134. You can mix fonts in a word by using the
  2135. special sequence
  2136. .b \ec
  2137. at the end of a line
  2138. to indicate
  2139. .q "continue text processing" ;
  2140. this allows input lines
  2141. to be joined together
  2142. without a space between them.
  2143. For example, the input:
  2144. .(b
  2145. \&.u under \ec
  2146. \&.i italics
  2147. .)b
  2148. generates
  2149. .u under \c
  2150. .i italics ,
  2151. but if we had typed:
  2152. .(b
  2153. \&.u under
  2154. \&.i italics
  2155. .)b
  2156. the result would have been
  2157. .u under
  2158. .i italics
  2159. as two words.
  2160. .sh 2 "Point Sizes"
  2161. .pp
  2162. The phototypesetter
  2163. supports different sizes of type,
  2164. measured in points.
  2165. The default point size
  2166. is 10 points
  2167. for most text,
  2168. 8 points for footnotes.
  2169. To change the pointsize,
  2170. type:
  2171. .(b
  2172. \&.sz \c
  2173. .i +N
  2174. .)b
  2175. where
  2176. .i N
  2177. is the size wanted in points.
  2178. The
  2179. .i "vertical spacing"
  2180. (distance between the bottom of most letters
  2181. (the
  2182. .i baseline )
  2183. between adjacent lines)
  2184. is set to be proportional
  2185. to the type size.
  2186. .pp
  2187. These pointsize changes are
  2188. .i temporary !!!
  2189. For example,
  2190. to reset the pointsize of basic text to twelve point, use:
  2191. .(b
  2192. \&.nr pp 12
  2193. \&.nr sp 12
  2194. \&.nr tp 12
  2195. .)b
  2196. to reset the default pointsize of
  2197. paragraphs,
  2198. section headers,
  2199. and titles respectively.
  2200. If you only want to set the names of sections in a larger pointsize,
  2201. use:
  2202. .(b
  2203. \&.nr sp 11
  2204. .)b
  2205. alone \*- this sets section titles
  2206. (e.g.,
  2207. .b "Point Sizes"
  2208. above)
  2209. in a larger font than the default.
  2210. .pp
  2211. A single word or phrase can be set in a smaller pointsize
  2212. than the surrounding text
  2213. using the
  2214. .b .sm
  2215. request.
  2216. This is especially convenient for words that are all capitals,
  2217. due to the optical illusion that makes them look even larger
  2218. than they actually are.
  2219. For example:
  2220. .(b
  2221. \&.sm UNIX
  2222. .)b
  2223. prints as
  2224. .sm UNIX
  2225. rather than
  2226. UNIX.
  2227. .pp
  2228. Warning:
  2229. changing point sizes
  2230. on the phototypesetter
  2231. is a slow mechanical operation.
  2232. On laser printers it may require loading new fonts.
  2233. Size changes
  2234. should be considered carefully.
  2235. .sh 2 "Quotes"
  2236. .pp
  2237. It is conventional when using
  2238. the typesetter to
  2239. use pairs of grave and acute accents
  2240. to generate double quotes,
  2241. rather than the
  2242. double quote character
  2243. (`\|"\|').
  2244. This is because it looks better
  2245. to use grave and acute accents;
  2246. for example, compare
  2247. "quote" to
  2248. ``quote''.
  2249. .pp
  2250. In order to make quotes compatible
  2251. between the typesetter and terminals,
  2252. you may use the sequences
  2253. .b \e*(lq
  2254. and
  2255. .b \e*(rq
  2256. to stand for the left and right quote
  2257. respectively.
  2258. These both appear as
  2259. .b """"
  2260. on most terminals,
  2261. but are typeset as
  2262. .b ``
  2263. and
  2264. .b ''
  2265. respectively.
  2266. For example,
  2267. use:
  2268. .(b
  2269. \e*(lqSome things aren\(aat true
  2270. even if they did happen.\e*(rq
  2271. .)b
  2272. to generate the result:
  2273. .(b
  2274. .q "Some things aren't true even if they did happen."
  2275. .)b
  2276. As a shorthand,
  2277. the special font request:
  2278. .(b
  2279. \&.q "quoted text"
  2280. .)b
  2281. will generate
  2282. .q "quoted text" .
  2283. Notice that you must surround
  2284. the material to be quoted
  2285. with double quote marks
  2286. if it is more than one word.
  2287. .sh 0
  2288. .sp 1i
  2289. .b Acknowledgments
  2290. .pp
  2291. I would like to thank
  2292. Bob Epstein,
  2293. Bill Joy,
  2294. and Larry Rowe
  2295. for having the courage
  2296. to use the \-me macros
  2297. to produce non-trivial papers
  2298. during the development stages;
  2299. Ricki Blau,
  2300. Pamela Humphrey,
  2301. and Jim Joyce
  2302. for their help with the documentation phase;
  2303. peter kessler
  2304. for numerous complaints years after I was
  2305. .q done
  2306. with this project,
  2307. most accompanied by fixes
  2308. (hence forcing me to fix several small bugs);
  2309. and the plethora of people who have contributed ideas
  2310. and have given support for the project.
  2311. .sp 1i
  2312. This document was
  2313. .if n \*N'ed
  2314. .if t \*T'ed
  2315. on \*(td
  2316. and applies to version
  2317. \*(MO
  2318. of the \-me macros.
  2319.