home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / 1_1_contri / usd / 27_eqnguid / g2 < prev    next >
Encoding:
Text File  |  1986-05-22  |  9.1 KB  |  533 lines

  1. .\"    @(#)g2    6.1 (Berkeley) 5/22/86
  2. .\"
  3. .SC "Size and Font Changes"
  4. .PP
  5. By default, equations are set in 10-point type (the same size as this guide),
  6. with standard mathematical conventions
  7. to determine what characters are in roman and what in italic.
  8. Although 
  9. .UC EQN
  10. makes a valiant attempt to use
  11. esthetically pleasing sizes and fonts,
  12. it is not perfect.
  13. To change sizes and fonts, use
  14. .ul
  15. size n
  16. and
  17. .ul
  18. roman, italic, 
  19. .ul
  20. bold
  21. and
  22. .ul
  23. fat.
  24. Like
  25. .ul
  26. sub
  27. and
  28. .ul
  29. sup,
  30. size
  31. and font changes affect only the thing that follows
  32. them, and revert to the normal situation
  33. at the end of it. Thus
  34. .P1
  35. bold x y
  36. .P2
  37. is
  38. .EQ
  39. bold x y
  40. .EN
  41. and
  42. .P1
  43. size 14 bold x = y +
  44.    size 14 {alpha + beta}
  45. .P2
  46. gives
  47. .EQ
  48. size 14 bold x = y +
  49.    size 14 {alpha + beta}
  50. .EN
  51. As always, you can use braces if you want to affect something
  52. more complicated than a single letter.
  53. For example, you can change the size of an entire equation by
  54. .P1
  55. size 12 { ... }
  56. .P2
  57. .PP
  58. Legal sizes which may follow 
  59. .ul
  60. size
  61. are
  62. 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 36.
  63. You can also change the size
  64. .ul
  65. by
  66. a given amount;
  67. for example, you can say
  68. .ul
  69. size~+2
  70. to make the size two points bigger,
  71. or
  72. .ul
  73. size~\(mi3
  74. to make it three points smaller.
  75. This has the advantage that you don't have
  76. to know what the current size is.
  77. .PP
  78. If you are using fonts other than roman, italic and bold,
  79. you can say
  80. .ul
  81. font X
  82. where 
  83. .ul
  84. X
  85. is a one character
  86. .UC TROFF
  87. name or number for the font.
  88. Since
  89. .UC EQN
  90. is tuned for roman, italic and bold,
  91. other fonts may not give quite as good an appearance.
  92. .PP
  93. The
  94. .ul
  95. fat 
  96. operation takes the current font and widens it by overstriking:
  97. .ul
  98. fat\ grad
  99. is
  100. $fat grad$ and
  101. .ul
  102. fat {x sub i}
  103. is
  104. $fat {x sub i}$.
  105. .PP
  106. If an entire document is to be in a non-standard size
  107. or font, it is a severe nuisance
  108. to have to write out a size and font change for each
  109. equation.
  110. Accordingly, you can set a ``global'' size or font
  111. which thereafter affects all equations.
  112. At the beginning of any equation, you might say, for instance,
  113. .P1
  114. ^EQ
  115. gsize 16
  116. gfont R
  117.  ...
  118. ^EN
  119. .P2
  120. to set the size to 16 and the font to roman thereafter.
  121. In place of R, you can use any of the
  122. .UC TROFF
  123. font names.
  124. The size after
  125. .ul
  126. gsize
  127. can be a relative change with + or \(mi.
  128. .PP
  129. Generally,
  130. .ul
  131. gsize
  132. and
  133. .ul
  134. gfont
  135. will appear at the beginning of a document
  136. but they can also appear
  137. thoughout a document: the global font and size
  138. can be changed as often as needed.
  139. For example, in a footnote\(dd
  140. .FS
  141. \(ddLike this one, in which we have a
  142. $gsize -2$few random
  143. expressions like $x sub i$ and $pi sup 2$.
  144. The sizes for these were set by the command
  145. .ul
  146. gsize~\(mi2.
  147. .FE $gsize +2$
  148. you will typically want the size of equations to match
  149. the size of the footnote text, which is two points smaller
  150. than the main text.
  151. Don't forget to reset the global size
  152. at the end of the footnote.
  153. .SC "Diacritical Marks"
  154. .PP
  155. To get funny marks on top of letters,
  156. there are several words:
  157. .P1
  158. .tr ^^
  159. .tr ~~
  160. .ta 1i
  161. x dot    $x dot$
  162. x dotdot    $x dotdot$
  163. x hat    $x hat$
  164. x tilde    $x tilde$
  165. x vec    $x vec$
  166. x dyad    $x dyad$
  167. x bar    $x bar$
  168. x under    $x under$
  169. .P2
  170. The diacritical mark is placed at the right height.
  171. The 
  172. .ul
  173. bar
  174. and
  175. .ul
  176. under
  177. are made the right length for the entire construct,
  178. as in $x+y+z bar$;
  179. other marks are centered.
  180. .SC "Quoted Text"
  181. .PP
  182. Any input entirely within quotes (\|"..."\|)
  183. is not subject to any of the font changes and spacing
  184. adjustments normally done by the equation setter.
  185. This provides a way to do your own spacing and adjusting if needed:
  186. .P1
  187. italic "sin(x)" + sin (x)
  188. .P2
  189. is
  190. .EQ
  191. italic "sin(x)" + sin (x)
  192. .EN
  193. .PP
  194. Quotes are also used to get braces and other
  195. .UC EQN
  196. keywords printed:
  197. .P1
  198. "{ size alpha }"
  199. .P2
  200. is
  201. .EQ
  202. "{ size alpha }"
  203. .EN
  204. and
  205. .P1
  206. roman "{ size alpha }"
  207. .P2
  208. is
  209. .EQ
  210. roman "{ size alpha }"
  211. .EN
  212. .PP
  213. The construction "" is often used as a place-holder
  214. when grammatically
  215. .UC EQN
  216. needs something, but you don't actually want anything in your output.
  217. For example, to make
  218. $"" sup 2 roman He$,
  219. you can't just type
  220. .ul
  221. sup 2 roman He
  222. because a
  223. .ul
  224. sup
  225. has to be a superscript
  226. .ul
  227. on
  228. something.
  229. Thus you must say
  230. .P1
  231. "" sup 2 roman He
  232. .P2
  233. .PP
  234. To get a literal quote
  235. use ``\\"''.
  236. .UC TROFF 
  237. characters like
  238. .ul
  239. \e(bs
  240. can appear unquoted, but more complicated things like
  241. horizontal and vertical motions with
  242. .ul
  243. \eh
  244. and
  245. .ul
  246. \ev
  247. should
  248. always
  249. be quoted.
  250. (If you've never heard of
  251. .ul
  252. \\h
  253. and
  254. .ul
  255. \\v,
  256. ignore this section.)
  257. .SC "Lining Up Equations"
  258. .PP
  259. Sometimes it's necessary to line up a series of equations
  260. at some horizontal position, often at an equals sign.
  261. This is done with two operations called
  262. .ul
  263. mark
  264. and
  265. .ul
  266. lineup.
  267. .PP
  268. The word
  269. .ul
  270. mark
  271. may appear once at any place in an equation.
  272. It remembers the horizontal position where it appeared.
  273. Successive equations can contain one occurrence of the word
  274. .ul
  275. lineup.
  276. The place where
  277. .ul
  278. lineup
  279. appears is made to line up
  280. with the place marked by the previous
  281. .ul
  282. mark
  283. if at all possible.
  284. Thus, for example,
  285. you can say
  286. .P1
  287. ^EQ I
  288. x+y mark = z
  289. ^EN
  290. ^EQ I
  291. x lineup = 1
  292. ^EN
  293. .P2
  294. to produce
  295. .EQ I
  296. x+y mark = z
  297. .EN
  298. .EQ I
  299. x lineup = 1
  300. .EN
  301. For reasons too complicated to talk about,
  302. when you use
  303. .UC EQN
  304. and
  305. `\(mims',
  306. use either
  307. .UC .EQ\ I
  308. or
  309. .UC .EQ\ L .
  310. mark
  311. and
  312. .ul
  313. lineup
  314. don't work with centered equations.
  315. Also bear in mind that 
  316. .ul
  317. mark
  318. doesn't look ahead;
  319. .P1
  320. x mark =1
  321.  ...
  322. x+y lineup =z
  323. .P2
  324. isn't going to work, because there isn't room
  325. for the
  326. .ul
  327. x+y
  328. part after the
  329. .ul
  330. mark
  331. remembers where the
  332. .ul
  333. x
  334. is.
  335. .SC "Big Brackets, Etc."
  336. .PP
  337. .tr ~
  338. To get big brackets [~],
  339. braces {~}, parentheses (~), and bars |~|
  340. around things, use the
  341. .ul
  342. left 
  343. and
  344. .ul
  345. right
  346. commands:
  347. .tr ~~
  348. .P1
  349. left { a over b + 1 right }
  350.  ~=~ left ( c over d right )
  351.  + left [ e right ]
  352. .P2
  353. is
  354. .EQ
  355. left { a over b + 1 right } ~=~ left ( c over d right ) + left [ e right ]
  356. .EN
  357. The resulting brackets are made big enough to cover whatever they enclose.
  358. Other characters can be used besides these,
  359. but the are not likely to look very good.
  360. One exception is the
  361. .ul
  362. floor
  363. and
  364. .ul
  365. ceiling 
  366. characters:
  367. .P1
  368. left floor x over y right floor 
  369. <= left ceiling a over b right ceiling
  370. .P2
  371. produces
  372. .EQ
  373. left floor x over y right floor 
  374. <= left ceiling a over b right ceiling
  375. .EN
  376. .PP
  377. Several warnings about brackets are in order.
  378. First, braces are typically bigger than brackets and parentheses,
  379. because they are made up of three, five, seven, etc., pieces,
  380. while brackets can be made up of two, three, etc.
  381. Second, big left and right parentheses often look poor,
  382. because the character set is poorly designed.
  383. .PP
  384. The
  385. .ul
  386. right
  387. part may be omitted:
  388. a ``left something'' need not have a
  389. corresponding 
  390. ``right
  391. something''.
  392. If the
  393. .ul
  394. right
  395. part is omitted,
  396. put braces around the thing you want the left bracket
  397. to encompass.
  398. Otherwise, the resulting brackets may be too large.
  399. .PP
  400. If you want to omit the
  401. .ul
  402. left
  403. part, things are more complicated,
  404. because technically you can't have a
  405. .ul
  406. right
  407. without a corresponding
  408. .ul
  409. left.
  410. Instead you have to say
  411. .P1
  412. left "" ..... right )
  413. .P2
  414. for example.
  415. The
  416. .ul
  417. left ""
  418. means a ``left nothing''.
  419. This satisfies the rules without hurting your output.
  420. .SC "Piles"
  421. .PP
  422. There is a general facility for making vertical piles
  423. of things; it comes in several flavors.
  424. For example:
  425. .P1
  426. .tr ~~
  427. A ~=~ left [
  428.   pile { a above b above c }
  429.   ~~ pile { x above y above z }
  430. right ]
  431. .P2
  432. will make
  433. .EQ
  434. A ~=~ left [
  435. pile { a above b above c } ~~ pile { x above y above z }
  436. right ]
  437. .EN
  438. The elements of the pile (there can be as many as you want)
  439. are centered one above another, at the right height for
  440. most purposes.
  441. The keyword
  442. .ul
  443. above
  444. is used to separate the pieces;
  445. braces are used around the entire list.
  446. The elements of a pile can be as complicated as needed, even containing more piles.
  447. .PP
  448. Three other forms of pile exist:
  449. .ul
  450. lpile
  451. makes a pile with the elements left-justified;
  452. .ul
  453. rpile
  454. makes a right-justified pile;
  455. and
  456. .ul
  457. cpile
  458. makes a centered pile, just like
  459. .ul
  460. pile.
  461. The vertical spacing between the pieces
  462. is somewhat larger for
  463. .ul
  464. l-,
  465. .ul
  466. r-
  467. and
  468. .ul
  469. cpiles
  470. than it is for ordinary piles.
  471. .P1 2
  472. roman sign (x)~=~ 
  473. left {
  474.    lpile {1 above 0 above -1} 
  475.    ~~ lpile
  476.     {if~x>0 above if~x=0 above if~x<0}
  477. .P2
  478. makes
  479. .EQ
  480. roman sign (x)~=~ 
  481. left {
  482.    lpile {1 above 0 above -1} 
  483.    ~~ lpile
  484.     {if~x>0 above if~x=0 above if~x<0}
  485. .EN
  486. Notice the left brace
  487. without a matching right one.
  488. .SC Matrices
  489. .PP
  490. It is also possible to make matrices.
  491. For example, to make
  492. a neat array like
  493. .EQ
  494. matrix {
  495.   ccol { x sub i above y sub i }
  496.   ccol { x sup 2 above y sup 2 }
  497. }
  498. .EN
  499. you have to type
  500. .P1
  501. matrix {
  502.   ccol { x sub i above y sub i }
  503.   ccol { x sup 2 above y sup 2 }
  504. }
  505. .P2
  506. This produces a matrix with
  507. two centered columns.
  508. The elements of the columns are then listed just as for a pile,
  509. each element separated by the word
  510. .ul
  511. above.
  512. You can also use
  513. .ul
  514. lcol
  515. or
  516. .ul
  517. rcol
  518. to left or right adjust columns.
  519. Each column can be separately adjusted,
  520. and there can be as many columns as you like.
  521. .PP
  522. The reason for using a matrix instead of two adjacent piles, by the way,
  523. is that if the elements of the piles don't all have the same height,
  524. they won't line up properly.
  525. A matrix forces them to line up,
  526. because it looks at the entire structure before deciding what
  527. spacing to use.
  528. .PP
  529. A word of warning about matrices _
  530. .ul
  531. each column must have the same number of elements in it.
  532. The world will end if you get this wrong.
  533.