home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / a / alphatxt.lbr / ALPHATXT.RZO / ALPHATXT.RNO
Encoding:
Text File  |  1993-10-26  |  22.6 KB  |  564 lines

  1. .sk 15
  2. .lm+14
  3. ******************************************
  4. *                                        *
  5. *    AlphaText Formatter Version 2.10    *
  6. *                                        *
  7. *                   by                   *
  8. *                                        *
  9. *            Richard M. Abbot            *
  10. *                                        *
  11. *            January 27, 1986            *
  12. *                                        *
  13. ******************************************
  14. .lm-14
  15. .he AlphaText v2.10 User's Guide
  16. .pa
  17. DISCLAIMER
  18. .js
  19. .pp;The AlphaText Formatter may be used
  20. freely  by anyone for  non-commercial purposes,  but may not be  sold, 
  21. included in a package for sale,  or used as an incentive to  buy, 
  22. by   any  person,   organization  or  corporation  without  prior 
  23. arrangement   with   the   author, Richard Abbot.
  24. Furthermore, Richard Abbot will bear no responsibility for losses 
  25. resulting  from  the  use  or  inability  to  use  this  program.  
  26. ALPHATXT.COM  may not be distributed without ALPHATXT.DOC. 
  27. Finally, Richard Abbot shall retain all commercial rights to the AlphaText
  28. program and related documentation.
  29. .je
  30. .sk 5
  31. TRADEMARKS
  32. .sk
  33. CP/M            Digital Research Inc.
  34. VAX-11          Digital Equipment Corp.
  35. Turbo Pascal    Borland International
  36. .pa
  37. 1. INTRODUCTION
  38. .js
  39. .pp  ;AlphaText is an embedded command ASCII text formatter 
  40. for CP/M based systems.  It is similar
  41. in nature to several other public domain and commercial products.  Like
  42. its predecessors, it
  43. has the ability to produce professional quality formatted documents.
  44. AlphaText, however, has several capabilities not present in many other text
  45. formatters.  Its biggest "selling point" is that it can issue printer
  46. dependent escape sequences to control the special features present
  47. in many modern printers.  The user defines these sequences in a
  48. printer definition file.  AlphaText can also output formatted text to the crt,
  49. the lst: device, or to a disk file.  Disk file outputs can later
  50. be printed with the pip utility, mailed to a BBS, etc.
  51. .pp;No text editing capability is included in AlphaText.  The user is expected to
  52. prepare his/her text inputs with a separate editor program.  There are many
  53. fine quality screen-oriented text editors available, both in the
  54. public domain and via commercial sources.
  55. .pp ;AlphaText was coded originally in HP Fortran for the HP-1000
  56. minicomputer.  It has been rewritten in BASIC 2.0 for the Commdore 64,
  57. as well as BASIC 7.0 for the Commodore 128.  Both Commodore versions
  58. also included a simple, line-oriented text editor to form a complete
  59. word-processing package.  The text formatter portion was also ported to
  60. the VAX-11/780 system in both BASIC and RATFOR.  AlphaText has now been
  61. ported to the CP/M environment using Borland Turbo Pascal.
  62. .pp ;This document provides a quick overview of AlphaText.  Users who are
  63. familiar with other embedded-command text formatters should have no
  64. trouble adapting to AlphaText.  Enough information is provided here to 
  65. initiate novice
  66. users as well.
  67. .pp ;Needless to say, this User's Guide was formatted using AlphaText!
  68. .je
  69. .sk 3
  70. 2. INSTALLATION
  71. .js
  72. .pp;The AlphaText product needs very little in the way of installation.
  73. The library as supplied contains five files:
  74. .sk
  75. .lm+10
  76. .je
  77. 1. ALPHATXT.CQM
  78. 2. ALPHATXT.RQO
  79. 3. ALPHATXT.DQC
  80. 4. PFORMAT.TXT
  81. 5. MAPCTLS.CQM
  82. .lm-10
  83. .js
  84. .pp  ;The ALPHATXT.COM file is ready to execute.  The .RNO file 
  85. contains the
  86. text for this document in raw form, to serve as a handy tutorial for
  87. users.  The .DOC file is a formatted copy of the .RNO file, that
  88. hopefully is pleasing enough to the user that he/she will continue
  89. to pursue the matter.  PFORMAT.TXT is a copy of the printer definition
  90. file in use at my installation.  The MAPCTLS.COM file is a utility
  91. described in Appendix A.
  92. .pp  ;The main user installation task is to customize PFORMAT.TXT
  93. for the hardware in use at the user's site.  There
  94. is no printer or font information embedded in
  95. AlphaText itself; this data comes from the printer definition
  96. file.  If a user has no need for
  97. embedded printer code capability, then it is quite safe to run with
  98. no PFORMAT.TXT file.  A warning will be displayed in this case.
  99. .pp  ;The user can choose up to 23 printer format strings.  A string
  100. is activated by embedding a corresponding control character
  101. in the input text stream.  For example, an embedded
  102. control-d will cause printer string 004 to be inserted in the text stream.
  103. .pp;The printer definition file can contain two types of lines: comment
  104. lines, which have a semicolon in column 1, and printer format lines,
  105. which do not.  An arbitrary number of comment lines can be
  106. included in the definition file.  A correct printer format line looks like:
  107. .sk
  108. .je
  109. .ce ;018=027 070 032 002
  110. .js
  111. .pp;The line above contains the numeric notation for control 
  112. character desired (018 is ^R) , followed
  113. by an equal sign, followed by groups of 3-digit decimal ASCII
  114. strings, separated by blanks.  Note that there should be
  115. --NO-- trailing blanks on the line.
  116. .pp;Control-j, control-m, and control-z should not be chosen, as
  117. those characters are special to CP/M.
  118. No internal syntax checking is done on the printer definition file,
  119. other than a check for correct line length.  For this reason, the user
  120. should take care when creating PFORMAT.TXT.
  121. .pp;Once the proper printer
  122. format file is constructed, it should not have to be changed until
  123. system hardware is changed.
  124. .sk 3
  125. .je
  126. 3. TEXT PREPARATION
  127. .js
  128. .pp;The user should prepare his/her text using an ASCII text
  129. editor.  The embedded printer controls are control characters, so it
  130. is helpful if the editor in use has the ability to take control 
  131. characters as input, and display them on output.  Most editors seem to
  132. implement the input feature utilizing a control-p character prior to the
  133. desired control character.  Fewer editors know how to display control
  134. characters.  Some opt for the traditional display of an uparrow character
  135. followed by the control character (^C for instance).  Other editors
  136. adjust the video brightness (if possible) to shade control characters.
  137. The worst situation is to have an editor which takes control
  138. characters as input, but can not display them.
  139. .pp;Embedded printer control codes should be typed in the following manner,
  140. with no adjacent blanks:
  141. .sk
  142. .je
  143. .ce;This line has^Uunderlined text^Vin the middle.
  144. .js
  145. .sk
  146. In the above example, the user has defined ^U as the character for
  147. "start underline mode" and ^V as the character for "cancel underline
  148. mode."
  149. .pp;An alternative exists for those users who prefer an editor that
  150. does not handle control characters well.  The MAPCTLS utility can
  151. convert control characters to printable characters, and vice versa.  MAPCTLS
  152. is described in Appendix A.
  153. .pp;AlphaText command lines have a period character (.) in column 1.  The
  154. user should be aware of this, because any line that LOOKS like a
  155. command line will be interpreted as such.  Sentences which inadvertently
  156. place a period in column 1 will probably cause a formatting error message
  157. later.
  158. .pp;The user should try to stay within the traditional 80-column
  159. screen boundaries
  160. when preparing input text.  AlphaText 
  161. will compensate to an extent for extra-long
  162. input lines, but the editing phase will be complicated by the
  163. wrap-around (or hidden) text line fragments.
  164. .je
  165. .sk 3
  166. 4. FORMATTING PROCEDURE
  167. .js
  168. .pp;AlphaText needs up to three pieces of information to successfully
  169. process user text: the name of the input file, the name of the
  170. output device, and (if the output device is the disk) the name
  171. of the output file.  The user may supply these data items on the
  172. AlphaText command line or within the program by responding to
  173. prompts.  The 
  174. user is free to mix and match 
  175. these methods as desired, as shown in the legal command
  176. lines below:
  177. .sk
  178. .lm+10
  179. .je
  180. A> ALPHATXT
  181. A> ALPHATXT C:TFILE.RNO
  182. A> ALPHATXT B:PRICES.RNO S
  183. A> ALPHATXT CANDY.RNO D
  184. A> ALPHATXT STOCKS.RNO D B:STOCKS.DOC
  185. .lm-10
  186. .js
  187. .pp;The device names that AlphaText recognizes are p (printer), s (screen),
  188. d (disk), and n (null).  They may 
  189. be given in upper or lower case.  The file
  190. extensions in the above examples (.RNO and .DOC) are used here out of
  191. habit, and are in no way mandatory.  Any legal CP/M filename may be
  192. used.  Note that AlphaText should always be run from the currently
  193. logged disk drive.
  194. .pp;If any error conditions are encountered during the formatting
  195. process, the error messages are displayed on the crt along with the
  196. number of the source line that provoked the error.  The user can use
  197. the direct jump feature of his/her text editor to go right to the
  198. offending line for inspection and correction.
  199. .pp;The purpose of the null output device is to permit AlphaText to
  200. function as a sort of "word compiler."  With a null output device, the
  201. only output that AlphaText will produce will be the formatting error
  202. messages that come out on the crt.  Users may wish to run AlphaText
  203. with a null output device initially, to see if any formatting errors exist.
  204. If control-p is entered before executing AlphaText, then the error
  205. messages will be logged to the printer as well as to the crt. 
  206. Once these errors are corrected, AlphaText can be rerun with 
  207. document text output to
  208. the printer.  This procedure will be economical if a user creates output
  209. on expensive bond paper which should not be wasted.
  210. .je
  211. .sk 3
  212. 5. FORMATTING ALGORITHMS
  213. .js
  214. .pp;AlphaText is capable of producing three types of output text: unfilled,
  215. filled, and justify-filled.  Unfilled text is almost a mirror of the
  216. input text, differing only in the addition of
  217. a leading left margin and paging.  Filled
  218. text mode causes the maximum number of words to be packed onto each
  219. output line, with the right text margin left jagged. In justify-filled
  220. output mode, text is filled, and then sequences of blanks are added
  221. between words to create a uniform right margin.
  222. .pp ;There can be three types of input lines for AlphaText: literal lines,
  223. command lines, and text lines.  AlphaText supports a literal mode, whereby
  224. the input text is directly copied to the output area, with a left
  225. margin string prepended.  This mode is useful if the input text
  226. contains charts, tables, or crude "character graphics."  The only embedded
  227. command recognized in literal mode is the .le command (literal end).
  228. AlphaText command lines are easy to isolate by locating the leading period.
  229. Most dot commands cause the immediate output of text, but a few
  230. (such as .in, indention) insert text into the text buffer for later
  231. extraction.  In both filled and justify-filled modes, normal text lines
  232. are appended to a text buffer and extracted in chunks not larger than
  233. the current page width.  A sliding buffer-start and buffer-end concept
  234. is used, to minimize buffer housekeeping time.  When the buffer-start
  235. address is near the top of the buffer, the buffer is reorganized in a
  236. form of "garbage collection."  The text buffer is unconditionally 
  237. dumped prior to
  238. the processing of all command lines, and when the end-of-file
  239. condition is reached on the input file.
  240. .pp ;The embedded font control characters are kept as such until the
  241. very last operations of AlphaText, prior to output.  The control characters
  242. are mapped into a blank character plus an appropriate escape sequence.
  243. This is done to preserve text justification, where the position of the
  244. control character was counted in the calculation that determines the
  245. number of extra blanks needed to complete the line.
  246. .pp;The justification of text is both a science and an art form.
  247. Professional
  248. typesetting programs use a technique called "proportional spacing," which
  249. inserts minute amounts of space between printed letters.  The effect is to
  250. produce a uniform-looking page of text.  AlphaText is less flexible, and
  251. therefore must "try its best" to produce aesthetic pages of text via the
  252. embedded-blank mechanism.  For the most part, AlphaText succeeds in this
  253. effort.  There are sequences of input text which, due to long wordlengths,
  254. just can not be justified aesthetically.  AlphaText realizes this, and will
  255. produce a warning message when the user has called for justification
  256. on an line which will be "sparsely populated" in the output document.
  257. .sk 3
  258. .je
  259. 6. FORMATTING COMMANDS
  260. .js
  261. .pp ;This section describes the 17 commands available in AlphaText.
  262. .sk 2
  263. .je
  264. Margin Commands
  265. .sk
  266. .lm+5
  267. 1) .lm (Left Margin)
  268. 2) .rm (Right Margin)
  269. .sk
  270. .js
  271. The margin commands have two forms: absolute and relative.
  272. The absolute forms set the margin to a particular column, while
  273. the relative
  274. forms set the margins to a column value relative to the previous margin 
  275. value.
  276. .sk
  277. .je
  278. Examples:
  279.  .lm 5    sets left margin to column 5
  280.  .lm+10   sets left margin to ten greater than current value
  281.  .rm 60   sets right margin to column 60
  282.  .rm-15   sets right margin to 15 less than current value
  283. .sk
  284. .js
  285. Note that when using relative margin values, there may not be any
  286. blank characters embedded in the command.  AlphaText also does not
  287. check for "silly" combinations of left and right margin values.
  288. It is up to the user to use sensible margins.
  289. .je
  290. .sk 2
  291. .lm-5
  292. Mode Control Commands
  293. .sk
  294. .lm+5
  295. 3) .fs (Fill Start)
  296. 4) .fe (Fill End)
  297. 5) .js (Justification Start)
  298. 6) .je (Justification End)
  299. 7) .ls (Literal Start)
  300. 8) .le (Literal End)
  301. .sk
  302. .js
  303. These commands control the processing mode of AlphaText, as discussed in the
  304. section on Formatting Algorithms.  The commands are designed to bracket
  305. a block of affected text lines.  The justification mode is a superset
  306. of the fill mode, so only the justification commands need be given
  307. when justification is desired.  If no mode is requested, then the
  308. unfilled mode is supplied by default.  All modes continue until changed
  309. by another mode command.
  310. .je
  311. .lm-5
  312. .sk 2
  313. Paging System Commands
  314. .lm+5
  315. .sk
  316. 9)  .nm (Number Page)
  317. 10) .pa (Force Page Eject)
  318. 11) .he (Designate Header)
  319. 12) .fo (Designate Footer)
  320. .sk
  321. .js
  322. These commands control the breakup of input text into physical pages.
  323. The .nm command is useful when a document is split across several
  324. input files, and will be formatted in sections.  With .nm, the user
  325. can control the value of the first page number that AlphaText will use.
  326. A good example of this can be found in the section on Formatting
  327. Tips.  The .pa command will force the start of a new page at all times
  328. EXCEPT when the output file is already at the top of a new page.
  329. Form ejects are done via line-counting, a safer course of action than
  330. assuming a particular formfeed character.  The header and footer
  331. commands allow a string up to 65 characters long to be placed on the
  332. top and bottom of each output page.  This document makes use of the
  333. header capability.  Note that the .nm and .he commands take their
  334. action on the NEXT text page, not the current page.
  335. .sk
  336. The .he and .fo commands may be given with or without a text string
  337. on the command line.  When a text string is supplied, header (footer)
  338. usage is enabled.  When no text string is supplied, then the output
  339. of headers (footers) is cancelled as of the next output opportunity.
  340. .sk
  341. .je
  342. Examples:
  343.  .nm 3                            next page will be page 3
  344.  .he This is some header text     designate header
  345.  .he                              turn off header
  346.  .fo And here is footer text      designate footer
  347.  .fo                              turn off footer
  348. .sk 2
  349. .lm-5
  350. Line Spacing Commands
  351. .lm+5
  352. .sk
  353. 13) .sk (Skip Lines)
  354. 14) .sp (Select Line Spacing)
  355. .sk
  356. .js
  357. These commands control how text is spaced vertically in the output
  358. document.  Each takes a numeric parameter which is not checked for
  359. "sensibility" by AlphaText.
  360. .sk
  361. .je
  362. Examples:
  363.  .sk           skip one line
  364.  .sk 1         skip one line
  365.  .sk 12        skip twelve lines
  366.  .sp 2         set double spacing
  367.  .sp 3         set triple spacing
  368. .sk 2
  369. .lm-5
  370. Text Shaping Commands
  371. .sk
  372. .lm+5
  373. 15) .ce (Center Text)
  374. 16) .pp (Begin New Paragraph)
  375. 17) .in (Indent Text)
  376. .sk
  377. .js
  378. These commands control how text is indented and "shaped" on the output
  379. page.  The .in command takes a numeric parameter which indicates how many
  380. spaces to indent.
  381. The .pp command is actually a combination of a .sk command followed
  382. immediately by a .in 4; command.  The .ce command performs
  383. centering between the current
  384. pair of margin settings.  All three of these commands are followed by a
  385. semicolon to delimit the command from the affected text.
  386. .sk
  387. .je
  388. Examples:
  389.  .ce ;This text will be centered
  390.  .pp ;And this will start a new paragraph
  391.  .in 4;Coincidentally, so will this
  392. .sk
  393. .js
  394. Note that the .in command is the PROPER way to achieve indentation
  395. with AlphaText.  One may supply lines to AlphaText that contain leading
  396. blanks, but this will result in potentially uneven indentation, due
  397. to AlphaText's justification algorithm.  This algorithm assumes that all
  398. blanks found on a text line are possible justification points.
  399. .je
  400. .sk 3
  401. .lm-5
  402. 7. FORMATTING DEFAULTS
  403. .js
  404. .pp;The user can create output text by completely specifying format
  405. data with AlphaText commands, or he/she can rely on AlphaText defaults,
  406. which remain in effect until changed by a command.  When AlphaText is
  407. run, the following defaults are present:
  408. .je
  409. .lm+5
  410. .sk
  411. left margin =  5
  412. right margin = 75
  413. page number = 1
  414. line spacing = 1
  415. fill flag = false
  416. literal flag = false
  417. justify flag = false
  418. header used  = none
  419. footer used  = none
  420. .lm-5
  421. .sk 3
  422. 8. FORMATTING TIPS
  423. .sk 2
  424. A) The Waste Page
  425. .js
  426. .lm+5
  427. .pp;As stated above, the .he and .nm commands take effect
  428. on the NEXT text page, rather than the current one.  So if it desired
  429. to have them take effect on page one of a document, the following
  430. sequence may be used:
  431. .sk
  432. .lm+5
  433. .je
  434.  .nm 1
  435.  .he This is the header
  436.  .fo Not to mention the footer
  437.  waste
  438.  waste
  439.  .pa
  440. .lm-5
  441. .js
  442. .pp;It is worth noting that this "waste page method" is the only way
  443. to have AlphaText number the first page of a document.
  444. Normally, page one doesn't receive a page number
  445. because it would look out of place on many common, single-page documents like
  446. letters.  AlphaText will automatically start numbering on page two unless
  447. the above sequence is inserted at the start of the input text.
  448. .lm-5
  449. .sk 2
  450. .je
  451. B) Rewards for Simplicity
  452. .js
  453. .lm+5
  454. .pp;As discussed in the Formatting Algorithms section, it is possible to create
  455. an input text sequence that just won't look nice when justified.  This
  456. problem can be minimized by (gulp) the use of lots of small words, giving
  457. AlphaText many choices of location for justification blanks.  Who knows,
  458. the reader may appreciate it too!  In addition, text that contains
  459. lines with NO blanks (i.e program listings with solid lines of asterisks) will
  460. justify poorly, because AlphaText has nowhere for its blanks to go.
  461. I have found that a small reorganization of input text, with a word added
  462. or removed here or there, can often make the difference between nicely
  463. formatted text, and "buckshot" text, with lots of holes.
  464. .lm-5
  465. .sk 2
  466. .je
  467. C) Good Behavior Please
  468. .js
  469. .lm+5
  470. .pp;In the discussions above, the phrase "does not check" was used many times.
  471. I wrote AlphaText to be a personal productivity tool, and geared its error
  472. resistance to my own kindly, low-pressure user environment.  
  473. Rather than spend the time making every program operation monkey-proof,
  474. I decided to spend my time on other matters (one of them being the creation
  475. of a readable User's Guide).
  476. It is definitely
  477. possible to bomb this program by giving it inputs that don't make sense.
  478. Users should resist the temptation to "walk on the wild side," and provide
  479. program inputs that will result in a pleasing output document, rather
  480. than a CP/M reboot.
  481. .lm-5
  482. .je
  483. .sk 3
  484. 9. FINAL WORDS
  485. .js
  486. .pp;I hope that you will find AlphaText to be a
  487. useful software tool.  I certainly enjoyed writing it.
  488. .pp;I welcome all user bug reports, comments, and suggestions.  I can be
  489. reached via id [72307,3125] on CompuServe.
  490. .pp;GOOD LUCK WITH ALPHATEXT!!
  491. .sk 3
  492. .pa
  493. .je
  494. .ce;APPENDIX A
  495. .sk
  496. .ce;THE MAPCTLS UTILITY
  497. .sk 2
  498. .js
  499. .pp;As mentioned in the section on Text Preparation, it is possible that
  500. a user may prefer a text editor that does not handle control characters
  501. well.  Some editors are ill-equipped for the input and output of
  502. unprintable characters.
  503. .pp;A utility program, MAPCTLS, has been included in the AlphaText
  504. library to assist users who find themselves in this position.  MAPCTLS
  505. can translate text in a bidirectional way: unprintables can be mapped
  506. into printable strings, and later back into unprintable form.  In MAPCTLS,
  507. control characters are represented by a three-digit decimal sequence
  508. surrounded by square brackets.  For example, the string "[018]" would
  509. be equivalent to control-r.
  510. .pp;In MAPCTLS terminology, the conversion of a control-r to "[018]" is
  511. called "expansion."  The conversion of the string "[018]" to a control-r
  512. is called "compression."  MAPCTLS is executed as follows:
  513. .je
  514. .sk
  515. .lm+10
  516. A> MAPCTLS A.RNO E B.RNO
  517. A> MAPCTLS B.RNO C C.RNO
  518. .lm-10
  519. .js
  520. .sk
  521. The general command format is the MAPCTLS command name, followed by the
  522. name of the input file, followed by the operation code, followed by the
  523. name of the output file.  The operation code may be either a "c" (for
  524. compress mode) or an "e" (for expand mode).  In the example above,
  525. the file c.rno will be identical in content to a.rno.  If a.rno contained
  526. any embedded control characters, they will be expanded into digit strings
  527. in b.rno.
  528. .pp;MAPCTLS allows all users an additional degree of freedom when preparing
  529. input for AlphaText.  It is possible for a user to embed strings that are
  530. meaningful to him/her in the input text, and then use the "global replace"
  531. command found in many editors to globally substitute a string meaningful
  532. to MAPCTLS (or to AlphaText for that matter).  For example, a user 
  533. could type:
  534. .je
  535. .sk
  536. .lm+10
  537. here is a sentence with(UNL_ON)underlined text(UNL_OFF)
  538. .lm-10
  539. .sk
  540. A global replacement editor command could change this string to:
  541. .sk
  542. .lm+10
  543. here is a sentence with[006]underlined text[007]
  544. .lm-10
  545. .sk
  546. Finally, MAPCTLS would change the string to:
  547. .sk
  548. .lm+10
  549. here is a sentence with^Funderlined text^G
  550. .lm-10
  551. .sk
  552. .js
  553. which is what AlphaText understands.  The degree to which a user 
  554. makes use of MAPCTLS will depend on how sophisticated his/her
  555. text editor is, and also on how much the user is willing to pay in
  556. increased text entry effort for increased clarity within the text.
  557. .pp;MAPCTLS provides a nice way for a user to get a copy of a raw
  558. AlphaText input file that can be safely sent to the lst: device.  The
  559. utility will also be useful in the general situation where a user
  560. wants to print a file that may be corrupt.
  561. .pp;If one's text editor is satisfactory, one never need make use
  562. of MAPCTLS.  But it's nice to know that it's there.
  563. rupt.
  564. .pp;If one's text editor is