home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d583 / aroff.lha / ARoff / Sources / aroffenglish.doc.src < prev    next >
Text File  |  1992-01-04  |  16KB  |  524 lines

  1. .ll 76
  2. .lt 76
  3. .pl 66
  4. .nh
  5. \" section number (register)
  6. .nr PN 0 1
  7. \"------------- section start
  8. .de PR
  9. .nf
  10. .ne 5
  11. .fs u1
  12. \\n+(PN. \\$1
  13. .fs n
  14. .fi
  15.  
  16. ..
  17. \"------- request description
  18. .de RQ
  19.  
  20. .ne 3
  21. .ti -4
  22. \\$1  \\$2
  23. .br
  24. Syntax\\ \\ \\ \\ \\ :\\ \\$1 \\$3
  25. .br
  26. Description:\\ \\
  27. ..
  28. .de SP
  29. .br
  30. .ti -16
  31. ..
  32. \" page header
  33. .de HD
  34. .ls 2
  35. .tl "ARoff"User's Reference Manual"Page \\n(pn"
  36. .ls 1
  37. ..
  38. \"-------- start of important note
  39. .de NI
  40.  
  41. .ne 4
  42. .ce
  43. CAUTION:
  44.  
  45. .in 8
  46. .ll -8
  47. ..
  48. \"---------- end of important note
  49. .de FN
  50.  
  51. .in
  52. .ll
  53. ..
  54. .wh 1 HD
  55. \"--------------------------- TEXT
  56.  
  57. .PR Foreword
  58. .ti +8
  59. This manual describes release 1.12 of the utility ARoff. This program is
  60. freeware, and permission is granted to freely copy and distribute it
  61. by all mediums, provided no charge or fee is ask for, and no modification
  62. is done to this program. ARoff is copyright (c) 1991 by Denis GOUNELLE, any
  63. commercial usage or selling of this program, without written authorization,
  64. is ABSOLUTLY FORBIDDEN.
  65. .ti +8
  66. In spite of several tests, no warranty is made that there's no errors in
  67. ARoff. YOU USE THIS PROGRAM AT YOUR OWN RISKS. In no event will I be liable
  68. for any damage, direct or indirect, resulting of the use of ARoff.
  69.  
  70. .PR Introduction
  71. .ti +8
  72. ARoff is a complete and powerful program for text formatting, with
  73. registers, macros, etc.: it takes as input a source file including both
  74. text and formatting commands, to produce a formatted output file as
  75. you required.
  76. .ti +8
  77. You can look upon ARoff as a portage of "nroff" utility you find usually
  78. under UNIX system. However, both programs are fairly different, and there
  79. is surely a lot of things ARoff doesn't know.
  80.  
  81. .ti +8
  82. ARoff is invoked via the following CLI command:
  83.  
  84. .ce
  85. aroff [-wstack] [-l] <filename>
  86.  
  87. where <filename> is the name of file to process. If you specify "-" for
  88. <filename>, ARoff will use the standard input.
  89. .NI
  90. The ARoff current version doesn't work properly if you use it
  91. as a pipe output (e.g. "cat toto | aroff -").
  92. .FN
  93. .br
  94. .ti +8
  95. The -w option allows you to increase the size of the internal stack used
  96. by ARoff. Default size has 256 locations (each of 8 bytes), but sometimes
  97. this isn't enough; in this case, you'll obtain the following message "Error
  98. 2 in file pile.c at line 58". For instance, in order to increase the stack
  99. size to 300 locations, invoke ARoff by "aroff -w300 <filename>".
  100. .ti +8
  101. If specified, the -l option tells ARoff to load the file in memory before
  102. processing it. On an Amiga, this can make the programme two or three times
  103. faster, but of course you'll need to have more free memory.
  104.  
  105. .ti +8
  106. If you invoke ARoff without arguments (or with bad arguments), you'll
  107. obtain a message telling you about the program version and the right syntax
  108. for the arguments.
  109.  
  110. .PR How\ does\ it\ work
  111. .ti +8
  112. Like "nroff", ARoff concatenates automatically the text lines in order to
  113. obtain a fairly long line. This is called "filling mode", and means a text
  114. is seen like a words suite that ARoff just copies until it reaches an output
  115. line or until you cause a "line break" (either by a command or by an empty
  116. line). The following commands will cause a line break:
  117. .nf
  118. .in 16
  119.  
  120. bp\tnew page
  121. br\tnew line
  122. ce\tcenters the following line(s)
  123. fi\tenables the filling mode
  124. nf\tdisables the filling mode
  125. sp\tline skip
  126. in\tindentation
  127. ti\ttemporary indentation
  128.  
  129. .in
  130. .fi
  131. .ti +8
  132. Once a line has been built, ARoff "adjusts" it according to the
  133. mode you specified: centering, justification, left or right alignement.
  134. As a result of this you'll have an output line.
  135. .ti +8
  136. The formatting commands (also called "requests") must be given on a separate
  137. line beginning by a period, followed by the request name (exactly two
  138. characters), followed by the optional command arguments. For using one of
  139. the above commands without causing a line break, specify a "quote" instead
  140. of a period character (e.g.: "'ti -3" in place of ".ti -3").
  141.  
  142. .PR List\ of\ main\ requests
  143. .ti +8
  144. In all that follows, N is a positive integer number and ±N is either a
  145. positive integer number (for specifying a definite value), or the plus sign
  146. followed by a positive integer number (for specifying an increment), or the
  147. minus sign followed by a positive integer number (for specifying a
  148. decrement).
  149. .in 8
  150. .RQ ab ABort message
  151. displays the specified message, flushes the output buffer and ends.
  152. .RQ ad ADjust [mode]
  153. modifies the adjusting mode. If no argument is specified, ARoff
  154. will re-use the previous value. Here are the values of mode:
  155. .nf
  156.  
  157. \tl\tleft justification
  158. \tr\tright justification
  159. \tc\tcentering
  160. \tb\talignement
  161. .fi
  162. .RQ bp Begin\ Page [N]
  163. causes a page break. Next page number will be N, if an argument is
  164. specified.
  165. .RQ br BReak
  166. causes a line break. Current line filling is stopped, and the line
  167. is printed without adjusting.
  168. .RQ ce CEnter [N]
  169. centers the following line, or the following N lines if you specify an
  170. argument.
  171. .RQ ex EXit
  172. flushes the output buffer and ends.
  173. .RQ fi FIll
  174. enables the filling mode.
  175. .RQ fs Font\ Style style
  176. changes font style. The argument is any combination of:
  177. .nf
  178.  
  179. \tb0\tboldface off
  180. \tb1\tboldface on
  181. \ti0\titalics off
  182. \ti1\titalic on
  183. \tu0\tunderlined off
  184. \tu1\tunderlined on
  185. \tn\tnormal characters
  186. .fi
  187. .RQ in INdent [±N]
  188. changes the indentation. If no argument is specified, ARoff will re-use
  189. the previous value.
  190. .RQ ll Line\ Length [±N]
  191. changes the output lines length (included indentation). If no argument is
  192. specified, ARoff will re-use the previous value.
  193. .RQ ls Line\ Spacing [±N]
  194. changes the output lines spacing. If no argument is specified, ARoff
  195. will re-use the previous value.
  196. .RQ lt Title\ Length [±N]
  197. changes the title length (see "tl" request). If no argument is specified,
  198. ARoff will re-use the previous value.
  199. .RQ na No\ Adjusting
  200. disables the output lines adjusting.
  201. .RQ ne NEed [N]
  202. causes a page break if you have less than N lines before the page ending
  203. (1 line if no argument is specified) or before the next trap.
  204. .RQ nf No\ Filling
  205. disables the filling mode.
  206. .RQ nm line\ NuMbering [±num\ int\ spc\ idt]
  207. enables the line numbering. Numbering begins at number "num" and will occur
  208. every "int" lines (by default, 1 line). You'll have "spc" spaces (by
  209. default, 1 space) between the numbers and the text, and "idt" spaces (by
  210. default, 0 spaces) between the margin and the numbers. Without arguments,
  211. numbering is disabled. A non-numeric argument is regarded as a missing one.
  212. A missing argument is not modified.
  213. .RQ nn No\ line\ Numbering [N]
  214. no numbering is made for the following N lines, or for the following line,
  215. if no argument is specified.
  216. .RQ pl Page\ Length [±N]
  217. changes the number of lines per page. If no argument is specified, ARoff
  218. will re-use the default value.
  219. .RQ pn Page\ Number ±N
  220. changes the next page number.
  221. .RQ po Page\ Offset [±N]
  222. changes the left margin on all the document (this is different from
  223. indenting). If no argument is specified, ARoff will re-use the previous
  224. value.
  225. .RQ so SOurce filename
  226. inserts the content of the file you specified.
  227. .RQ sp SPace [N]
  228. inserts N empty lines (by default, 1 line).
  229. .RQ ta TAbulation N
  230. sets tab marks at columns 1, N+1, 2N+1, etc..
  231. .RQ tc Tab\ Character [c]
  232. tells what character will be used to expand tabs. If no argument is
  233. specified, ARoff will re-use the previous value.
  234. .RQ ti Temporary\ Indent N
  235. indents the following line by the specified value.
  236. .RQ tl TitLe 'a'b'c'
  237. prints a text into three parts: "a" will be left aligned, "b" will be
  238. centered, and "c" right aligned. You can use any character for separating
  239. these three parts; moreover, one or two parts may be empty.
  240. .RQ tm Terminal\ Message message
  241. displays the specified message.
  242. .RQ tr TRanslate abcd...
  243. tells you'll have a conversion on your output: 'a' will be changed
  244. into 'b', 'c' into 'd', etc.. If you specify an odd number of characters,
  245. the last one will be changed into a space.
  246. .RQ ts Title\ Style str
  247. speficies title style. "str" is any combination of:
  248.  
  249. .nf
  250. \tb\tboldface
  251. \ti\titalics
  252. \tu\tunderlined
  253. .fi
  254. .in
  255.  
  256. .PR Line\ format
  257. .ti +8
  258. ARoff recognizes the following constructions:
  259.  
  260. .fi
  261. .in 24
  262. .SP
  263. \\t\t\ttabulation
  264. .SP
  265. \\<space>\tfixed space
  266. .SP
  267. \\<newline>\tignored new-line
  268. .SP
  269. \\"\t\trest of this line is a comment
  270. .SP
  271. \\!\t\trest of this line must be read (but not interpreted) and written on
  272. output without any adjusting; this command can be used only in the
  273. beginning of an input line
  274. .SP
  275. \\n\t\tinserts the value of a register
  276. .SP
  277. \\*\t\tinserts the value of a string
  278. .in
  279.  
  280. It is very strongly recommended not to have tabs in your text, but rather use
  281. the "\\t" sequence.
  282.  
  283. .ti +8
  284. Registers allow you to store integer numeric values. You can handle
  285. registers with the following requests:
  286. .in 8
  287. .RQ nr New\ Register name\ val\ [inc]
  288. creates a register "name" and give to it "val" as a starting value. If you
  289. specify an argument "inc", this will be stored as the value of register
  290. increment. Register name may be one or two characters long. "val" and "inc"
  291. arguments must be positive integer numbers.
  292. .RQ rr Remove\ Register name
  293. deletes register "name".
  294. .in
  295.  
  296. Registers can be used as follows:
  297. .nf
  298. .in 8
  299.  
  300. \\nx\tinserts the value of register x
  301. \\n+x\tincrements then inserts the value of register x
  302. \\n-x\tdecrements then inserts the value of register x
  303. \\n(xx\tinserts the value of register xx
  304. \\n+(xx\tincrements then inserts the value of register xx
  305. \\n-(xx\tdecrements then inserts the value of register xx
  306.  
  307. .ti -8
  308. ARoff presets the following registers:
  309.  
  310. dw\tweek day (from 1 to 7)
  311. dy\tmonth day (from 1 to 31)
  312. mo\tmonth (from 1 to 12)
  313. yr\tyear (two digits)
  314. hr\thour (from 0 to 23)
  315. mn\tminutes (from 0 to 59)
  316. sc\tsecondes (from 0 to 59)
  317. pn\tcurrent page number (output)
  318. il\tcurrent line number (output)
  319. ol\tcurrent line number (input)
  320.  
  321. .fi
  322. .in
  323. Please take notice that registers giving date and time are initialized when
  324. you start ARoff, and will not be updated.
  325.  
  326. .ti +8
  327. Strings allow you to store strings having 255 characters at most. You can
  328. handle strings with the following requests:
  329. .in 8
  330. .RQ ds Define\ String name\ string
  331. creates a string "name" and affect to it "string" as a value. To keep
  332. spaces at the beginning of string, just put a quotation mark (") before the
  333. first space. String name may be one or two characters long. If string
  334. "name" exists, ARoff only changes its value.
  335. .RQ as Append\ String name\ string
  336. adds a given string to the string "name". If this string doesn't exist,
  337. it will be created. To keep spaces at the beginning of string, just put
  338. a quotation mark (") before the first space.
  339. .RQ rs Remove\ String name
  340. kills string "name".
  341. .in
  342.  
  343. Strings may be used as follows:
  344.  
  345. .in 8
  346. \\*x\tinserts the value of string x
  347. .br
  348. \\*(xx\tinserts the value of string xx
  349. .in
  350.  
  351. ARoff defines automatically "fn" string; and this one takes its value from
  352. the current file name.
  353.  
  354. .PR Macros
  355. .ti +8
  356. Macros allow you to store and recall easily a suite of requests and/or a
  357. large part of text. You can handle macros with the following requests:
  358. .in 8
  359. .RQ de DEfine\ macro name
  360. begins the definition of a macro "name". If this one already exists, its
  361. content will be deleted. The following lines will be stored as a definition
  362. until a line begins by two periods ("..").
  363. .RQ am Append\ to\ Macro name
  364. adds the following lines (until a line begins by "..") to a definition of
  365. macro "name". If this macro doesn't exist, it will be created.
  366. .RQ rm Remove\ Macro name
  367. kills the given macro.
  368. .RQ pm Print\ Macro [name]
  369. displays the definition of the given macro. If no argument is specified,
  370. ARoff displays the definition of all the macros.
  371.  
  372. .in
  373. You call a macro exactly in the same way as a request: a period in the
  374. beginning of line, followed by the macro name. At most, you can pass nine
  375. arguments to a macro. These ones can be accessed to into the macro definition
  376. by \\$1, \\$2, ..., \\$9. The count of arguments may be known by looking at the
  377. ".$" register. Space is the arguments separator. If you have to pass an
  378. argument with a space, add a "\\" before the space character. If you have to
  379. pass an argument with a fixed space, add three "\\" before the space character.
  380. .NI
  381. When ARoff is reading a macro definition, text is interpreted in the
  382. same way as usual. So, remember using double "\\" before calling up registers,
  383. strings or arguments if you want to defer their interpretation until the macro
  384. is performed.
  385. .FN
  386. Unlike "nroff", it is forbidden to include a ".de" or ".am" request in your
  387. macro definition. It is possible to call a macro within another one.
  388.  
  389. .PR Traps
  390. .ti +8
  391. Traps allow you to perform a macro at a given vertical position in a page.
  392. By this mechanism, you can add a header or a footer. You can handle traps
  393. with the following requests:
  394. .in 8
  395. .RQ wh WHen line\ name
  396. sets a trap at a given line. The performed macro will be the macro "name".
  397. If there was already a trap at this position, ARoff only changes the
  398. name of the macro to perform. If "line" is a negative number, it is a
  399. position relative to the end of the page. If "line" is 0, trap will be
  400. performed at the end of the page.
  401. .RQ rt Remove\ Trap line
  402. remove the trap set at a given line.
  403. .NI
  404. In this version of ARoff, the end of page trap is never peformed
  405. over the last page of a text.
  406. .FN
  407. .in 0
  408. When ARoff is just going to write a line, it looks if a trap is set at this
  409. line. In this case, ARoff calls the specified macro before it tries again
  410. to write the line. This allows to activate a stream of traps set on
  411. consecutive lines.
  412.  
  413. .PR Conditions
  414. .ti +8
  415. ARoff allows macro or request execution, as well as insertion of part of the
  416. text, to depend of a condition. You handle conditions with the following
  417. requests :
  418. .in 8
  419. .RQ if If cond\ anything
  420. ignore 'anything' (i.e. the rest of the line) if the specified condition
  421. is not verified.
  422. .RQ el Else anything
  423. ignore 'anything' (i.e. the rest of the line) if the last condition tested
  424. was verified. The "el" request must IMMEDIATLY follow the "if" request.
  425. .in
  426.  
  427. The condition in a "if" request may be one of:
  428.  
  429. .nf
  430. \to\tpage number is odd
  431. \te\tpage number is even
  432. \tn\tformater is "nroff" (always true)
  433. \tt\tformater is "troff" (always false)
  434. \t's1's2'\tstring 's1' and 's2' are the same
  435. \tN<M\tinteger N is lower than integer M
  436. \tN=M\tinteger N is equal to integer M
  437. \tN>M\tinteger N is greater than integer M
  438. .fi
  439.  
  440. A condition may be negated with the '!' character. Condition arguments may,
  441. of course, be ARoff registers of strings. Here are a few examples:
  442.  
  443. .nf
  444. .in 8
  445. \!.if o .tl 'Odd page header''\n(pn'
  446. \!.el .tl 'Even page header''\n(pn'
  447.  
  448. \!.if '\*(fn'macros' the "macros" file
  449. \!.el another file
  450.  
  451. \!.\" Page break if input line number > 56
  452. \!.if \n(il>56 .bp
  453. .in
  454. .fi
  455.  
  456. .PR Others
  457. .ti +8
  458. Registers and strings are inserted through a text as it is read. You can
  459. use either a register or a string as an argument of request. The value of
  460. an unknown register is 0; an unknown string is replaced by an empty one. An
  461. unknown request leads ARoff to look for a macro. The call of an undefined
  462. macro will be be ignored.
  463. .ti +8
  464. Unlike "nroff", registers, strings and macros are stored in separate
  465. lists. This means you may give the same name to a register, a string and a
  466. macro: ARoff will make no mistake about them. On the other hand, as the
  467. requests list is read before the macro list, if a macro and a request have
  468. the same name, only the request will be performed.
  469.  
  470. .nf
  471. Here is the ARoff error codes list:
  472.  
  473. .in 16
  474. 0\tinternal error
  475. 1\tstack is empty
  476. 2\tstack is full
  477. 3\tsyntax error
  478. 4\ttable or buffer overflow
  479. 5\tcannot open the given file
  480. 6\tincorrect arguments
  481. 7\twrite error
  482. 8\tnot sufficient free memory
  483. 9\t"el" request without "if" request
  484. 10\tcannot seek in file
  485. 11\tread error
  486. 12\tfile to process is empty
  487.  
  488. .in
  489. Here are the default values of ARoff parameters:
  490.  
  491. .in 16
  492. alignement\t\tad\tb
  493. indentation\t\tin\t0
  494. line length\t\tll\t80
  495. line spacing\t\tls\t1
  496. title length\t\tlt\t80
  497. page length\t\tpl\t66
  498. page number\t\tpn\t1
  499. left margin\t\tpo\t0
  500. tabulation\t\tta\t8
  501. tabulation character\ttc\tspace
  502.  
  503. .in
  504. .fi
  505. .ti +8
  506. Let me know remarks and criticism about this program by writing at the
  507. following address:
  508.  
  509. .ne 4
  510. .ce 4
  511. M. GOUNELLE Denis
  512. Boite 71
  513. 6, rue des cailloux
  514. 92110 CLICHY - FRANCE
  515.  
  516. .ti +8
  517. ARoff was developped almost totally under an UNIX system, then re-compiled
  518. on an Amiga computer with the Aztec C compiler version 3.6a. Source files
  519. are supplied (there are no many comments, sorry !), with their own makefiles
  520. for UNIX and Aztec. You should be able to compile this program with any
  521. decent C compiler. The parts peculiar to the Aztec C compiler were put
  522. between "#ifdef".
  523.  
  524.