home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 215.lha / NRO / nro.n < prev    next >
Text File  |  1996-02-15  |  29KB  |  713 lines

  1. .tm Entering macro file
  2. .so an
  3. .tm Entering main file
  4. .TH NRO 1 "AM*GA Programmer's Manual" "KosmoSoft" "Version 1.5"
  5. .de cmd
  6. !sp $1;!ne 2;!ti -5;!bo "$0
  7. .en
  8. .de fun
  9. .sp $1;.ne 2;.ti -5;.bo "$0
  10. .en
  11. .SH NAME
  12. nro - text formatter
  13. .SH SYNOPSIS
  14. .in +5;.ta +0;.ti -5
  15. .bo "nro@t[-n] [+n] [-pxx] [-v] [-bx] [-rnx] [-rdx] [-rpx]
  16. .bo "[-mmfile] ifile ... [>ofile]
  17. .in -5;.ta
  18. .SH DESCRIPTION
  19. .ul "NRO
  20. is a text processor and formatter based on the design
  21. provided in
  22. .bo ""Software Tools"
  23. by Kernighan and Plauger. The text and commands found in the
  24. .cu "ifile(s)
  25. are processed to generate formatted text. The output may be directed into a
  26. file or to the printer, otherwise, the output will appear at the user
  27. console.
  28.  
  29. The
  30. .ul "+n
  31. option causes the output to start with page
  32. .ul "n.
  33. The
  34. .ul "-n
  35. option causes the output to stop after page
  36. .ul "n.
  37.  
  38. The
  39. .ul "-v
  40. option prints the version number to the console. Specifying a higher
  41. numerical argument makes
  42. .bo "NRO
  43. more and more verbose.
  44.  
  45. The
  46. .ul "-p
  47. option causes the output to be shifted to the right by
  48. .ul "xx
  49. spaces. This has the same effect as the
  50. .bo "@.po
  51. command.
  52.  
  53. The
  54. .ul "-b
  55. option with argument
  56. .ul "x
  57. controls if backspaces appear in the output text when underlining or
  58. overstriking. This has the same effect as the
  59. .bo "@.bs
  60. command with the same argument.
  61.  
  62. The
  63. .ul "-r
  64. options allow you to specify how much memory is allocated for macro
  65. definitions and related things. The
  66. .ul "-rn
  67. option lets you specify how many macros you may define while your text is
  68. being formatted. Default is 512. The
  69. .ul "-rd
  70. option lets you specify how much memory is reserved for keeping the
  71. contents of your macro definitions. Default is 20480 characters. The
  72. .ul "-rp
  73. option lets you specify how much characters may be pushed back into the
  74. input, when processing a macro evaluation. Default is 1024 characters.
  75. .br
  76. If any of these options is present they must be located before the first
  77. file to be processed to have any effect.
  78.  
  79. The
  80. .ul "-m
  81. option processes the file
  82. .ul "mfile
  83. for macro definitions. Note that files processed in this way should contain
  84. only macro definitions, no immediate output should be generated from this
  85. file.
  86. .PP
  87. Commands typically are distinguished by a period in column one of the input
  88. followed by a two character abbreviation for the command funtion. The
  89. abbreviation may then be followed by an optional numeric or character
  90. argument.
  91. .br
  92. The numeric argument may be an absolute value such as setting the right
  93. margin to a particular column, or the argument may be preceded by an
  94. operator to indicate that the parameter should be modified relative to a
  95. previous setting. You may use the operators +, -, /, *, % (mod), | (bitwise
  96. or), & (bitwise and), = (equal), < (less than) and > (greater than) to
  97. calculate values.
  98. .ul "No
  99. normal operator precedence is taken into account; the expression is
  100. evaluated strictly from left to right. You may use parentheses to group
  101. sub-expressions together. Note that all operators are dyadic, even the -.
  102. To generate a negative value, use a form like 0-5. A leading operator in an
  103. expression is not used in the evaluation. Instead, it has the effect of
  104. altering a previously set value. The + operator increases the set value
  105. with the given value, the - operator decreases the set value with the given
  106. value, the * operator multiplies the set value with the given value, and
  107. the / operator divides the set value by the given value. A leading operator
  108. within parentheses is ignored.
  109. .PP
  110. Commands that have effect on a given number of input lines, can also take a
  111. text argument, if it is preceded by a double quote character `"'. This
  112. behaves exactly as if you gave the number 1, and followed the command with
  113. the given text argument.
  114. .br
  115. More text or commands may follow a command if they are seperated by a
  116. semicolon `;', unless the first command must be the last one on an input
  117. line.
  118.  
  119. .tm ...commands
  120. The following commands are recognized:
  121. .in +5;.ta +0;.cc !
  122. !*---------------------------*
  123. !cmd .bo
  124. @tcauses the following lines of text to appear in boldface. The optional
  125. argument specifies the number of lines to be typed in boldface. An argument
  126. of zero explicitly turns boldface off, while a negative argument turns it
  127. on indefinitely. When overstrike is being used to produce the boldface,
  128. boldface and underlining are mutually exclusive features, and the
  129. appearance of a boldface command will cause any underlining to cease.
  130. !*---------------------------*
  131. !cmd .bp
  132. @tcauses succeeding text to appear at the top of a new page. The optional
  133. argument specifies the page number for the new page. The initial value is
  134. one and the default value is one more than the previous page number.
  135. !*---------------------------*
  136. !cmd .br
  137. @tcauses succeeding text to start on a new line at the current left margin.
  138. There is no argument for this command.
  139. !*---------------------------*
  140. !cmd .bs
  141. @tenables or disables the appearance of backspaces in the output text. A
  142. value of
  143. !cu "zero
  144. doesn't use backspaces at all, but utilizes standard ISO printer codes.
  145. The Commodore Amiga console and printer devices support these directly, but
  146. on other systems you need a post-processor to convert these standard ISO
  147. codes into, for example, Epson printer codes. If you don't want this,
  148. underlining and boldface can be done by inserting character - backspace -
  149. character combinations into the output. This is fine for devices which
  150. properly recognize the backspace character. Many printers, however, do not
  151. recognize backspaces, so the option is provided to overprint one line
  152. buffer with another. The first line buffer is terminated with just a
  153. carriage return rather than the carriage return - linefeed combination.
  154. !br;An argument of
  155. !cu "2
  156. to the backspace command removes backspaces from the output. Even with
  157. printers which do recognize backspaces, this usually is faster. An argument
  158. of
  159. !cu "1
  160. puts them into the output. The default is to use Commodore Amiga (ISO)
  161. control sequences.
  162. !*---------------------------*
  163. !cmd .cc
  164. @tchanges the
  165. !ul "NRO
  166. command character to that specified by the character argument. If no
  167. argument is provided, the default is a period.
  168. !*---------------------------*
  169. !cmd .ce
  170. @tcauses the next line of text to appear centered on the output. This
  171. automatically generates a break. The optional argument specifies if more
  172. than one line is to be centered. An argument of zero explicitly turns
  173. centering off, while a negative argument turns it on indefinitely.
  174. !*---------------------------*
  175. !cmd .cu
  176. @tcauses the next line(s) of text to be continuously underlined. Unlike the
  177. underline command (see
  178. !bo ".ul)
  179. which underlines only alphanumerics, continuous underlining underlines all
  180. printable characters. The optional argument specifies the number of lines
  181. of text to underlined. An argument of zero explicitly turns continuous
  182. underline off, while a negative argument turns it on indefinitely. Any
  183. normal underlining command currently in effect will be terminated.
  184. !*---------------------------*
  185. !cmd .de
  186. @tcauses all text and commands following to be used to define a macro. The
  187. definition is terminated by a line with
  188. !bo ".en
  189. as the first three characters. The rest of that line is ignored.
  190. !br;The first argument following the
  191. !bo ".de
  192. command becomes the name of the new command.
  193. !br;It should be noted that upper and lower case arguments are
  194. considered different. Thus, the commands
  195. !bo ".PP
  196. and
  197. !bo ".pp
  198. could define two different macros. Care should be exercised since existing
  199. commands and macros may be redefined. A macro may contain up to ten
  200. arguments. In the macro definition, the placement of arguments is
  201. designated by the two character sequences, $0, $1, ... $9.
  202. !br
  203. When the macro is invoked, each argument of the macro command line is
  204. substituted for its corresponding designator in the expansion. The first
  205. argument of the macro command is substituted for the $0 in the expansion,
  206. the second argument for the $1, and so forth. Arguments are typically
  207. strings which do not contain blanks or tabs. If an argument is to contain
  208. blanks, then it should be surrounded by either single or double quotes.
  209. !br
  210. A macro name may be at most ten characters long. If more are supplied, the
  211. results are unpredictable. To get things like $4 in the macro text, use a
  212. double $$, i.e. $$4.
  213. !*---------------------------*
  214. !cmd .ef
  215. @tspecifies the text for the footer on even numbered pages. The format is
  216. the same as for the footer command (see
  217. !bo ".fo).
  218. !*---------------------------*
  219. !cmd .eh
  220. @tspecifies the text for the header on even numbered pages. The format is
  221. the same as for the footer command (see
  222. !bo ".fo).
  223. !*---------------------------*
  224. !cmd .el
  225. @tSee
  226. !bo ".if
  227. and
  228. !bo ".ie.
  229. The
  230. !bo ".el
  231. command reverses the truth of the condition remembered by the last
  232. !bo ".ie.
  233. command, and if the result is true, it accepts the input on the remainder
  234. of the line, just like the
  235. !bo ".if
  236. command. Multi-line else-parts are thus also possible. You may have
  237. multiple
  238. !bo ".el
  239. request following a single
  240. !bo ".ie
  241. command. Since every
  242. !bo ".el
  243. reverses the remembered condition, you have if effect multiple 'then-' and
  244. 'else-parts', just divided into bits and pieces.
  245. !*---------------------------*
  246. !cmd .ev
  247. @tenvironment switch. If a numerical argument is given, the number of the
  248. current environment is pushed on a special environment number stack, and
  249. the named environment is made current. If no argument is supplied, the
  250. previous environment number that was in effect will be restored. As a
  251. variation of this, the command
  252. !bo ".ev -
  253. will restore the previous environment and
  254. !ul "discard
  255. the current environment. This is useful if you don't need the particular
  256. environment anymore. At a new invocation of this environment it will have
  257. default values again.
  258. !br
  259. The environment is the set of values that determine the appearance of
  260. formatted output. There are ten environments available, and up to nineteen
  261. environment numbers can be pushed. Because a stack of previous environment
  262. numbers is maintained, always return to a previous environment by a
  263. !bo ".ev
  264. command without numeric argument.
  265. !br
  266. The following commands affect values that are in the environment:
  267. !bo 2
  268. .ls .ti .in .rm .ce .ul .cu .it .ta .ju .nj .bo .fi .nf .pn .pc .cc and
  269. !bo ".c2.
  270. !br
  271. Also in the environment are the last remembered conditional,
  272. !bo ".ie,
  273. and collected partial output lines.
  274. !*---------------------------*
  275. !cmd .en
  276. @tdesignates the end of a macro definition.
  277. !*---------------------------*
  278. !cmd .fi
  279. @tcauses the input text to be rearranged or filled to obtain the maximum
  280. word count possible between the previously set left and right margins. No
  281. argument is expected.
  282. !*---------------------------*
  283. !cmd .fo
  284. @tspecifies text to be used for a footer. The footer text contains three
  285. strings seperated by a delimiter character. The first non-blank character
  286. following the command is designated as the delimiter. The first text string
  287. is left justified to the current indentation value (specified by
  288. !bo ".in).
  289. The second string is centered between the current indentation value and the
  290. current right margin value (specified by
  291. !bo ".rm).
  292. The third string is right justified to the current right margin value. The
  293. absence of footer text will result in the footer being printed as one blank
  294. line. The presence of the page number character (set by
  295. !bo ".pc)
  296. in the footer text results in the current page number being inserted at
  297. that position. Multiple occurrances of the page number character are
  298. allowed. This command must be the last command on an input line.
  299. !*---------------------------*
  300. !cmd .he
  301. @tspecifies text to be used for a header. The for
  302. mat is the same as for the
  303. footer (see
  304. !bo ".fo).
  305. !*---------------------------*
  306. !cmd .ie
  307. @tSame as
  308. !bo ".if,
  309. but remembers the resulting condition, that can be used by subsequent
  310. !bo ".el
  311. requests. Only one level of conditions is remembered: they cannot be
  312. nested. Every occurrence of a
  313. !bo ".ie
  314. request overrides the result as remembered by the previous one.
  315. !*---------------------------*
  316. !cmd .if
  317. @tConditional acceptance of input. The request is followed by a
  318. conditional, which may take several forms. Depending on the condition,
  319. subsequent input may be accepted or ignored. The following forms of
  320. condition are valid:
  321. !in +9;!ti -4;!nj
  322. !bo ".if [!]<letter>
  323. anything
  324. !ti -4;!bo ".if [!]<expression>
  325. anything
  326. !ti -4;!bo ".if [!]<delimiter> <string1> <delimiter> <string2> <delimiter>
  327. anything
  328. !in -9;!ju
  329. The following <letter>s may be used:
  330. !bo "o:
  331. Current page number is odd;
  332. !bo "e:
  333. Current page number is even;
  334. !bo "n:
  335. Formatter is
  336. !ul "NRO,
  337. which is always true;
  338. !bo "t:
  339. Formatter is TRO(FF), which is always false.
  340. !br
  341. An <expression> is said to be true if it is > 0.
  342. !br
  343. The last form is a string comparison, which is true if <string1> and
  344. <string2> are exactly equal. Any <delimiter> may be used as long as it
  345. doesn't make the conditional look like one of the other forms.
  346. !br
  347. A not-symbol `!' may immediately precede the condition to reverse its
  348. truth.
  349. !br
  350. Normally, the accepted or ignored input affected is only the rest of the
  351. current input line. A multi-line `then-part' must begin with the opening
  352. delimiter @@{ and the last line must end with the closing delimiter @@}. It
  353. may also be useful to conceal the newline following the opening delimiter
  354. if it is at the end of an input line. Because the delimiters are deleted
  355. from the input, make sure that the line is not empty without them, because
  356. this would cause a break. It is sufficient to place them on a line with a
  357. comment command to avoid this.
  358. !*---------------------------*
  359. !cmd .in
  360. @tindents the left margin to the column value specified by the argument.
  361. The default left margin is set to zero. This command performs a break.
  362. !*---------------------------*
  363. !cmd .it
  364. @tcauses the following lines of text to appear in italics. The optional
  365. argument specifies the number of lines to be typed in italics. An argument
  366. of zero explicitly turns italics off, while a negative argument turns it on
  367. indefinitely. This command is
  368. !bo "not
  369. functional when the Commodore Amiga (ISO) command sequences are not being
  370. used, since it can't be emulated by overstriking printlines.
  371. !*---------------------------*
  372. !cmd .ju
  373. @tcauses blanks to be inserted between words in a line of output in order
  374. to align or justify the right margin. The default is to justify. No
  375. argument is expected.
  376. !*---------------------------*
  377. !cmd .ls
  378. @tsets the line spacing to the value specified by the argument. The default
  379. is for single spacing.
  380. !*---------------------------*
  381. !cmd .m1
  382. @tspecifies the number of lines in the header margin. This is the space
  383. from the physical top of page to and including the header text. A value of
  384. zero causes the header to not be printed. A value of one causes the header
  385. to appear at the physical top of page. Larger argument values cause the
  386. appropriate number of blank lines to appear before the header is printed.
  387. !*---------------------------*
  388. !cmd .m2
  389. @tspecifies the number of blank lines to be printed between the header line
  390. and the first line of the processed text.
  391. !*---------------------------*
  392. !cmd .m3
  393. @tspecifies the number of blank lines to be printed between the last line
  394. of processed text and the footer line.
  395. !*---------------------------*
  396. !cmd .m4
  397. @tspecifies the number of lines in the footer margin. This command affects
  398. the footer the same way the
  399. !bo ".m1
  400. command affects the header.
  401. !*---------------------------*
  402. !cmd .ne
  403. @tspecifies a number of lines which should not be broken across a page
  404. boundary. If the number of lines remaining on a page is less than the value
  405. needed, then a new output page is started.
  406. !*---------------------------*
  407. !cmd .nf
  408. @tspecifies that succeeding text should be printed without rearrangement,
  409. or with no fill. The default is to justify. No argument is expected.
  410. !*---------------------------*
  411. !cmd .nj
  412. @tspecifies that no attempt should be made to align or justify the right
  413. margin. No argument is expected.
  414. !*---------------------------*
  415. !cmd .nr
  416. @tcauses the value of a number register to be set or modified. A total of
  417. twenty-six number registers are available designated @@na through @@nz
  418. (either upper or lower case is allowed). When the sequence @@nc is imbedded
  419. in the text, the current value of number register c replaces the sequence,
  420. thus, such things as paragraph numbering can be accomplished with relative
  421. ease.
  422. !*---------------------------*
  423. !cmd .of
  424. @tspecifies the text for the footer on odd numbered pages. The format is
  425. the same as the footer command (see
  426. !bo ".fo).
  427. !*---------------------------*
  428. !cmd .oh
  429. @tspecifies the text for the header on odd numbered pages. The format is
  430. the same as the footer command (see
  431. !bo ".fo).
  432. !*---------------------------*
  433. !cmd .pc
  434. @tspecifies the page number character to be used in headers and footers.
  435. The occurrance of this character in the header or footer text results in
  436. the current page number being printed. The default for this character is
  437. the hash mark `#'.
  438. !*---------------------------*
  439. !cmd .pl
  440. @tspecifies the page lenght or the number of lines per output page. The
  441. default is 66.
  442. !*---------------------------*
  443. !cmd .pn
  444. @tspecifies the way page numbering is done. You may specify the following
  445. values: 0 uses normal arabic page numbers, 1 generates lowercase roman
  446. numbers, and 2 specifies uppercase roman numbers. Default is arabic page
  447. numbering.
  448. !*---------------------------*
  449. !cmd .po
  450. @tspecifies a page offset value. This allows the formatted text to be
  451. shifted to the right by the number of spaces specified. This feature may
  452. also be invoked by a switch on the command line. All horizontal positions
  453. (like tabstops, indentations) are adjusted accordingly.
  454. !*---------------------------*
  455. !cmd .rm
  456. @tsets the column value for the right margin. The default is 80.
  457. !*---------------------------*
  458. !cmd .so
  459. @tcauses input to be retrieved from the file specified by the command's
  460. character string argument. The contents of the new file are inserted into
  461. the output stream until an EOF is detected. Processing of the original file
  462. is then resumed. File nesting is allowed up to a reasonable level (four).
  463. !*---------------------------*
  464. !cmd .sp
  465. @tspecifies a number of blank lines to be output before printing the next
  466. line of text. This automatically generates a break. You cannot move
  467. upwards.
  468. !*---------------------------*
  469. !cmd .ta
  470. @ttab settings. This command allows you to set tabstops. It may have
  471. optional numeric arguments. When issued without arguments, all tabstops are
  472. removed. When issued with one or more numeric arguments, tabstops are set
  473. at the specified number of spaces from the left hand side of the paper. An
  474. argument may optionally be preceded with a `+' to indicate that a distance
  475. from the previously mentioned tab is meant instead of an absolute position.
  476. A `+' sign before the first argument indicates a distance from the current
  477. indent.
  478. !*---------------------------*
  479. !cmd .ti
  480. @ttemporarily alters the indentation or left margin value for a single
  481. succeeding line of output text. This command performs a break. If an input
  482. line starts with spaces, this has the effect that a break is generated, and
  483. a temporary indent for the number of spaces is set.
  484. !*---------------------------*
  485. !cmd .tm
  486. @twrites a message to the standard error output, so you see it in your
  487. console window. This command must be the last one on an input line. When
  488. used with the no-break command character, this `no-break' gets another
  489. meaning: don't break the formatted output if it also is printed on the
  490. console. The command is ignored instead.
  491. !*---------------------------*
  492. !cmd .ul
  493. @tunderlines the alphanumeric text in the following line(s). The optional
  494. argument specifies the number of lines to be underlined. An argument of
  495. zero explicitly turns underlining off, while a negative argument turns it
  496. on indefinitely. When overstrike is being used to produce the underline,
  497. underlining and boldface are mutually exclusive features, and the
  498. appearance of an underline command cancels any existing boldface
  499. operations.
  500. !*---------------------------*
  501. !cmd .un
  502. @tundefines a previously defined macro, and all macros that were defined
  503. later. If this macro was a redefinition of an older macro with the same
  504. name, the old definition will be available again. Thus, macros are defined
  505. in a stack-like fashion.
  506. !cmd .*
  507. !cmd ." 0
  508. @tBoth of these serve as a way to insert comments in the input text. They
  509. have absolutely no effect on the output.
  510. !*---------------------------*
  511.  
  512. !cc
  513. .in -5;.PP
  514. .tm End of commands
  515. Instead of having the command immediately at the beginning of a line, you
  516. may also begin a line with a command character, then some blanks, and then
  517. again a command character, this time followed immediately by the command.
  518. There exists even a second command character, called the
  519. .bo "no break command character,
  520. `'', which suppresses the break normally generated by some commands. This
  521. no break command character can only be used in this way. If the first
  522. non-blank character is
  523. .ul "not
  524. a command character, it is considered to be text. An example illustrates
  525. this.
  526.  
  527. .RS 5;.nf
  528. @.    .sp   @@" This is a space command,
  529. @.    this is some normal text,
  530. @.    'sp 3 @@" and this spaces without a break.
  531. .RE;.fi
  532. .PP
  533. When a line does not begin with the command character, its words are placed
  534. one by one on an output line. As soon as a word doesn't fit, the collected
  535. line is printed, possibly after justification. The word is then placed on
  536. the next output line. If a line is about to be printed at the top of a
  537. page, the page header, if any, is printed first. If a line is on the last
  538. usable line of a page, the page footer, if any, is printed next, and the
  539. page is ejected.
  540. .br
  541. If you want to begin an input text line with an instance of the command
  542. character, you may precede it with the escape character.
  543. .PP
  544. A number of translations can be performed on the input, even before it is
  545. interpreted as either text or commands. Such a translation takes place
  546. where an escape character `@@' is seen in the input text. The single
  547. charachter following the escape character determines the effect.
  548.  
  549. .tm ...functions
  550. The following functions are currently implemented:
  551. .in +5
  552. .fun @@@@
  553. @tis a single @@.
  554. .*---------------------------*
  555. .fun @@e
  556. @tis replaced by the current value of the escape character. Currently,
  557. there is no way to change it.
  558. .*---------------------------*
  559. .fun @@n
  560. @tfollowed by a single letter, is replaced by the contents of the
  561. designated number register.
  562. .*---------------------------*
  563. .fun @@t
  564. @tis replaced with a tab character, to be used in conjunction with the
  565. .bo "@.ta
  566. command. You may also use a normal tab character if you wish. If a tab is
  567. encountered, the necessary space is generated by non-breakable spaces. Any
  568. spaces on the output line before the tab are also made non-breakable. This
  569. is to avoid justification spoiling the tab.
  570. .br
  571. Tabs beyond the current right margin or beyond the last tab stop are
  572. ignored, except that they separate words.
  573. .*---------------------------*
  574. .fun @@X(expression)
  575. @tis replaced with the character with character code value `expression'.
  576. .*---------------------------*
  577. .fun @@(space)
  578. @tis replaced by a non-breakable space. It behaves just like any printable
  579. character, you just don't see it. This space won't be modified by
  580. justification, and it will be underlined by continous underline.
  581. .*---------------------------*
  582. .fun @@(newline)
  583. @tis deleted from the input. If a @@ is placed at the end of an input line,
  584. it will appear as if the next input line actually is following the contents
  585. of the current line. This is called `concealing the newline'.
  586. .*---------------------------*
  587. .fun @@.
  588. @twhere . stands for the current command character, produces the command
  589. character. It will, however, not be recognized as such. This provides a way
  590. to start your input line with a command character that in fact is a text
  591. line. This only works if the command character is different from any other
  592. valid character following the escape character, and does not work for
  593. .bo "@.en
  594. commands that end a macro definition.
  595. .*---------------------------*
  596. .fun @@{
  597. .fun @@} 0
  598. @tThese two delimiters were already mentioned in the section about the
  599. .bo "@.if
  600. and
  601. .bo "@.el
  602. commands. They serve to delimit the lines you want to be affected by these
  603. commands. Normally, when the condition is false, the
  604. .bo "@.if
  605. skips input until it finds the end of the current line. If it sees the @@{
  606. following the condition, it sets a flag to indicate to the low-level file
  607. reader, that it must count these delimiters. All input is then skipped
  608. until the matching closing delimiter @@} is found. So, the
  609. .bo "@.if
  610. command never 'sees' anything of it. Also in this case, the
  611. .bo "@.if
  612. command skips the rest of the line remaining after the closing @@}.
  613. .br
  614. On the other hand, if the condition evaluates to be true, all and any
  615. opening and closing delimiters are ignored completely. The command
  616. following the condition is executed, and also of course any commands on
  617. following lines. Since a command (or text) is expected on the same line as
  618. the
  619. .bo "@.if
  620. command, omission of a command makes it look like there is an empty line,
  621. and this generates an unexpected break. Therefore, you should conceal the
  622. newline at the end of such a line. (See @@(newline).)
  623. .*---------------------------*
  624. .fun @@"
  625. @tThis is yet another way to insert a comment. Note that text may precede
  626. the comment function. All text from the comment function until the end of
  627. the line will be ignored. Note that spaces between the last word on a line
  628. and the comment are not deleted, and this may effect your layout in some
  629. (as of yet unimplemented) cirumstances.
  630.  
  631. .in -5
  632. Any unrecognized character that follows the @@ will be left in the input.
  633. .PP
  634. Macro expansion is accomplished in the following way. There exists an input
  635. push-back buffer. If any input is needed, this push-back buffer is examined
  636. first. If a character is present, the request is satisfied by taking the
  637. last pushed back character. Only if the push back buffer is empty, a
  638. character is read from the input file. At any time that
  639. .ul "NRO
  640. reads a character that is unexpected, it is pushed back, in the hope that
  641. it can be used later.
  642. .br
  643. When a macro is to be expanded, its body is pushed back, while at the same
  644. time subsituting the arguments. Normally when an instance of the escape
  645. character is to be pushed back, it is `guarded' against re-substitution
  646. when it is read back, by doubling it, so anything pushed back will be read
  647. back exactly the same. This is not done
  648. .ul "only
  649. for macro bodies, to allow resubstitution to occur in them. This means that
  650. the body of a macro is interpreted twice, once at definition time, and once
  651. at application time. The macro arguments are interpreted only once, so that
  652. a double escape character in an argument will show up in the resulting text
  653. as a single escape character, instead of disappearing. This seems to be the
  654. most intuitive approach. It will disallow some more complex applications
  655. but avoids needing four @@'s in an argument if you want only one.
  656. .tm ...examples
  657. .SH EXAMPLES
  658. .SS "Macros:
  659. You may even define a macro that defines a macro, in the following way:
  660. .br;.RS +5;.nf
  661. @.de keep
  662. @.de $0
  663. $1 $2 $3 $4 $5 $6 $7 $8 $9
  664. @@@@.en
  665. @.en
  666. .fi;.RE
  667. This macro defines a macro with a name designated by the first argument,
  668. and containing the text designated by the remaining arguments. Remember
  669. that you can always enclose an argument with quotes.
  670. .br
  671. Note that you must use two escape characters to make the
  672. .bo "@.en
  673. part of the macro body. This is because macro definitions are handled
  674. slightly different from normal input lines. In the definition of `keep'
  675. there will be a line with
  676. .bo "@@.en,
  677. and at the time of definition of the inner macro the second escape
  678. character will be stripped off, so that the end of the inner macro
  679. definition is recognized.
  680. .br
  681. Another way to to it, is to change the command character temporarily while
  682. defining the outer macro.
  683.  
  684. .SS "Conditionals:
  685. Here are a few examples of correct use of the
  686. .bo "@.if, .ie
  687. and
  688. .bo "@.el
  689. commands:
  690. .br;.RS +5;.nf
  691.  
  692. @.if @@na Register A is greater than zero!
  693.  
  694. @.if @@na @@{.firstcommand
  695. @.       .secondcommand
  696. @.       .lastcommand @@}
  697.  
  698. @.if @@na @@{@@
  699. @.       .firstcommand
  700. @.       .secondcommand
  701. @.       .lastcommand @@}
  702.  
  703. @.ie @@na @@{.firstcommand
  704. @.       .secondcommand
  705. @.       .lastcommand @@}
  706. @.el Register A is NOT greater than zero!!
  707. @.el Maybe a bit late, but register A IS greater than zero!!
  708. .fi;.RE
  709. .tm ...undocumented features
  710. .SH "UNDOCUMENTED FEATURES"
  711. .PP
  712. <censored>
  713.