home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / textutil / jgpsuite / Docs / JGDocDoc < prev    next >
Encoding:
Text File  |  1993-04-23  |  42.1 KB  |  1,054 lines

  1. .// Source for JGDoc_Info  Wed,15 Apr 1992
  2. .gute 5
  3. .ht 2 10 12
  4. .// This sets tabs for the indented layouts below.
  5. .sp 0                   Comment out if Pages wanted; default 66 lines (.sp 66)
  6. .setu 10 :arc:          In/exclude archimedes only features. see .if/fi below
  7. .// .setu 10 :msdos:    Ex/include msdos only features.
  8. .setu 11 :0:            1 for debug; 0 for production
  9. .if \u11
  10. .hd
  11. /.col
  12. """"""""""""""""""""""
  13. /
  14. .fi
  15. .ft
  16. /
  17.  
  18. .col
  19. |Page \p
  20.  
  21. /
  22.  
  23. .if \u11 eq 0
  24. .hd
  25. :
  26.  
  27. .if \o
  28. .col
  29. |JGDocumentation|Wed,15 Apr 1992
  30. .else
  31. .col
  32. Wed,15 Apr 1992|JGDocumentation
  33. .fi
  34.  
  35. :
  36. .fi
  37.  
  38. .marg 16 68
  39. .vbar | 0 52
  40.  
  41.  
  42. .bar _
  43. .vbsw +
  44. .nofj
  45. .\ \Q
  46. .// Cancels any proportional character setting from Configuration, since
  47. .// "JGDocument" looks wrong; restored, if applicable, by .usel base below.
  48.  
  49.       @   @@@@   @@@@@    @@@@    @@@@
  50.       @  @    @  @    @  @    @  @    @
  51.       @  @       @    @  @    @  @       @@@@@
  52.       @  @  @@@  @    @  @    @  @
  53.  @    @  @    @  @    @  @    @  @    @
  54.   @@@@    @@@@   @@@@@    @@@@    @@@@
  55.  
  56.  
  57.     @    @  @    @  @@@@@@  @    @   @@@@@
  58.     @    @  @@  @@  @       @@   @     @
  59.     @    @  @ @@ @  @@@@@   @ @  @     @
  60.     @    @  @    @  @       @  @ @     @
  61.     @    @  @    @  @       @   @@     @
  62.      @@@@   @    @  @@@@@@  @    @     @
  63.  
  64. .bar _
  65. .vbsw
  66. .usel base              See Layouts below
  67.  
  68.  
  69. This document assumes you are in JGDoc mode, but is also valid for JGPrint
  70. mode. Shareware is distributed with JGDoc mode set. In JGPrint mode, more
  71. flexibility is available through use of the configuration files. This text is
  72. quasi\-tutorial, in the sense that directives are both explained and used; in
  73. particular an attempt is made to provide examples near explanations.
  74.  
  75. .page
  76.  
  77. This file is of type JGPrint, and when it is interpreted by JGDoc
  78. (!jgp.Tools.JG(Share)Pr), generates doc.jgdocdoc, a JGPCopy file. This file
  79. describes the formatting facilities available to the user and to the writer of
  80. documentation; this file itself serves as an example of how these facilities are
  81. provided, doc.jgdocdoc shows the results of their use. You should rename
  82. doc.jgpdocdoc to JGDocInfo.
  83.  
  84. .col
  85. |Running JGDoc on "OK" files
  86.  
  87. If the first character of !jgp.info.JGPStrings is '*', JGPrint runs in JGDoc
  88. mode. I distribute in this mode. The following information assumes desktop; if
  89. it is not there, analogous reports will appear on the screen.
  90.  
  91. The documentation below discusses how to write or modify files for JGDoc and
  92. JGPrint. If you have a file <path>.foo of type JGPrint (a brown open book),
  93. applying JGDoc to it will produce a well\-laid out file <path>.doc.foo of
  94. type JGPCopy (a yellow open book). At the end you will get a report window
  95. telling you how long the file is; click on the OK button, and you will quit.
  96.  
  97. You may get other report windows en route. The most common appears if
  98. <path>.doc.foo already exists, in which case, the report window asks if you
  99. want to overwrite it, and has an OK and a Quit button. Of course this applies to
  100. any output file, whether what you are JGPrint/Docing to, or any auxiliary file
  101. you may be writing.
  102.  
  103. Suitable reports appear if any invalid directives appear in foo's text.
  104.  
  105. If your text requests an index file (see below), the report buttons are Ignore,
  106. Choose, Quit: Ignore will cause later requests to be ignored; Choose will
  107. replace the report window with a To window. Put the file leafname you want to
  108. use in the window, and drag the icon to the directory window you want it to live
  109. in.
  110.  
  111. If your text requests a merge file (see below), clicking the Find rather than
  112. the Quit button replaces the report window with a From window. You should drag
  113. the required merge file to this window.
  114.  
  115. If a directive that only makes sense in JGPrint mode is in your text, you will
  116. get a report window with a message that it has been ignored. This will
  117. disappear after less than a second. There is also a choice you need to make, if
  118. you have used vertical bars, as to whether your output is intended for "Screen"
  119. or "Printer".
  120.  
  121. If your text includes a request for a change of pitch, JGDoc ignores it without
  122. a report.
  123.  
  124. This is all you need to know to run JGDoc on an existing unchanged file. I
  125. recommend you to do so now to the files in document'n.doc. The results will be
  126. much more agreeable to read.
  127.  
  128. If you want to alter the layout of the file doc.foo, you'll have to read a
  129. little further.
  130.  
  131. A trick: if you want to cancel opening a file from a to: window, give it a null
  132. name, or the same name as an existing file; from a from: window, drag a directory
  133. to the window. In each case you will get another report that quits the run.
  134.  
  135. .col
  136. |JGPrint/Doc Directives
  137.  
  138. Because this text has two purposes, formatting directives are more plentiful in
  139. this document than I would usually expect to find. It has, unfortunately, been
  140. necessary, sometimes, to use some before they have been explained.
  141.  
  142. There are three classes of directive: dotties, which begin with a . in column
  143. 1; backslashes, which consist of \\ followed by a character; and hatties, which
  144. consist of a ^^ followed by a character. Two dots, backslashes or hats are
  145. JGPrinted as a single printed character rather than as the introduction to a
  146. directive.
  147.  
  148. Certain dotty directives require as argument a bracketted string. The first
  149. character between byte 33 and byte 126 encountered after the dotty name is taken
  150. to be the bracket; it is my practice to use : or some other punctuation
  151. character.
  152.  
  153. Any characters on the dotty line after those meaningful to the dotty will be
  154. swallowed; thus, as above, they can be used for comments.
  155.  
  156. If the backslash \\<letter> is followed by the sign }, the } is swallowed; I
  157. find this } adds to the clarity of some source documents and avoids confusing
  158. spellcheckers; \\u<n> is an example of a few backslashes that are followed by a
  159. letter, then a number; a dot following this number will be swallowed similarly.
  160. Of course if you want a } in the first context or a . in the second, }} and ..
  161. give it to you. \\+ requires to be followed by a file name.
  162.  
  163. In JG(Shar)Ed, f1 - 0 will type a list of JGPrint directives with brief
  164. descriptions to the screen.
  165.  
  166. The syntax for certain advanced facilities is sometimes given without semantic
  167. explanation; users may care to experiment to see the effect.
  168.  
  169. This file will also serve as input to JGPrint/JGSharePr in JGDoc or JGPrint
  170. mode. It can, of course, also be read 'as is', with a little noise from the JGP
  171. layout directives.
  172.  
  173. See below for how to choose what mode JG(Share)Print runs in.
  174.  
  175. .if \u10 eq arc
  176. .cp 6
  177. .col
  178. |JGPrint and JGPCopy Files
  179.  
  180. In the Desktop, provided you have seen !jgp, it is sufficient to double click
  181. on the file's icon in the filer. See !clickme for how to set a file's type to
  182. JGPrint.
  183.  
  184. In the commandline, type the line JGPrint JGDocdoc. This assumes JGPrint and
  185. JGXists are in the library; alternatively <jgp$dir>.Tools.JG(Share)Pr(int) will
  186. enter directly.
  187.  
  188. Doc.JGDocdoc will be a JGPCopy file, and double clicking on it will enable it to
  189. be read on the screen, dumped, or printed. See !JGPClick for a discussion of
  190. JGPCopy's options. (I find mode 12 the best to use to read or study a text, mode
  191. 20 better for writing one.) You should rename this file doc.JGDocInfo.
  192. .fi
  193.  
  194. I shall speak of JGDoc rather than JGPrint in JGDoc(ument) mode.
  195.  
  196. JGDoc runs entirely in the desktop; if none, it will run instead from the
  197. commandline.
  198.  
  199. JGPrint can run either in the Desktop, or in the commandline. In the desktop, it
  200. starts with a dialogue in its own window, which covers the whole screen.
  201. Dependng on what you choose to JGPrint To, you can choose to continue either in
  202. the desktop (quicker), or in its own window (useful for checking out texts). For
  203. further details see JGPrintDoc/Info.
  204.  
  205. .cp 6
  206. .col
  207. \s1|The Reader's Needs
  208.  
  209. Given a document with JGDoc's formatting directives, either the user can accept
  210. the formatting provided, or the user requires to be able to decide whether it is
  211. to be paginated, and if so, how it its pages are to be set out for length and
  212. width; she may also need to know what byte to provide her printer with, whenever
  213. the pound sign appears in the text on to the screen; this byte value will be
  214. found in her printer documentation.
  215.  
  216. .cp 6
  217. .col
  218. \s2|.sp <n>
  219.  
  220. The .sp directive is followed by a number, which determines how many lines there
  221. are on each page. Allowable values are 0, 11-120. 0 implies no paging, <n>
  222. implies that the header, body and footer of each page make up precisely <n>
  223. lines. The default value is 66, i.e. 11" at 6 lines per inch. Note that the
  224. documenter may have put in paging or conditional paging directives to take back some
  225. control from JGDoc (see below). In JGDoc mode, the .sp directive is only
  226. effective within the prologue, the group of dotties at the top of the document
  227. interpreted before any printing is done; within the body of the text its use is
  228. reported, but its effect ignored. Thus, unlike JGPrinting to screen, page
  229. registration is preserved, in spite of the fact that the change is not effected
  230. on the printer.
  231.  
  232. To emit codes to alter the physical distance between lines on particular
  233. printers, JGPrint itself is needed. This serves as an example of JGDoc's
  234. designed limitations.
  235.  
  236. There can sometimes be rounding errors if only .sp is used. JGPrint/Doc has a
  237. fuller story involving both pagelength (.pl) and line spacing. For details see
  238. below.
  239.  
  240. .cp 6
  241. .col
  242. \s2|.Marg <l> {<r>}
  243.  
  244. The .marg directive sets the lefthand column <l>, and the right hand column <r>
  245. between which characters are allowed.  Column 1 is the leftmost the device can
  246. use. Thus the usual modes require 1\ <=\ <l>\ <\ <r>\ <=\ 80. In effect <r>
  247. specifies the width of the page. The default values are 7, 73 giving a left
  248. margin of 6 columns and a right margin of 7 columns on an 80 column device.
  249.  
  250. NB .cpi <p> <l> <r> is a synonym which has extra effects on the character pitch
  251. used in JGPrint. In JGDoc, it will only have effects if margins, guttering or
  252. horizontal tab are already set.
  253.  
  254. .cp 6
  255. .col
  256. \s2|jgp$pound
  257.  
  258. If the system variable jgp$pound is set to an integer
  259. .if \u10 eq arc
  260.  (*seteval jgp$pound <n>), byte 163(£)
  261. .fi
  262. .if \u10 eq msdos
  263.  (>set jgp$pound = <n>), byte 156(†)
  264. .fi
  265.  is transformed to byte n, thus enabling the printer to get the value it
  266. requires when the JGDocced file is copied to the printer. If jgp$pound is unset,
  267. the £ byte is unchanged, as is required when the JGDocced file is looked at on
  268. the screen. (The Pound sign above will only come out correvtly on the screen on
  269. an Archimedes.)
  270.  
  271. .cp 6
  272. .col
  273. \s2|Newlines
  274.  
  275. JGDoc sends precisely the combination of carriage returns(13) and newlines(10)
  276. it requires the printhead to move. Therefore, it requires its printer to
  277. perform a carriage return or linefeed if and only if it receives one. See Vbar
  278. below for some details. In JGPrint mode it is possible to set parameters in the
  279. configuration file to send <nl> rather than <cr><nl>.
  280.  
  281. .cp 6
  282. .col
  283. \s2|JGDoc's Queries
  284.  
  285. In certain rare circumstances JGDoc will need to know whether the JGCopy file
  286. is intended to be copied to the screen or passed to the printer, and, if so,
  287. will enquire "Forscreen?(Y) :"; At the moment (1991), 'vertical bars' is the
  288. only documenter's directive that requires this cooperation from the user, but I
  289. do not exclude the possibility of adding more if needed.
  290.  
  291. .col
  292. \s2|.Singlesheets
  293.  
  294. JGDoc is set up for printers that do not require any extra characters, e.g.
  295. FormFeed between pages. If your printer is such, you will have to use JGPrint
  296. with a suitable configuration file.
  297.  
  298. See below for guttering, allowing wider margins on alternate sides to make
  299. binding produce a better effect.
  300.  
  301. .cp 12
  302. .col
  303. \s1|The Documenter's needs
  304.  
  305. A general word of advice: particularly if you are using the more advanced
  306. formatting facilities, getting it right first time is rare. Using JGDoc involves
  307. developing and debugging the layout of your documents. You will probably find
  308. JGPrint mode more convenient (see JGPrintDoc) if you are developing a
  309. complicated text. (To c or to <file>, so you can see the text on the screen as
  310. JGPrint lays it out.)
  311.  
  312. .cp 6
  313. .col
  314. \s2=0|Distribution Fees
  315.  
  316. If you distribute software with documentation (prepared) using JGDoc/Print, a
  317. copy of the product and its documentation is to be sent to me with a free
  318. licence subject to your normal conditions for my full use of the product. On
  319. 'sale' of your 100th. copy you pay me as full and final fee the full normal
  320. end\-user charge for your product. Variations for odd circumstances are proposed
  321. in JGLiceDoc.
  322.  
  323. .cp 6
  324. .col
  325. \s2|Comments and Diagnostics
  326.  
  327. When preparing a document for JGDoc, it will normally be the case that a partial
  328. document will be tried out several times on the way, and it may well be that
  329. various parts may need to be commented out, either because it is text that you
  330. are not sure whether or not to include, or directives whose effects you are not
  331. entirely sure of. Furthermore, JGDoc may not be able to understand the
  332. directives you have presented it with. Therefore, JGDoc provides:-
  333.  
  334. .setst |\h3|      see tabs and undented lines below
  335. .nost
  336. \t\s3 \t.//, which causes the line that follows it to be ignored in the target
  337. text doc.whatever, but to come out in JGDoc's screen window. Another use for
  338. this is to help locate a diagnostic report which has not given sufficient
  339. context to be recognised, by bracketting it between successively closer
  340. comments. (In the desktop it is ignored.)
  341.  
  342. An alternative way to skip unwanted text is provided by .if/.fi (see below).
  343.  
  344. .nost
  345. \t\s3 \t<Diagnostic Report>/Enddoc(Y/J) : or Report Window Report/Enddoc, with
  346. buttons Quit/Continue/Jot is put out whenever JGPrint/JGDoc suspects something
  347. is wrong. The message, derived usually from JGPStrings, should be
  348. self\-explanatory, but I may not always have been successful in pointing you to
  349. where the problem is. NB. Jot is not available in JGDoc.
  350.  
  351. In JGPrint, Jot enables you to write to the Jotfile Jot>, so that you can check
  352. up on what went wrong.
  353.  
  354. .cp 12
  355. .cp 6
  356. .col
  357. \s2|Running Heads
  358.  
  359. .setst ::
  360. If JGDoc is not providing pages, there will be a header, and the body of the
  361. document will follow. Otherwise pages each begin with the header, end with the
  362. footer, and place the body of the text between these. If no header is specified,
  363. a default of 3 blank lines is provided; if no footer is specified, a default of
  364. 3 blank lines is provided. JGDoc may sometimes leave an extra line before or
  365. after the footer in order to make the page break sensible, and avoid widow or
  366. orphan lines.
  367.  
  368. Although headers and footers are normally set in the prologue, there is no
  369. reason why they should not be reset in the body of a document, usually before a
  370. page\-break. This document is an example where this is done for the header, but
  371. not the footer. Therefore, JGDoc provides:-
  372.  
  373. .setst |\h3|
  374. .nost
  375. \t\s3 \t.hd <Bracketted string>, which holds the bracketted string for use at
  376. the head of each page.
  377.  
  378. .nost
  379. \t\s3 \t.ft <Bracketted string>, which holds the bracketted string for use at
  380. the foot of each page.
  381.  
  382. .nost
  383. \t\s3 \t\\p outputs the current page number whenever it is encountered. It is
  384. most useful in running heads, but works just as well in the text body.
  385.  
  386. The bracketted string is restricted to a maximum of 255 characters. The bracket
  387. is the first ink character (bytes 33-126) encountered after .hd/ft. It is my
  388. normal practice to use a punctuation character which I don't want in my
  389. header\/footer string; I also normally put these brackets on separate lines.
  390.  
  391. Only blank lines, 'col'led lines or barred lines are allowed in running heads.
  392.  
  393. Running heads are always put out in the base layout, ie. with the margins etc.
  394. that apply at the end of the prologue, ignoring later changes.
  395.  
  396. The default Initial header and footer are put to 3 blank lines in JGDoc mode; if
  397. this is not convenient for your printer, you can always put in in what you need
  398. explicitly. See JGPrintDoc for the greater flexibility available in JGPrint
  399. mode.
  400.  
  401.  
  402. .cp 12
  403. .cp 6
  404. .col
  405. \s2|Barred and Colled Lines
  406.  
  407. .setst ::
  408. It is useful to be able to draw horizontal and vertical lines on the page when
  409. setting out, say, a table; it is also useful to be able to centre, range left or
  410. range right some text on a line.
  411.  
  412. JGDoc provides facilities for putting a bar of a given character across the
  413. page between the current margins, and of dividing up a line into three clumps of
  414. text, respectively ranged left, centred and ranged right. (For Vertical bars see
  415. below.) Therefore, JGDoc provides:-
  416.  
  417. .setst |\h3|
  418. .nost
  419. \t\s3 \t.bar <ch> {<n1> <n2>} which spreads a line of <ch>s across the page.
  420.  
  421. .nost
  422. \t\s3 \t.col <nl> <str1> {|<str2> {|<str3>{|}}} ranges <str1> left, centres
  423. <str2> and ranges <str3> right. NB {..} shows what parts can be left out, and
  424. very often are. See the examples of the various uses throughout this
  425. documentation.
  426.  
  427. The third optional | in .col enables blanks to pad the right\-ranged string to
  428. the right. This is useful to provide a right ranged, left aligned address. (I
  429. did this at the bottom of Rdmedoc/!Clickme.) Strings may be, and often are,
  430. empty. If you want to put ranged left and ranged right strings on a line, you
  431. cannot use an empty centre string, since JGDoc construes || as a single | to be
  432. put in a string. A string consisting of a blank character as the centre string
  433. will produce the required effect.
  434.  
  435. The optional integers in .bar allow a part-line from <n1> to <n2> char columns
  436. to be put out; thus these two optional numbers bar allow lines partway accross
  437. the screen; for an example see Exlongd. <ch> may be a hatty, and may be preceded
  438. by certain backslashes, eg underline or bold. The user is recommended to
  439. experiment to see whether what she wants is available.
  440.  
  441. .cp 12
  442. .col
  443. \s2|Tabs and Vertical Bars
  444.  
  445. .setst ::
  446. It is useful to be able to set and effect tabs; it is also useful to be able to
  447. set positions for vertical bars to appear on a page, and then
  448. independently,switch this on and off. Therefore, JGDoc provides:-
  449.  
  450. .setst |\h3|
  451. .nost
  452. \t\s3 \t.ht <n1> <n2>.... which sets tab positions at <n1>, <n2>,.... relative
  453. to the left margin.
  454.  
  455. .nost
  456. \t\s3 \t\\t effects a tab to the first tab column to the right of where JGDoc is
  457. on the line.
  458.  
  459. .nost
  460. \t\s3 \t\\<h<n> effects a tab to the nth. tab from the left margin.
  461.  
  462. .nost
  463. \t\s3  \t.vbar <c> <n1> <n2>... set positions for the character <c> to be put on
  464. each line in addition to the text actually specified.
  465.  
  466. .nost
  467. \t\s3 \t.vbsw {+} switches on and off printing in the current vertical bar
  468. positions.
  469.  
  470. .nost
  471. \t\s3 \t.vt <n1> <n2>.... which sets vertical tab positions at <n1> <n2>
  472. relative to the top of the page (not top of text body). Units of lines (n<100>
  473. can be used.
  474.  
  475. .nost
  476. \t\s3 \t\\v effects a vertical tab to the next setting.
  477.  
  478. The <n1> <n2>... must be monotonically increasing. <n1> for tabs must be
  479. positive, but for vbar can be 0. It is often better to cancel filling and
  480. justification when using tabbing, since otherwise you will not know where JGDoc
  481. is on the line when you effect a tab. Colled lines are not vbarred; nor are
  482. empty lines. A trick for the latter is to put <ch>\\w on the line, since \\w
  483. signifies wipe out a character. \\w can also be useful for extending the range
  484. of effects produced by tabbing. The initial default has no tabs or vertical bars
  485. set.
  486.  
  487. A problem can arise if the word following a tab is too wide to fit in before the
  488. right margin. In this case, one of my 'longstop' diagnostics catches the
  489. overflow with the report "Word/Line too long. Alleged...." where ... is the
  490. overlong line. This may contain one or more examples of \\}<n>, which are
  491. rightwards printhead-moving directives. You should either move your tabs or
  492. widen your margins.
  493.  
  494. Note that changing the configuration file used, or changing cpi or to or from
  495. proportional spacing, will affect whether or not you encounter this problem. I
  496. think this is the only use made of my longstops that directly affects the user;
  497. they are principally provided for development purposes.
  498.  
  499. Vertical bars are implemented by printing a barred line in two passes with
  500. <cr>(13) between them. Warning: typing to screen, editors and word\-processors
  501. may treat this as <cr><lf>, putting the two passes on separate lines. Look at a
  502. dumped doc-file to see what actually happens. If you use .vbar, as in this
  503. document, JGDoc will ask you whether or not your JGDocced file is "For Printer";
  504. this enables it to put out the right bytes to move the 'printhead' without
  505. wiping out what was below it.
  506.  
  507. JGDoc may sometimes output <13><10><10> for two or more newlines. This will
  508. produce correct results on printers set to accept literally the characters
  509. passed to them, and not to put in extra characters. Doc-files with vertical bars
  510. cannot be resubmitted to JGDoc.
  511.  
  512. If the left margin is altered after a tab or vertical bar is set, the position
  513. of the tab or bar remains unaltered relative to the left edge, changing
  514. relative to the margin.
  515.  
  516. \\a, \\c, \\r are other kinds of horizontal tabs: arithmetic, aligning a '.';
  517. centre; aligning the centre of the next word; right, aligning the end of the
  518. next word.
  519.  
  520. See ExTab for examples.
  521.  
  522. .cp 12
  523. .col
  524. \s2|Filling and Justification
  525.  
  526. .setst ::
  527. It is useful to be able to choose either a vertically aligned or a ragged right
  528. margin. Sometimes, however, the source text should be set just as it is laid
  529. out. Sometimes an individual line split is needed at some particular place.
  530. Therefore, JGDoc provides:-
  531.  
  532. .setst |\h3|
  533. .nost
  534. \t\s3 \t.nofj (no fill or justify) copies the source document verbatim save
  535. that, if there are too many words to put between current margins, the last word
  536. (or more if needed) is put on a new line, rather than allowing the new line to
  537. come in the middle of a word.
  538.  
  539. .nost
  540. \t\s3 \t.fill copies successive words onto a line until the next one would cause
  541. an overflow. Extra spaces between words are ignored.
  542.  
  543. .nost
  544. \t\s3 \t.fj fills, and justifies by scattering extra spaces between words in the
  545. line so that the right margin is right aligned.
  546.  
  547. .nost
  548. \t\s3 \t\\| (Line split) cancels filling to force a short line.
  549.  
  550. Filling and justifying are stopped by a blank line, most dotty commands or a
  551. line split. Tab bytes are construed as spaces, page throw bytes as new lines.
  552. The default condition is filling and justifying.
  553.  
  554. Documents from JGPrint prepared with .fgfj or .jgfj (fairly good or jolly good
  555. fill and justification) will come out on JGDoc as though .fj were set.
  556.  
  557. .cp 12
  558. .col
  559. \s2|Paragraphs, Pagebreaks and Figures
  560.  
  561. .setst ::
  562. Paragraphs are construed as being ended by a blank line. However, you may or may
  563. not want a blank line between the paragraphs of your final text, and you may
  564. want the first line of paragraphs to be indented some number of positions. You
  565. may want to force a page break at some point in your text, or to force it only
  566. if the next few lines would otherwise be split between two pages. You may want
  567. to leave a number of lines blank, and require that these lines are kept on one
  568. page. You may want to reset the page numbering or start with a page other than
  569. 1. Therefore, JGDoc provides:-
  570.  
  571. .setst |\h3|
  572. .nost
  573. \t\s3 \t.parsep {<n>} with <n>=1 to put a blank line between paragraphs, with
  574. <n>=0 to put the first line of a paragraph hard below the last line of the
  575. preceeding paragraph. NB. if <n> > 3, then in JGPrint <n>/100 Line spacing will
  576. be provided; JGCopy will show at least a full extra line
  577.  
  578. .nost
  579. \t\s3 \t.parind <n> to indent the first line of a paragraph by <n> character
  580. positions.
  581.  
  582. .nost
  583. \t\s3 \t.page to force a page break.
  584.  
  585. .nost
  586. \t\s3 \t.cp <n> to force a conditional page break if fewer than <n> lines remain
  587. on the page outside the running heads.
  588.  
  589. .nost
  590. \t\s3 \t.fig <n> to leave <n> unbroken blank lines in the text.
  591.  
  592. .nost
  593. \t\s3 \t.pgno <n> to reset the pagenumber after the next page break.
  594.  
  595. The default condition is .parsep 1, .parind 0. If .sp is set to 0, .page and
  596. ..cp are ignored. There is a notional pagebreak before the first page.
  597.  
  598. ..graph <n> <n1> {<n2> }* 256, where the <n1>, <n2> <= 255, is an extension of
  599. ..fig <n>, but ignores <n1> and passes the <n2> direct to the printer; it is the
  600. user's responsibility to see that the printhead moves down the required <n>
  601. lines. ..defch n {<n1> }* 256 is similar without moving the printhead, and could
  602. be used to send an initialising string to the printer. The extra number should
  603. be small, eg 1. These facilities are for printer buffs.
  604.  
  605. .cp 12
  606. .col
  607. \s2|Hard Spaces, Hyphens and Topset Bytes
  608.  
  609. .setst ::
  610. You may not want two words to be split between lines, even though there is a
  611. space between them, or you may want to cancel the way fill eats up multiple
  612. spaces. You may be willing to split a pair of words with a hyphen if this will
  613. help to get well\-justified lines. You may want to send particular bytes to your
  614. printer outside the standard 33-127. Therefore, JGDoc provides:-
  615.  
  616. .setst |\h3|
  617. .nost
  618. \t\s3 \t\\<sp>, a hard space that acts like an ink character as far as filling
  619. and justifying are concerned but actually puts no ink on the page.
  620.  
  621. .nost
  622. \t\s3 \t\\- is the shown hyphen in that the - appears between the words whether
  623. they are split between two lines or not.
  624.  
  625. .nost
  626. \t\s3 \t\\_ is the hidden hyphen, in that it does not appear if a split does not
  627. occur.
  628.  
  629. .nost
  630. \t\s3 \t^^<c> sends to the output the byte 128 above the one which represents
  631. <c>.
  632.  
  633. There is another shown hyphen \\/ for use in long alternation lists; the hatty
  634. ^^<c> is less convenient than JGPrint's where the configuration selected defines
  635. the hatty mapping for the individual printer; indeed I only included it to
  636. simplify my coding and cope, somehow, with hatties that may have been used in
  637. documents originally provided for JGPrint. JGDoc treats all 255 bytes, only
  638. interpreting <0>,  <9>, <10>, <12>, <13> <127>, so that if your editor can
  639. produce these bytes directly, you have no need for the hatties.
  640.  
  641. It is probably better to insert top-bit set, and indeed bytes 0-31 directly from
  642. the keyboard, but, remember, you will get the printers sign for these bytes, not
  643. what you will see on screen. JGPrint can accept all bytes directly except 0,
  644. which must be sent via a hatty, but JGEd, and probably other editors will
  645. probably have problems with some other control bytes. See JGPrint for further
  646. discussion of how to send VDU bytes to the printer.
  647.  
  648. .cp 12
  649. .col
  650. \s2|Undented lines
  651.  
  652. .setst ::
  653. You may want your indented text's left margin to be to the right of the
  654. beginning of certain particular 'undented' lines, as is the case for the
  655. numbered list of JGDoc directives in this document. JGDoc does this by setting
  656. a 'startstring' at the beginning of every line that is not to be undented. This
  657. startstring will consist of a number of spaces, though there is nothing in the
  658. mechanism to prevent ink characters being used. Tabs may be used to set the
  659. blank space width required. Therefore, JGDoc provides:-
  660.  
  661. .setst |\h3|
  662. .nost
  663. \t\s3 \t.setst <Bracketted string> to set the required 'startstring'.
  664.  
  665. .nost
  666. \t\s3 \t.nost to cancel the use of the 'startstring' for the following line.
  667.  
  668. Blank lines, barred lines and colled lines do not have the start\_string
  669. prepended to them. As with vbarring, <ch>\\w  will give you a pseudo blank line to
  670. to which the start\_string will be prepended. This, of course, is only useful
  671. if the start\_string contains non\-blank characters.
  672.  
  673. The indent is fixed relative to the left margin, even if margins or tabsets are
  674. changed between a setst and a line for which it is used.
  675.  
  676. ..setend/.noend are analogous for the right margin. Undenting is not very
  677. useful, but the same mechanism can be used to mark certain paragraphs etc.
  678.  
  679. .cp 12
  680. .col
  681. \s2|Section numbers
  682.  
  683. .setst ::
  684. It is useful, as here, to have a way of numbering sections to some depth, and
  685. restarting the numbers when required. Therefore, JGDoc provides:-
  686.  
  687. .setst |\h3|
  688. .nost
  689. \t\s3 \t\\s<n> which increments the section number at level n, and then puts out
  690. the current section numbers from levels 1 to <n>-1, separated by dots, followed
  691. by a dot, followed by the section number at level <n>; it then 'zeroes' section
  692. numbers from <n>+1 to 9, the maximum available.
  693.  
  694. .nost
  695. \t\s3 \t\\s<n>=<m> acts as above, but sets the section number at level n to the
  696. integer m. This solves the resetting problem (\\s1=1).
  697.  
  698. The description above is slightly simplified. Section numbers other than the
  699. last printed cannot be zero, so if, say, an \\s3 appears without a preceeding
  700. \\s2 and \\s1, it will come out as 1.1.1 rather than 0.0.1. Also section numbers
  701. in running heads do not increment, but merely repeat the number. Initially, all
  702. section levels are zeroed.
  703.  
  704. \\s0 means put out a section number to the level last specified. This partly
  705. solves the running head problem mentioned in the previous paragraph. \\s<n>+<m>
  706. and \\s<n>-<m>, .pushsect, .popsect and .setc a.A.1 etc. are also available.
  707.  
  708. .cp 12
  709. .col
  710. \s2|Conditionals
  711.  
  712. .setst ::
  713. .setc 0.0.0.A
  714. It is useful to have a way of including or excluding sections of text according
  715. to local conditions. One such condition is whether one is on an odd or even
  716. page. Therefore, JGDoc provides:-
  717.  
  718. .setst |\h3|
  719. .nost
  720. \t\s3 \t.if <truthvalue> introduces a conditionally included chunk of text.
  721.  
  722. .nost
  723. \t\s3 \t.else swaps the truth\-value conditions (optional).
  724.  
  725. .nost
  726. \t\s3 \t.fi ends the conditionally included text.
  727.  
  728. .nost
  729. \t\s3 \t\\o outputs 1 on odd pages and 0 on even pages.
  730.  
  731. .nost
  732. \t\s3 \t<truthvalue> is a string of characters construed as true or false
  733. according to the following rules:\|
  734. \s4 0 is false;\|
  735. \s4 A positive integer is true;\|
  736. \s4 y, yes, t, true are true, as are their upper case equivalents;\|
  737. \s4 all other strings are false.
  738.  
  739. I used this in the header with \\o, but conditionals can appear anywhere. .if 0
  740. ....... .fi is a useful alternative method of switching out a chunk of text;
  741. replacing the zero by one will, of course, put it back.
  742.  
  743. Conditionals can be nested. .elseif <truthvalue> and .orif <truthvalue> are
  744. also available. Three\-string conditionals are available; the middle string
  745. must be one of eq, ne, lt, le, ge, gt relations, or their upper\-case
  746. equivalents. The comparison is arithmetic if both the first and third string
  747. are numerals, lexicographic, with lower\-case letters internally made
  748. upper\-case, otherwise.
  749.  
  750. Conditional text beginning with a dot assumes what follows to be a dotty;
  751. otherwise the conditional text abuts what preceeds and follows it. See the use
  752. of .if etc in these documents for how to ensure that there is a space between
  753. what preceeds a .if and what follows it.
  754.  
  755. .setst ::
  756. .makel intro
  757. .cp 12
  758. \s2|Guttering
  759.  
  760. If you are intending to bind what you are printing, it is useful to have a wider
  761. margin on the binding side of each page, an extra 2 or 3 characters width say.
  762. Therefore,jgdoc provides:
  763.  
  764. .setst |\h3|
  765. .makel directvs
  766. .nost
  767. \t\s3 \t.gute {-}<n> which provides guttering of an extra <n> character widths
  768. on the left margin on even pages, -n on odd pages if the '-' is not present; if
  769. the '-' is present, the extra left margin comes on odd pages, with even pages
  770. having the narrower margin.
  771.  
  772. I think this is the only place in JGPrint where the user may have to supply a
  773. negative number.
  774.  
  775. My experience is that 2-3 character widths are suitable for most kinds of
  776. binding, but you should experiment this and left margin to get what you want.
  777.  
  778. As mentioned above, this advanced facility may be helpful to readers using JGDoc
  779. eho want to bind the documentation theu print out.
  780.  
  781. .usel intro
  782. .cp 12
  783. .col
  784. \s2|layouts
  785.  
  786. It is useful to have a way of saving and restoring the current layout, in order
  787. to achieve reliable consistency of style in big documents. Therefore, JGDoc
  788. provides:-
  789.  
  790. .usel directvs
  791. .nost
  792. \t\s3 \t.makel <string> saves (most of) the current state of JGDoc.
  793.  
  794. .nost
  795. \t\s3 \t.usel <string> reinstates the state that applied when the layout
  796. <string> was defined.
  797.  
  798. The problem with this facility was the decision as to how much of JGDoc's state
  799. is to be saved as a layout. As common sense suggests, the current page\-number
  800. or section numbers obviously aren't, but margins, tabs, paragraph settings,
  801. justify settings and start- and end\-strings should be and are.
  802.  
  803. The layout defined at the end of the prologue is made available under the name
  804. 'base'.
  805.  
  806. ..pushl <string>, .popl are also available.
  807.  
  808. HP style printers require font defining codes to be specified to the printer in
  809. a particular sequence, and the implementation of Usel has been tailored to
  810. provide this. The directive .font <n> only has an effect in JGPrint.
  811.  
  812. .setu 1 'Therefore, JGDoc provides:-'
  813. .setm 2 *.nost
  814. \t\s3 \t*
  815. .usel intro
  816. .cp 12
  817. .col
  818. \s2|User Variables
  819.  
  820. In well\-structured documents, there is often a lot of repetition both of
  821. ordinary text, and of sequences of directives. It is nice to be able to define
  822. any of these once, and have a simple way of including it in the text. \u1
  823.  
  824. .usel directvs
  825. \u2..setu <n> <bracketted string> defines the user variable <n> to be the
  826. <bracketted string>, interpreting any directives within it as it does so.
  827.  
  828. \u2..setm <n> <bracketted string> defines the user variable <n> to the
  829. <bracketted string>, copying without interpretation.
  830.  
  831. \u2\\u<n> embeds the user variable string in the text being read, interpreting
  832. it as it does so for those set with .setm.
  833.  
  834. The bracketted strings are restricted to 255 characters. Strings may be nested.
  835. \\u0 specifies a string to be inserted from the keyboard, which will be prompted
  836. for.
  837.  
  838. I regard user strings as quite the most powerful tools of JGDoc. I have
  839. refrained from using them before here, since this documentation is also an
  840. introductory teaching document; but I do so now to exhibit their use;
  841. I would normally have moved the .setu and .setm up to the prologue, and used
  842. \\u1 and \\u2 throughout, both to avoid typing errors and to discipline
  843. regularity in the text.
  844.  
  845. If you have defined user variables, JGPrint, but not JGDoc will, on exit, offer
  846. you the opportunity of saving them in a file you choose. Its format is quite
  847. transparent. JGPrint would enable you to input this file to preset user
  848. variables on another run, but JGDoc can't specify where to find this file. You
  849. could achieve cross\-reference within and between files by putting them in by
  850. hand but this is tedious...
  851.  
  852. NB. Multi-lined user strings which include dotties require care in realising
  853. precisely how many newlines will in fact be present. It is good practice to put
  854. your brackets on two otherwise empty lines, which implies that the string will
  855. itself contain newlines at beginning and end. A '.' immediately following the
  856. first bracket will be treated as <nl> '.'; a dotty immediately preceeding the
  857. last bracket will, as everywhere else, 'swallow the new line following itself.
  858. ..rpt (see below) will probably need some fine tuning to get what you want.
  859.  
  860. .usel intro
  861. .cp 6
  862. .col
  863. \s2|Included Files
  864.  
  865. For large documents, it is often convenient to divide them up into several files
  866. and call these from a driving file. Indeed, the specification of common layouts
  867. and user strings can conveniently be put into this driving file. Another
  868. approach is to have independent files, each of which calls on a common file to
  869. set its layouts and user strings. \u1
  870.  
  871. .usel directvs
  872. \u2\\+<filespec> includes the file <filespec> into the text being read.
  873.  
  874. Include files can be nested to any reasonable level; the file should be
  875. specified as from the directory in which the original 'from' file was found.
  876.  
  877. See JGEdDoc/JGEd1Doc for a simple example; ExTime/ExTimeLay for a another.
  878.  
  879. .usel intro
  880. .cp 6
  881. .col
  882. \s2|Merge Files
  883.  
  884. It is useful to be able to have a text frame, into which can be slotted the
  885. fields from successive records, so that the same letter can be sent to a set of
  886. recipients etc. Two examples of possible use are provided by exmerge, with
  887. exmergm, and exlbl with exlblm in the XMP directory. There is some tutorial
  888. material after the body of each of these files.
  889.  
  890. JGDoc reports, with the name of the descriptor, for you to specify a merge file
  891. from which records can then be drawn. In JGPrint mode, it is, alternatively,
  892. possible to specify the merge file during the initial dialogue. In the Own
  893. window, this file may be specified as from the directory in which the original
  894. 'from' file was found.
  895.  
  896. \u1
  897.  
  898. .usel directvs
  899. \u2\\f<descriptor><t> includes the field corresponding, in the current record,
  900. to <descriptor>; the terminator <t> can be a space, a newline, or }.
  901.  
  902. \u2\\g reads in the next record.
  903.  
  904. If the last record of the merge file has not been read by the end of the text,
  905. the next record is read, and the text restarted.
  906.  
  907. .usel intro
  908. .cp 6
  909. .col
  910. \s2|Indexing
  911.  
  912. It is useful to be able to mark phrases in the text, and obtain a list of
  913. whereabouts these are in the text, page, line, section number.
  914.  
  915. \u1
  916.  
  917. .usel directvs
  918. \u2\\i....\\j brackets a phrase which is put out, with the current page, line,
  919. section in an index file.
  920.  
  921. \u2\\k within these brackets causes what remains between \\k and \\j to go to
  922. the index file only.
  923.  
  924. .usel intro
  925. .cp 6
  926. .col
  927. \s2|Internal repetition
  928.  
  929. If many copies of a short message are wanted, it is wasteful to put each on a
  930. separate sheet. If you simply put multiple copies in your text, the page end
  931. will usually cut the last one on each page in two. \u1
  932.  
  933. .usel directvs
  934. \u2..rpt <n> <b><text><b> will insert <text> as many times on a page as there
  935. is room for, and continue to do so until <n> copies have been printed. It may
  936. be useful to leave an empty line or two before the second <b> to facilitate
  937. cutting the copies apart.
  938.  
  939. It is often useful to combine this with \\f and \\g from a merge file. JGDoc
  940. assumes that the next instance will be vertically as big as the preceeding
  941. instance. If <n> is 0, repetition will continue until the merge file is
  942. exhausted. See EXLBL/LBLM for how to use these facilities for printing labels.
  943.  
  944. .cp 9
  945. .col
  946. |Absence of Restriction
  947.  
  948. .usel intro
  949. There was some discussion as to whether or not it was appropriate to allow
  950. merge files, index files and repetition in JGSharEd/Doc, on the grounds that
  951. these were unusually powerful and useful capabilities to provide in a public
  952. domain program. I thought to restrict their use numerically, but felt this to be
  953. inelegant.
  954.  
  955. However, I do regard anyone who uses these facilities extensively without
  956. having bought a licence to JGPrint as a thieving knave.
  957.  
  958. .cp 6
  959. .col
  960. \s1|Epilogue
  961.  
  962. I hope I have documented all the facilities I have used in this document, and
  963. used the majority of those listed under a section number. I know that only a
  964. very few of those also mentioned have been used, since I have wanted to keep
  965. this document relatively straightforward as an introduction to JGDoc. In the
  966. directory XMP, if present, are example documents from my JGPrint collection,
  967. where I have quite gone to town (OTT) on use of the facilities. The file EXNOTE
  968. covers endnotes and footnotes which have not been mentioned here but are
  969. documented in EXNOTE itself. Some contain underlining and italicising
  970. directives that are ignored by JGDoc. Some directives, e.g. .rpt are used and
  971. commented on.
  972.  
  973. Certain of these, if JGPrinted to screen, are demanding in space, and may
  974. require mode 16 if their right margin is wider than 80 (EXTAB, EXLBL, EXLONGD
  975. etc.)
  976.  
  977. EXLAYOUT and EXMERGE reset vertical spacing and cause warning reports in JGDoc
  978. mode.
  979.  
  980. I have put, as oxdiary, a result of JGDOCcing EXDIARY
  981.  
  982. Good luck with these; some are quite difficult to work out, and you may need to
  983. see the source and result together.
  984.  
  985. .cp 6
  986. .col
  987. \s2|The mouse
  988.  
  989. The mouse can be clicked in response to JGDoc and JGPrint's dialogue prompts in
  990. JGPrint's own window. See JGPrintDoc for the rules of the game.
  991.  
  992. .cp 6
  993. \.col
  994. \s2|JGSharePr
  995.  
  996. In order to convert JGDoc to JG(Share)Pr(int), remove the initial '*s' from the
  997. first line of !jgp.Info.JGPStrings. !JGCnfig, accessible from JGPrint's desktop menu,
  998. will edit the configuration files in !jgp.pa and !jgp.q needed by
  999. JGSharepr\/JGPrint.
  1000.  
  1001. JGSharePr imposes restrictions outside JGDoc mode, except when JGPrinting to
  1002. Screen.
  1003.  
  1004. .cp 6
  1005. .col
  1006. \s1|Funny .sp <n>
  1007.  
  1008. I suggested above that JGDoc's story of configuring n lines per page was a
  1009. simplification, and sometimes rounding errors can creep in.
  1010.  
  1011. The truth is that JGDoc works in terms of 2160 internal units per vertical inch,
  1012. and the default page length is set to 11" = 23760 units. A request for 66 lines
  1013. per page works out a line spacing of 23760/66 = 360 units = 1/6". If a request
  1014. were received for 65 or 67 there would be a rounding error since JGDoc's
  1015. configuration does not allow part\-line vertical motion.
  1016.  
  1017. Therefore, if you want to use such 'funny' numbers, it would be sensible to set
  1018. a suitable pagelength which was a multiple of the number of lines you wanted on
  1019. each page (eg. .pl 6500/.sp 65). Of course, in a file there is no absolute sense
  1020. of distance between lines to aim for. The full story is:-
  1021.  
  1022. .usel directvs
  1023. .nost
  1024. \t\s2 \t.pl <n> sets page length, where <n>\ <\ 20 is construed as inches, 20
  1025. and above as vertical units, i.e. small numbers are multiplied by 2160.
  1026.  
  1027. .nost
  1028. \t\s2 \t.sp <n> sets line spacing, where <n>\ <=\ 10 is construed as lines
  1029. per inch i.e. 2160/<n>, 10\ <\ <n>\ <=\ 120 is construed as lines per page,
  1030. i.\ e. <pagelength>/<n>; 120 and above are directly construed as vertical units.
  1031.  
  1032. In JGPrint mode, .sp <n> affects the depth each line's spacing is deemed to
  1033. occupy, so that the number of lines that fit on a page becomes changed whenever
  1034. a .sp is encountered.
  1035.  
  1036. On an 11" page, .cpi 6, .cpi 66, and .cpi 360 all set spacing to 6 lines per
  1037. inch.
  1038. .cp 6
  1039. .col
  1040. \s1|Editor Choice
  1041. .usel base
  1042.  
  1043. Any editor capable of generating pure ascii text can be used to generate a
  1044. JGPrint/Doc file. JG(Share)Print will cope with any method your editor may use
  1045. to signify a line\-break, and will accept any byte greater than 13 as as a
  1046. character to print. In JGPrint mode, using a suitable configuration file, all
  1047. bytes can be used to print a character.
  1048.  
  1049. JG(shar)Ed has the extended command fp (reformat for JGPrint) which does not
  1050. affect lines beginning with '.', and provides online documentation for JGPrint
  1051. directives; this is helpful, but is not a particularly important reason to use
  1052. JG(Shar)Ed with JG(Shar)EPr. The better reason is that JG(Shar)Ed is a Jolly
  1053. Good Editor.
  1054.