home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / texinfo.i06 < prev    next >
Encoding:
GNU Info File  |  1993-06-12  |  50.1 KB  |  1,435 lines

  1. This is Info file texinfo, produced by Makeinfo-1.47 from the input
  2. file texinfo2.tex.
  3.  
  4.    This file documents Texinfo, a documentation system that uses a
  5. single source file to produce both on-line information and a printed
  6. manual.
  7.  
  8.    Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
  9.  
  10.    This is the second edition of the Texinfo documentation,
  11. and is consistent with version 2 of `texinfo.tex'.
  12.  
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.  
  17.    Permission is granted to copy and distribute modified versions of
  18. this manual under the conditions for verbatim copying, provided that
  19. the entire resulting derived work is distributed under the terms of a
  20. permission notice identical to this one.
  21.  
  22.    Permission is granted to copy and distribute translations of this
  23. manual into another language, under the above conditions for modified
  24. versions, except that this permission notice may be stated in a
  25. translation approved by the Foundation.
  26.  
  27. 
  28. File: texinfo,  Node: minus,  Prev: TeX and copyright,  Up: Insertions
  29.  
  30. `@minus'{}: Inserting a Minus Sign
  31. ==================================
  32.  
  33.    Use the `@minus{}' command to generate a minus sign.  In a
  34. fixed-width font, this is a single hyphen, but in a proportional font,
  35. the symbol is the customary length for a minus sign--a little longer
  36. than a hyphen.
  37.  
  38.    You can compare the two forms:
  39.  
  40.      `-' is a minus sign generated with `@minus{}',
  41.      
  42.      `-' is a hyphen generated with the character `-'.
  43.  
  44. In the fixed-width font used by Info, `@minus{}' is the same as a
  45. hyphen.
  46.  
  47.    You should not use `@minus{}' inside `@code' or `@example' because
  48. the width distinction is not made in the fixed-width font they use.
  49.  
  50.    When you use `@minus' to specify the mark beginning each entry in an
  51. itemized list, you do not need to type the braces (*note itemize::.).
  52.  
  53. 
  54. File: texinfo,  Node: Glyphs,  Next: Breaks,  Prev: Insertions,  Up: Top
  55.  
  56. Glyphs for Examples
  57. *******************
  58.  
  59.    In Texinfo, code is often illustrated in examples that are delimited
  60. by `@example' and `@end example', or by `@lisp' and `@end lisp'.  In
  61. such examples, you can indicate the results of evaluation or an
  62. expansion using `=>' or `==>'.  Likewise, there are commands to insert
  63. glyphs to indicate printed output, error messages, equivalence of
  64. expressions, and the location of point.
  65.  
  66.    The glyph-insertion commands do not need to be used within an
  67. example, but most often they are.  Every  glyph-insertion command is
  68. followed by a pair of left- and right-hand braces.
  69.  
  70. * Menu:
  71.  
  72. * Glyphs Summary::
  73. * result::                      How to show the result of expression.
  74. * expansion::                   How to indicate an expansion.
  75. * Print Glyph::                 How to indicate printed output.
  76. * Error Glyph::                 How to indicate an error message.
  77. * Equivalence::                 How to indicate equivalence.
  78. * Point Glyph::                 How to indicate the location of point.
  79.  
  80. 
  81. File: texinfo,  Node: Glyphs Summary,  Next: result,  Up: Glyphs
  82.  
  83. Glyphs Summary
  84. ==============
  85.  
  86.    Here are the different glyph commands:
  87.  
  88. =>
  89.      `@result{}' points to the result of an expression.
  90.  
  91. ==>
  92.      `@expansion{}' shows the results of a macro expansion.
  93.  
  94. -|
  95.      `@print{}' indicates printed output.
  96.  
  97. error-->
  98.      `@error{}' indicates that the following text is an error message.
  99.  
  100. ==
  101.      `@equiv{}' indicates the exact equivalence of two forms.
  102.  
  103. -!-
  104.      `@point{}' shows the location of point.
  105.  
  106. 
  107. File: texinfo,  Node: result,  Next: expansion,  Prev: Glyphs Summary,  Up: Glyphs
  108.  
  109. =>: Indicating Evaluation
  110. =========================
  111.  
  112.    Use the `@result{}' command to indicate the result of evaluating an
  113. expression.
  114.  
  115.    The `@result{}' command is displayed as `=>' in Info and as a double
  116. stemmed arrow in the printed output.
  117.  
  118.    Thus, the following,
  119.  
  120.      (cdr '(1 2 3))
  121.           => (2 3)
  122.  
  123. may be read as "`(cdr '(1 2 3))' evaluates to (2 3)".
  124.  
  125. 
  126. File: texinfo,  Node: expansion,  Next: Print Glyph,  Prev: result,  Up: Glyphs
  127.  
  128. ==>: Indicating an Expansion
  129. ============================
  130.  
  131.    When an expression is a macro call, it expands into a new expression.
  132. You can indicate the result of the expansion with the `@expansion{}'
  133. command.
  134.  
  135.    The `@expansion{}' command is displayed as `==>' in Info and as a
  136. long arrow with a flat base in the printed output.
  137.  
  138.    For example, the following
  139.  
  140.      @lisp
  141.      (third '(a b c))
  142.           @expansion{} (car (cdr (cdr '(a b c))))
  143.           @result{} c
  144.      @end lisp
  145.  
  146. produces
  147.  
  148.      (third '(a b c))
  149.           ==> (car (cdr (cdr '(a b c))))
  150.           => c
  151.  
  152. which may be read as:
  153.  
  154.      `(third '(a b c))' expands to `(car (cdr (cdr '(a b c))))'; the
  155.      result of evaluating the expression is `c'.
  156.  
  157. Often, as in this case, an example looks better if the `@expansion{}'
  158. and `@result{}' commands are indented five spaces.
  159.  
  160. 
  161. File: texinfo,  Node: Print Glyph,  Next: Error Glyph,  Prev: expansion,  Up: Glyphs
  162.  
  163. -|: Indicating Printed Output
  164. =============================
  165.  
  166.    Sometimes an expression will print output during its execution.  You
  167. can indicate the printed output with the `@print{}' command.
  168.  
  169.    The `@print{}' command is displayed as `-|' in Info and similarly,
  170. as a horizontal dash butting against a vertical bar, in the printed
  171. output.
  172.  
  173.    In the following example, the printed text is indicated with `-|',
  174. and the value of the expression follows on the last line.
  175.  
  176.      (progn (print 'foo) (print 'bar))
  177.           -| foo
  178.           -| bar
  179.           => bar
  180.  
  181. In a Texinfo source file, this example is written as follows:
  182.  
  183.      @lisp
  184.      (progn (print 'foo) (print 'bar))
  185.           @print{} foo
  186.           @print{} bar
  187.           @result{} bar
  188.      @end lisp
  189.  
  190. 
  191. File: texinfo,  Node: Error Glyph,  Next: Equivalence,  Prev: Print Glyph,  Up: Glyphs
  192.  
  193. error-->: Indicating an Error Message
  194. =====================================
  195.  
  196.    A piece of code may cause an error when you evaluate it.  You can
  197. designate the error message with the `@error{}' command.
  198.  
  199.    The `@error{}' command is displayed as `error-->' in Info and as the
  200. word `error' in a box in the printed output.
  201.  
  202.    Thus,
  203.  
  204.      @lisp
  205.      (+ 23 'x)
  206.      @error{} Wrong type argument: integer-or-marker-p, x
  207.      @end lisp
  208.  
  209. produces
  210.  
  211.      (+ 23 'x)
  212.      error--> Wrong type argument: integer-or-marker-p, x
  213.  
  214. This indicates that the following error message is printed when you
  215. evaluate the expression:
  216.  
  217.      Wrong type argument: integer-or-marker-p, x
  218.  
  219.    Note that `error-->' itself is not part of the error message.
  220.  
  221. 
  222. File: texinfo,  Node: Equivalence,  Next: Point Glyph,  Prev: Error Glyph,  Up: Glyphs
  223.  
  224. ==: Indicating Equivalence
  225. ==========================
  226.  
  227.    Sometimes two expressions produce identical results.  You can
  228. indicate the exact equivalence of two forms with the `@equiv{}' command.
  229.  
  230.    The `@equiv{}' command is displayed as `==' in Info and as a three
  231. parallel horizontal lines in the printed output.
  232.  
  233.    Thus,
  234.  
  235.      @lisp
  236.      (make-sparse-keymap) @equiv{} (list 'keymap)
  237.      @end lisp
  238.  
  239. produces
  240.  
  241.      (make-sparse-keymap) == (list 'keymap)
  242.  
  243. This indicates that evaluating `(make-sparse-keymap)' produces
  244. identical results to evaluating `(list 'keymap)'.
  245.  
  246. 
  247. File: texinfo,  Node: Point Glyph,  Prev: Equivalence,  Up: Glyphs
  248.  
  249. Indicating Point in a Buffer
  250. ============================
  251.  
  252.    Sometimes you need to show an example of text in an Emacs buffer.  In
  253. such examples, the convention is to include the entire contents of the
  254. buffer in question between two lines of dashes containing the buffer
  255. name.
  256.  
  257.    You can use the `@point{}' command to show the location of point in
  258. the text in the buffer.  (The symbol for point, of course, is not part
  259. of the text in the buffer; it indicates the place *between* two
  260. characters where point is located.)
  261.  
  262.    The `@point{}' command is displayed as `-!-' in Info and as a small
  263. five pointed star in the printed output.
  264.  
  265.    The following example shows the contents of buffer `foo' before and
  266. after evaluating a Lisp command to insert the word `changed'.
  267.  
  268.      ---------- Buffer: foo ----------
  269.      This is the -!-contents of foo.
  270.      ---------- Buffer: foo ----------
  271.  
  272.      (insert "changed ")
  273.           => nil
  274.      ---------- Buffer: foo ----------
  275.      This is the changed -!-contents of foo.
  276.      ---------- Buffer: foo ----------
  277.  
  278.    In a Texinfo source file, the example is written like this:
  279.  
  280.      @example
  281.      ---------- Buffer: foo ----------
  282.      This is the @point{}contents of foo.
  283.      ---------- Buffer: foo ----------
  284.      
  285.      (insert "changed ")
  286.           @result{} nil
  287.      ---------- Buffer: foo ----------
  288.      This is the changed @point{}contents of foo.
  289.      ---------- Buffer: foo ----------
  290.      @end example
  291.  
  292. 
  293. File: texinfo,  Node: Breaks,  Next: Definition Commands,  Prev: Glyphs,  Up: Top
  294.  
  295. Making and Preventing Breaks
  296. ****************************
  297.  
  298.    Usually, a Texinfo file is processed both by TeX and by one of the
  299. Info formatting commands.  Line, paragraph, or page breaks sometimes
  300. occur in the `wrong' place in one or other form of output.  You must
  301. ensure that text looks right both in the printed manual and in the Info
  302. file.
  303.  
  304.    For example, in a printed manual, page breaks may occur awkwardly in
  305. the middle of an example; to prevent this, you can hold text together
  306. using a grouping command that keeps the text from being split across
  307. two pages.  Conversely, you may want to force a page break where none
  308. would occur normally.  Fortunately, problems like these do not often
  309. arise.  When they do, use the break, break prevention, or pagination
  310. commands.
  311.  
  312. * Menu:
  313.  
  314. * Break Commands::              Cause and prevent splits.
  315. * Line Breaks::                 How to force a single line to use two lines.
  316. * w::                           How to prevent unwanted line breaks.
  317. * sp::                          How to insert blank lines.
  318. * page::                        How to force the start of a new page.
  319. * group::                       How to prevent unwanted page breaks.
  320. * need::                        Another way to prevent unwanted page breaks.
  321.  
  322. 
  323. File: texinfo,  Node: Break Commands,  Next: Line Breaks,  Up: Breaks
  324.  
  325. The Break Commands
  326. ==================
  327.  
  328.    The break commands create line and paragraph breaks:
  329.  
  330. `@*'
  331.      Force a line break.
  332.  
  333. `@sp N'
  334.      Skip N blank lines.
  335.  
  336.    The line-break-prevention command holds text together all on one
  337. line:
  338.  
  339. `@w{TEXT}'
  340.      Prevent TEXT from being split and hyphenated across two lines.
  341.  
  342.    The pagination commands apply only to printed output, since Info
  343. files do not have pages.
  344.  
  345. `@page'
  346.      Start a new page in the printed manual.
  347.  
  348. `@group'
  349.      Hold text together that must appear on one printed page.
  350.  
  351. `@need MILS'
  352.      Start a new printed page if not enough space on this one.
  353.  
  354. 
  355. File: texinfo,  Node: Line Breaks,  Next: w,  Prev: Break Commands,  Up: Breaks
  356.  
  357. `@*': Generate Line Breaks
  358. ==========================
  359.  
  360.    The `@*' command forces a line break in both the printed manual and
  361. in Info.
  362.  
  363.    For example,
  364.  
  365.      This line @* is broken @*in two places.
  366.  
  367. produces
  368.  
  369.      This line
  370.       is broken
  371.      in two places.
  372.  
  373. (Note that the space after the first `@*' command is faithfully carried
  374. down to the next line.)
  375.  
  376.    The `@*' command is often used in a file's copyright page:
  377.  
  378.      This is version 2.0 of the Texinfo documentation,@*
  379.      and is for ...
  380.  
  381. In this case, the `@*' command keeps TeX from stretching the line
  382. across the whole page in an ugly manner.
  383.  
  384.    Do not write braces after an `@*' command; they are not needed.
  385.  
  386.    Do not write an `@refill' command at the end of a paragraph
  387. containing an `@*' command; it will cause the paragraph to be refilled
  388. after the line break occurs, negating the effect of the line break.
  389.  
  390. 
  391. File: texinfo,  Node: w,  Next: sp,  Prev: Line Breaks,  Up: Breaks
  392.  
  393. `@w'{TEXT}: Prevent Line Breaks
  394. ===============================
  395.  
  396.    `@w{TEXT}' outputs TEXT and prohibits line breaks within TEXT.
  397.  
  398.    You can use the `@w' command to prevent TeX from automatically
  399. hyphenating a long name or phrase that accidentally falls near the end
  400. of a line.
  401.  
  402.      You can copy GNU software from @w{@file{prep.ai.mit.edu}}.
  403.  
  404. produces
  405.  
  406.      You can copy GNU software from `prep.ai.mit.edu'.
  407.  
  408.    In the Texinfo file, you must write the `@w' command and its
  409. argument (all the affected text) all on one line.
  410.  
  411.    Do not write an `@refill' command at the end of a paragraph
  412. containing an `@w' command; it will cause the paragraph to be refilled
  413. and may thereby negate the effect of the `@w' command.
  414.  
  415. 
  416. File: texinfo,  Node: sp,  Next: page,  Prev: w,  Up: Breaks
  417.  
  418. `@sp' N: Insert Blank Lines
  419. ===========================
  420.  
  421.    A line beginning with and containing only `@sp N' generates N blank
  422. lines of space in both the printed manual and the Info file.  `@sp'
  423. also forces a paragraph break.  For example,
  424.  
  425.      @sp 2
  426.  
  427. generates two blank lines.
  428.  
  429.    The `@sp' command is most often used in the title page.
  430.  
  431. 
  432. File: texinfo,  Node: page,  Next: group,  Prev: sp,  Up: Breaks
  433.  
  434. `@page': Start a New Page
  435. =========================
  436.  
  437.    A line containing only `@page' starts a new page in a printed
  438. manual.  The command has no effect on Info files since they are not
  439. paginated.  An `@page' command is often used in the `@titlepage'
  440. section of a Texinfo file to start the copyright page.
  441.  
  442. 
  443. File: texinfo,  Node: group,  Next: need,  Prev: page,  Up: Breaks
  444.  
  445. `@group': Prevent Page Breaks
  446. =============================
  447.  
  448.    The `@group' command (on a line by itself) is used inside an
  449. `@example' or similar construct to begin an unsplittable vertical
  450. group, which will appear entirely on one page in the printed output.
  451. The group is terminated by a line containing only `@end group'. These
  452. two lines produce no output of their own, and in the Info file output
  453. they have no effect at all.
  454.  
  455.    Although `@group' would make sense conceptually in a wide variety of
  456. contexts, its current implementation works reliably only within
  457. `@example' and variants, and within `@display', `@format', `@flushleft'
  458. and `@flushright'.  (What all these commands have in common is that
  459. each line of input produces a line of output.) In other contexts,
  460. `@group' can cause anomalous vertical spacing. *Note Quotations and
  461. Examples::.
  462.  
  463. This formatting requirement means that you should write:
  464.  
  465.      @example
  466.      @group
  467.      ...
  468.      @end group
  469.      @end example
  470.  
  471. with the `@group' and `@end group' command inside the `@example' and
  472. `@end example' commands.
  473.  
  474.    The `@group' command is most often used to hold an example together
  475. on one page.  In this Texinfo manual, more than 100 examples contain
  476. text that is enclosed between `@group' and `@end group'.
  477.  
  478.    If you forget to end a group, you may get strange and unfathomable
  479. error messages when you run TeX.  This is because TeX keeps trying to
  480. put the rest of the Texinfo file onto the one page and does not start
  481. to generate error messages until it has processed considerable text. 
  482. It is a good rule of thumb to look for a missing `@end group' if you
  483. get incomprehensible error messages in TeX.
  484.  
  485. 
  486. File: texinfo,  Node: need,  Prev: group,  Up: Breaks
  487.  
  488. `@need MILS': Prevent Page Breaks
  489. =================================
  490.  
  491.    A line containing only `@need N' starts a new page in a printed
  492. manual if fewer than N mils (thousandths of an inch) remain on the
  493. current page.  Do not use braces around the argument N.  The `@need'
  494. command has no effect on Info files since they are not paginated.
  495.  
  496.    This paragraph is preceded by an `@need' command that tells TeX to
  497. start a new page if fewer than 300 mils (three-tenths inch) remain on
  498. the page.  It looks like this:
  499.  
  500.      @need 300
  501.      This paragraph is preceded by ...
  502.  
  503.    The `@need' command is useful for preventing orphans (single lines
  504. at the bottoms of printed pages).
  505.  
  506. 
  507. File: texinfo,  Node: Definition Commands,  Next: Footnotes,  Prev: Breaks,  Up: Top
  508.  
  509. Definition Commands: `@deffn', etc.
  510. ***********************************
  511.  
  512.    The `@deffn' command and the other "definition commands" enable you
  513. to describe functions, variables, macros, commands, user options,
  514. special forms and other such artifacts in a uniform format.
  515.  
  516.    In the Info file, a definition causes the entity
  517. category--`Function', `Variable', or whatever--to appear at the
  518. beginning of the first line of the definition, followed by the entity's
  519. name and arguments.  In the printed manual, the command causes TeX to
  520. print the entity's name and its arguments on the left margin and print
  521. the category next to the right margin.  In both output formats, the
  522. body of the definition is indented.  Also, the name of the entity is
  523. entered into the appropriate index: `@deffn' enters the name into the
  524. index of functions, `@defvr' enters it into the index of variables, and
  525. so on.
  526.  
  527.    A manual need not and should not contain more than one definition for
  528. a given name.  An appendix containing a summary should use `@table'
  529. rather than the definition commands.
  530.  
  531. * Menu:
  532.  
  533. * Def Cmd Template::            How to structure a description using a
  534.                                   definition command.
  535. * Optional Arguments::          How to handle optional and repeated arguments.
  536. * deffnx::                      How to group two or more `first' lines.
  537. * Def Cmds in Detail::          All the definition commands.
  538. * Def Cmd Conventions::         Conventions for writing definitions.
  539. * Sample Function Definition::
  540.  
  541. 
  542. File: texinfo,  Node: Def Cmd Template,  Next: Optional Arguments,  Up: Definition Commands
  543.  
  544. The Template for a Definition
  545. =============================
  546.  
  547.    The `@deffn' command is used for definitions of entities that
  548. resemble functions.  To write a definition using the `@deffn' command,
  549. write the `@deffn' command at the beginning of a line and follow it on
  550. the same line by the category of the entity, the name of the entity
  551. itself, and its arguments (if any).  Then write the body of the
  552. definition on succeeding lines.  (You may embed examples in the body.) 
  553. Finally, end the definition with an `@end deffn' command written on a
  554. line of its own.  (The other definition commands follow the same
  555. format.)
  556.  
  557.    The template for a definition looks like this:
  558.  
  559.      @deffn CATEGORY NAME ARGUMENTS...
  560.      BODY-OF-DEFINITION
  561.      @end deffn
  562.  
  563. For example,
  564.  
  565.      @deffn Command forward-word count
  566.      This command moves point forward @var{count} words
  567.      (or backward if @var{count} is negative). ...
  568.      @end deffn
  569.  
  570. produces
  571.  
  572.       -- Command: forward-word COUNT
  573.           This function moves point forward COUNT words (or backward if
  574.           COUNT is negative). ...
  575.  
  576.    Capitalize the category name like a title.  If the name of the
  577. category contains spaces, as in the phrase `Interactive Command', write
  578. braces around it.  For example:
  579.  
  580.      @deffn {Interactive Command} isearch-forward
  581.      ...
  582.      @end deffn
  583.  
  584. Otherwise, the second word will be mistaken for the name of the entity.
  585.  
  586.    Some of the definition commands are more general than others.  The
  587. `@deffn' command, for example, is the general definition command for
  588. functions and the like--for entities that may take arguments.  When you
  589. use this command, you specify the category to which the entity belongs.
  590.  The `@deffn' command possesses three predefined, specialized
  591. variations, `@defun', `@defmac', and `@defspec', that specify the
  592. category for you: "Function", "Macro", and "Special Form" respectively.
  593.  The `@defvr' command also is accompanied by several predefined,
  594. specialized variations for describing particular kinds of variables.
  595.  
  596.    The template for a specialized definition, such as `@defun', is
  597. similar to the template for a generalized definition, except that you
  598. do not need to specify the category:
  599.  
  600.      @defun NAME ARGUMENTS...
  601.      BODY-OF-DEFINITION
  602.      @end defun
  603.  
  604. Thus,
  605.  
  606.      @defun buffer-end flag
  607.      This function returns @code{(point-min)} if @var{flag}
  608.      is less than 1, @code{(point-max)} otherwise.
  609.      ...
  610.      @end defun
  611.  
  612. produces
  613.  
  614.       -- Function: buffer-end FLAG
  615.           This function returns `(point-min)' if FLAG is less than 1,
  616.           `(point-max)' otherwise.  ...
  617.  
  618. *Note Sample Function Definition: Sample Function Definition, for a
  619. more detailed example of a function definition, including the use of
  620. `@example' inside the definition.
  621.  
  622.    The other specialized commands work like `@defun'.
  623.  
  624. 
  625. File: texinfo,  Node: Optional Arguments,  Next: deffnx,  Prev: Def Cmd Template,  Up: Definition Commands
  626.  
  627. Optional and Repeated Arguments
  628. ===============================
  629.  
  630.    Some entities take optional or repeated arguments, which may be
  631. specified by a distinctive glyph that uses square brackets and
  632. ellipses.  For example, a special form often breaks its argument list
  633. into separate arguments in more complicated ways than a straightforward
  634. function.
  635.  
  636.    An argument enclosed within square brackets is optional.  Thus,
  637. [OPTIONAL-ARG] means that OPTIONAL-ARG is optional.  An argument
  638. followed by an ellipsis is optional and may be repeated more than once.
  639.  Thus, REPEATED-ARGS... stands for zero or more arguments.  Parentheses
  640. are used when several arguments are grouped into additional levels of
  641. list structure in Lisp.
  642.  
  643.    Here is the `@defspec' line of an example of an imaginary special
  644. form:
  645.  
  646.       -- Special Form: foobar (VAR [FROM TO [INC]]) BODY...
  647.  
  648. In this example, the arguments FROM and TO are optional, but must both
  649. be present or both absent.  If they are present, INC may optionally be
  650. specified as well.  These arguments are grouped with the argument VAR
  651. into a list, to distinguish them from BODY, which includes all
  652. remaining elements of the form.
  653.  
  654.    In a Texinfo source file, this `@defspec' line is written like this
  655. (except it would not be split over two lines, as it is in this example).
  656.  
  657.      @defspec foobar (@var{var} [@var{from} @var{to}
  658.           [@var{inc}]]) @var{body}@dots{}
  659.  
  660. The function is listed in the Command and Variable Index under `foobar'.
  661.  
  662. 
  663. File: texinfo,  Node: deffnx,  Next: Def Cmds in Detail,  Prev: Optional Arguments,  Up: Definition Commands
  664.  
  665. Two or More `First' Lines
  666. =========================
  667.  
  668.    To create two or more `first' or header lines for a definition,
  669. follow the first `@deffn' line by a line beginning with `@deffnx'. The
  670. `@deffnx' command works exactly like `@deffn' except that it does not
  671. generate extra vertical white space between it and the preceding line.
  672.  
  673.    For example,
  674.  
  675.      @deffn {Interactive Command} isearch-forward
  676.      @deffnx {Interactive Command} isearch-backward
  677.      These two search commands are similar except ...
  678.      @end deffn
  679.  
  680. produces
  681.  
  682.  -- Interactive Command: isearch-forward
  683.  -- Interactive Command: isearch-backward
  684.      These two search commands are similar except ...
  685.  
  686.    Each of the other definition commands has an `x' form: `@defunx',
  687. `@defvrx', `@deftypefunx', etc.
  688.  
  689.    The `x' forms work just like `@itemx'; see *Note `@itemx': itemx.
  690.  
  691. 
  692. File: texinfo,  Node: Def Cmds in Detail,  Next: Def Cmd Conventions,  Prev: deffnx,  Up: Definition Commands
  693.  
  694. The Definition Commands
  695. =======================
  696.  
  697.    Texinfo provides more than a dozen definition commands, all of which
  698. are described in this section.
  699.  
  700.    The definition commands automatically enter the name of the entity in
  701. the appropriate index: for example, `@deffn', `@defun', and `@defmac'
  702. enter function names in the index of functions; `@defvr' and `@defvar'
  703. enter variable names in the index of variables.
  704.  
  705.    Although the examples that follow mostly illustrate Lisp, the
  706. commands can be used for other programming languages.
  707.  
  708. * Menu:
  709.  
  710. * Functions Commands::          Commands for functions and similar entities.
  711. * Variables Commands::          Commands for variables and similar entities.
  712. * Typed Functions::             Commands for functions in typed languages.
  713. * Typed Variables::             Commands for variables in typed languages.
  714. * Abstract Objects::            Commands for object-oriented programming.
  715. * Data Types::                  The definition command for data types.
  716.  
  717. 
  718. File: texinfo,  Node: Functions Commands,  Next: Variables Commands,  Up: Def Cmds in Detail
  719.  
  720. Functions and Similar Entities
  721. ------------------------------
  722.  
  723.    This section describes the commands for describing functions and
  724. similar entities:
  725.  
  726. `@deffn CATEGORY NAME ARGUMENTS...'
  727.      The `@deffn' command is the general definition command for
  728.      functions, interactive commands, and similar entities that may take
  729.      arguments.  You must choose a term to describe the category of
  730.      entity being defined; for example, "Function" could be used if the
  731.      entity is a function.  The `@deffn' command is written at the
  732.      beginning of a line and is followed on the same line by the
  733.      category of entity being described, the name of this particular
  734.      entity, and its arguments, if any.  Terminate the definition with
  735.      `@end deffn' on a line of its own.
  736.  
  737.      For example, here is a definition:
  738.  
  739.           @deffn Command forward-char nchars
  740.           Move point forward @var{nchars} characters.
  741.           @end deffn
  742.  
  743.      This shows a rather terse definition for a "command" named
  744.      `forward-char' with one argument, NCHARS.
  745.  
  746.      `@deffn' prints argument names such as NCHARS in italics or upper
  747.      case, as if `@var' had been used, because we think of these names
  748.      as metasyntactic variables--they stand for the actual argument
  749.      values.  Within the text of the description, write an argument name
  750.      explicitly with `@var' to refer to the value of the argument.  In
  751.      the example above, we used `@var{nchars}' in this way.
  752.  
  753.      The template for `@deffn' is:
  754.  
  755.           @deffn CATEGORY NAME ARGUMENTS...
  756.           BODY-OF-DEFINITION
  757.           @end deffn
  758.  
  759. `@defun NAME ARGUMENTS...'
  760.      The `@defun' command is the definition command for functions.
  761.      `@defun' is equivalent to `@deffn Function ...'.
  762.  
  763.      For example,
  764.  
  765.           @defun set symbol new-value
  766.           Change the value of the symbol @var{symbol}
  767.           to @var{new-value}.
  768.           @end defun
  769.  
  770.      shows a rather terse definition for a function `set' whose
  771.      arguments are SYMBOL and NEW-VALUE.  The argument names on the
  772.      `@defun' line automatically appear in italics or upper case as if
  773.      they were enclosed in `@var'.  Terminate the definition with `@end
  774.      defun' on a line of its own.
  775.  
  776.      The template is:
  777.  
  778.           @defun FUNCTION-NAME ARGUMENTS...
  779.           BODY-OF-DEFINITION
  780.           @end defun
  781.  
  782.      `@defun' creates an entry in the index of functions.
  783.  
  784. `@defmac NAME ARGUMENTS...'
  785.      The `@defmac' command is the definition command for macros.
  786.      `@defmac' is equivalent to `@deffn Macro ...' and works like
  787.      `@defun'.
  788.  
  789. `@defspec NAME ARGUMENTS...'
  790.      The `@defspec' command is the definition command for special
  791.      forms.  (In Lisp, a special form is an entity much like a
  792.      function.) `@defspec' is equivalent to `@deffn {Special Form} ...'
  793.      and works like `@defun'.
  794.  
  795. 
  796. File: texinfo,  Node: Variables Commands,  Next: Typed Functions,  Prev: Functions Commands,  Up: Def Cmds in Detail
  797.  
  798. Variables and Similar Entities
  799. ------------------------------
  800.  
  801.    Here are the commands for defining variables and similar entities:
  802.  
  803. `@defvr CATEGORY NAME'
  804.      The `@defvr' command is a general definition command for something
  805.      like a variable--an entity that records a value.  You must choose
  806.      a term to describe the category of entity being defined; for
  807.      example, "Variable" could be used if the entity is a variable.
  808.      Write the `@defvr' command at the beginning of a line and followed
  809.      it on the same line by the category of the entity and the name of
  810.      the entity.
  811.  
  812.      Capitalize the category name like a title.  If the name of the
  813.      category contains spaces, as in the name `User Option', write
  814.      braces around it.  Otherwise, the second word will be mistaken for
  815.      the name of the entity.
  816.  
  817.      For example:
  818.  
  819.           @defvr {User Option} fill-column
  820.           This buffer-local variable specifies
  821.           the maximum width of filled lines.
  822.           ...
  823.           @end defvr
  824.  
  825.      Terminate the definition with `@end defvr' on a line of its own.
  826.  
  827.      The template is:
  828.  
  829.           @defvr CATEGORY NAME
  830.           BODY-OF-DEFINITION
  831.           @end defvr
  832.  
  833.      `@defvr' creates an entry in the index of variables for NAME.
  834.  
  835. `@defvar NAME'
  836.      The `@defvar' command is the definition command for variables.
  837.      `@defvar' is equivalent to `@defvr Variable ...'.
  838.  
  839.      For example:
  840.  
  841.           @defvar kill-ring
  842.           ...
  843.           @end defvar
  844.  
  845.      The template is:
  846.  
  847.           @defvar NAME
  848.           BODY-OF-DEFINITION
  849.           @end defvar
  850.  
  851.      `@defvar' creates an entry in the index of variables for NAME.
  852.  
  853. `@defopt NAME'
  854.      The `@defopt' command is the definition command for user options. 
  855.      `@defopt' is equivalent to `@defvr {User Option} ...' and works
  856.      like `@defvar'.
  857.  
  858. 
  859. File: texinfo,  Node: Typed Functions,  Next: Typed Variables,  Prev: Variables Commands,  Up: Def Cmds in Detail
  860.  
  861. Functions in Typed Languages
  862. ----------------------------
  863.  
  864.    The `@deftypefn' command and its variations are for describing
  865. functions in C or any other language in which you must declare types of
  866. variables and functions.
  867.  
  868. `@deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS...'
  869.      The `@deftypefn' command is the general definition command for
  870.      functions and similar entities that may take arguments and that are
  871.      typed.  The `@deftypefn' command is written at the beginning of a
  872.      line and is followed on the same line by the category of entity
  873.      being described, the type of the returned value, the name of this
  874.      particular entity, and its arguments, if any.
  875.  
  876.      For example,
  877.  
  878.           @deftypefn {Library Function} int foobar
  879.              (int @var{foo}, float @var{bar})
  880.           ...
  881.           @end deftypefn
  882.  
  883.      (where the text before the "...", shown above as two lines, would
  884.      actually be a single line in a real Texinfo file) produces the
  885.      following in Info:
  886.  
  887.           -- Library Function: int foobar (int FOO, float BAR)
  888.           ...
  889.  
  890.      This means that `foobar' is a "library function" that returns an
  891.      `int', and its arguments are FOO (an `int') and BAR (a `float').
  892.  
  893.      The argument names that you write in `@deftypefn' are not subject
  894.      to an implicit `@var'--since the actual names of the arguments in
  895.      `@deftypefn' are typically scattered among data type names and
  896.      keywords, Texinfo cannot find them without help.  Instead, you
  897.      must write `@var' explicitly around the argument names.  In the
  898.      example above, the argument names are `foo' and `bar'.
  899.  
  900.      The template for `@deftypefn' is:
  901.  
  902.           @deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS ...
  903.           BODY-OF-DESCRIPTION
  904.           @end deftypefn
  905.  
  906.      Note that if the CATEGORY or DATA TYPE is more than one word then
  907.      it must be enclosed in braces to make it a single argument.
  908.  
  909.      If you are describing a procedure in a language that has packages,
  910.      such as Ada, you might consider using `@deftypefn' in a manner
  911.      somewhat contrary to the convention described in the preceding
  912.      paragraphs.
  913.  
  914.      For example:
  915.  
  916.           @deftypefn stacks private push
  917.                   (@var{s}:in out stack;
  918.                   @var{n}:in integer)
  919.           ...
  920.           @end deftypefn
  921.  
  922.      (The `@deftypefn' arguments are shown split into three lines, but
  923.      would be a single line in a real Texinfo file.)
  924.  
  925.      In this instance, the procedure is classified as belonging to the
  926.      package `stacks' rather than classified as a `procedure' and its
  927.      data type is described as `private'.  (The name of the procedure
  928.      is `push', and its arguments are S and N.)
  929.  
  930.      `@deftypefn' creates an entry in the index of functions for NAME.
  931.  
  932. `@deftypefun DATA-TYPE NAME ARGUMENTS...'
  933.      The `@deftypefun' command is the specialized definition command
  934.      for functions in typed languages.  The command is equivalent to
  935.      `@deftypefn Function ...'.
  936.  
  937.           @deftypefun int foobar (int @var{foo}, float @var{bar})
  938.           ...
  939.           @end deftypefun
  940.  
  941.      produces the following in Info:
  942.  
  943.           -- Function: int foobar (int FOO, float BAR)
  944.           ...
  945.  
  946.      The template is:
  947.  
  948.           @deftypefun TYPE NAME ARGUMENTS...
  949.           BODY-OF-DESCRIPTION
  950.           @end deftypefun
  951.  
  952.      `@deftypefun' creates an entry in the index of functions for NAME.
  953.  
  954. 
  955. File: texinfo,  Node: Typed Variables,  Next: Abstract Objects,  Prev: Typed Functions,  Up: Def Cmds in Detail
  956.  
  957. Variables in Typed Languages
  958. ----------------------------
  959.  
  960.    Variables in typed languages are handled in a manner similar to
  961. functions in typed languages.  *Note Typed Functions::.  The general
  962. definition command `@deftypevr' corresponds to `@deftypefn' and the
  963. specialized definition command `@deftypevar' corresponds to
  964. `@deftypefun'.
  965.  
  966. `@deftypevr CATEGORY DATA-TYPE NAME'
  967.      The `@deftypevr' command is the general definition command for
  968.      something like a variable in a typed language--an entity that
  969.      records a value.  You must choose a term to describe the category
  970.      of the entity being defined; for example, "Variable" could be used
  971.      if the entity is a variable.
  972.  
  973.      The `@deftypevr' command is written at the beginning of a line and
  974.      is followed on the same line by the category of the entity being
  975.      described, the data type, and the name of this particular entity.
  976.  
  977.      For example,
  978.  
  979.           @deftypevr {Global Flag} int enable
  980.           ...
  981.           @end deftypevr
  982.  
  983.      produces the following in Info:
  984.  
  985.           -- Global Flag: int enable
  986.           ...
  987.  
  988.      The template is:
  989.  
  990.           @deftypevr CATEGORY DATA-TYPE NAME
  991.           BODY-OF-DESCRIPTION
  992.           @end deftypevr
  993.  
  994.      `@deftypevr' creates an entry in the index of variables for NAME.
  995.  
  996. `@deftypevar DATA-TYPE NAME'
  997.      The `@deftypevar' command is the specialized definition command
  998.      for variables in typed languages.  `@deftypevar' is equivalent to
  999.      `@deftypevr Variable ...'.
  1000.  
  1001.      For example,
  1002.  
  1003.           @deftypevar int fubar
  1004.           ...
  1005.           @end deftypevar
  1006.  
  1007.      produces the following in Info:
  1008.  
  1009.           -- Variable: int fubar
  1010.           ...
  1011.  
  1012.      The template is:
  1013.  
  1014.           @deftypevar DATA-TYPE NAME
  1015.           BODY-OF-DESCRIPTION
  1016.           @end deftypevar
  1017.  
  1018.      `@deftypevar' creates an entry in the index of variables for NAME.
  1019.  
  1020. 
  1021. File: texinfo,  Node: Abstract Objects,  Next: Data Types,  Prev: Typed Variables,  Up: Def Cmds in Detail
  1022.  
  1023. Object-Oriented Programming
  1024. ---------------------------
  1025.  
  1026.    Here are the commands for formatting descriptions about abstract
  1027. objects, such as are used in object-oriented programming.  A class is a
  1028. defined type of abstract object.  An instance of a class is a
  1029. particular object that has the type of the class.  An instance variable
  1030. is a variable that belongs to the class but for which each instance has
  1031. its own value.
  1032.  
  1033.    In a definition, if the name of a class is truly a name defined in
  1034. the programming system for a class, then you should write an `@code'
  1035. around it.  Otherwise, it is printed in the usual text font.
  1036.  
  1037. `@defcv CATEGORY CLASS NAME'
  1038.      The `@defcv' command is the general definition command for
  1039.      variables associated with classes in object-oriented programming. 
  1040.      The `@defcv' command is followed by three arguments: the category
  1041.      of thing being defined, the class to which it belongs, and its
  1042.      name.
  1043.  
  1044.      Thus,
  1045.  
  1046.           @defcv {Class Option} Window border-pattern
  1047.           ...
  1048.           @end defcv
  1049.  
  1050.      illustrates how you would write the first line of a definition of
  1051.      the `border-pattern' class option of the class `Window'.
  1052.  
  1053.      The template is
  1054.  
  1055.           @defcv CATEGORY CLASS NAME
  1056.           ...
  1057.           @end defcv
  1058.  
  1059.      `@defcv' creates an entry in the index of variables.
  1060.  
  1061. `@defivar CLASS NAME'
  1062.      The `@defivar' command is the definition command for instance
  1063.      variables in object-oriented programming.  `@defivar' is
  1064.      equivalent to `@defcv {Instance Variable} ...'
  1065.  
  1066.      The template is:
  1067.  
  1068.           @defivar CLASS INSTANCE-VARIABLE-NAME
  1069.           BODY-OF-DEFINITION
  1070.           @end defivar
  1071.  
  1072.      `@defivar' creates an entry in the index of variables.
  1073.  
  1074. `@defop CATEGORY CLASS NAME ARGUMENTS...'
  1075.      The `@defop' command is the general definition command for
  1076.      entities that may resemble methods in object-oriented programming.
  1077.      These entities take arguments, as functions do, but are associated
  1078.      with particular classes of objects.
  1079.  
  1080.      For example, some systems have constructs called "wrappers" that
  1081.      are associated with classes as methods are, but that act more like
  1082.      macros than like functions.  You could use `@defop Wrapper' to
  1083.      describe one of these.
  1084.  
  1085.      Sometimes it is useful to distinguish methods and "operations".
  1086.      You can think of an operation as the specification for a method.
  1087.      Thus, a window system might specify that all window classes have a
  1088.      method named `expose'; we would say that this window system
  1089.      defines an `expose' operation on windows in general.  Typically,
  1090.      the operation has a name and also specifies the pattern of
  1091.      arguments; all methods that implement the operation must accept
  1092.      the same arguments, since applications that use the operation do
  1093.      so without knowing which method will implement it.
  1094.  
  1095.      Often it makes more sense to document operations than methods.  For
  1096.      example, window application developers need to know about the
  1097.      `expose' operation, but need not be concerned with whether a given
  1098.      class of windows has its own method to implement this operation.
  1099.      To describe this operation, you would write:
  1100.  
  1101.           @defop Operation windows expose
  1102.  
  1103.      The `@defop' command is written at the beginning of a line and is
  1104.      followed on the same line by the overall name of the category of
  1105.      operation, the name of the class of the operation, the name of the
  1106.      operation, and its arguments, if any.
  1107.  
  1108.      The template is:
  1109.  
  1110.           @defop CATEGORY CLASS NAME ARGUMENTS...
  1111.           BODY-OF-DEFINITION
  1112.           @end defop
  1113.  
  1114.      `@defop' creates an entry, such as ``expose' on `windows'', in the
  1115.      index of functions.
  1116.  
  1117. `@defmethod CLASS NAME ARGUMENTS...'
  1118.      The `@defmethod' command is the definition command for methods in
  1119.      object-oriented programming.  A method is a kind of function that
  1120.      implements an operation for a particular class of objects and its
  1121.      subclasses.  In the Lisp Machine, methods actually were functions,
  1122.      but they were usually defined with `defmethod'.
  1123.  
  1124.      `@defmethod' is equivalent to `@defop Method ...'. The command is
  1125.      written at the beginning of a line and is followed by the name of
  1126.      the class of the method, the name of the method, and its
  1127.      arguments, if any.
  1128.  
  1129.      For example,
  1130.  
  1131.           @defmethod `bar-class' bar-method argument
  1132.           ...
  1133.           @end defmethod
  1134.  
  1135.      illustrates the definition for a method called `bar-method' of the
  1136.      class `bar-class'.  The method takes an argument.
  1137.  
  1138.      The template is:
  1139.  
  1140.           @defmethod CLASS METHOD-NAME ARGUMENTS...
  1141.           BODY-OF-DEFINITION
  1142.           @end defmethod
  1143.  
  1144.      `@defmethod' creates an entry, such as ``bar-method' on
  1145.      `bar-class'', in the index of functions.
  1146.  
  1147. 
  1148. File: texinfo,  Node: Data Types,  Prev: Abstract Objects,  Up: Def Cmds in Detail
  1149.  
  1150. Data Types
  1151. ----------
  1152.  
  1153.    Here is the command for data types:
  1154.  
  1155. `@deftp CATEGORY NAME ATTRIBUTES...'
  1156.      The `@deftp' command is the generic definition command for data
  1157.      types.  The command is written at the beginning of a line and is
  1158.      followed on the same line by the category, by the name of the type
  1159.      (which is a word like `int' or `float'), and then by names of
  1160.      attributes of objects of that type.  Thus, you could use this
  1161.      command for describing `int' or `float', in which case you could
  1162.      use `data type' as the category.  (A data type is a category of
  1163.      certain objects for purposes of deciding which operations can be
  1164.      performed on them.)
  1165.  
  1166.      In Lisp, for example,  "pair" names a particular data type, and an
  1167.      object of that type has two slots called the CAR and the CDR. 
  1168.      Here is how you would write the first line of a definition of
  1169.      `pair'.
  1170.  
  1171.           @deftp {Data type} pair car cdr
  1172.           ...
  1173.           @end deftp
  1174.  
  1175.      The template is:
  1176.  
  1177.           @deftp CATEGORY NAME-OF-TYPE ATTRIBUTES...
  1178.           BODY-OF-DEFINITION
  1179.           @end deftp
  1180.  
  1181.      `@deftp' creates an entry in the index of data types.
  1182.  
  1183. 
  1184. File: texinfo,  Node: Def Cmd Conventions,  Next: Sample Function Definition,  Prev: Def Cmds in Detail,  Up: Definition Commands
  1185.  
  1186. Conventions for Writing Definitions
  1187. ===================================
  1188.  
  1189.    When you write a definition using `@deffn', `@defun', or one of the
  1190. other definition commands, please take care to use arguments that
  1191. indicate the meaning, as with the COUNT argument to the `forward-word'
  1192. function.  Also, if the name of an argument contains the name of a
  1193. type, such as INTEGER, take care that the argument actually is of that
  1194. type.
  1195.  
  1196. 
  1197. File: texinfo,  Node: Sample Function Definition,  Prev: Def Cmd Conventions,  Up: Definition Commands
  1198.  
  1199. A Sample Function Definition
  1200. ============================
  1201.  
  1202.    A function definition uses the `@defun' and `@end defun' commands. 
  1203. The name of the function follows immediately after the `@defun' command
  1204. and it is followed, on the same line, by the parameter list.
  1205.  
  1206.    Here is a definition from `The GNU Emacs Lisp Reference Manual'.
  1207. (*Note Calling Functions: (elisp)Calling Functions.)
  1208.  
  1209.       -- Function: apply FUNCTION &rest ARGUMENTS
  1210.           `apply' calls FUNCTION with ARGUMENTS, just like `funcall'
  1211.           but with one difference: the last of ARGUMENTS is a list of
  1212.           arguments to give to FUNCTION, rather than a single argument.
  1213.            We also say that this list is "appended" to the other
  1214.           arguments.
  1215.  
  1216.           `apply' returns the result of calling FUNCTION. As with
  1217.           `funcall', FUNCTION must either be a Lisp function or a
  1218.           primitive function; special forms and macros do not make
  1219.           sense in `apply'.
  1220.  
  1221.                (setq f 'list)
  1222.                     => list
  1223.                (apply f 'x 'y 'z)
  1224.                error--> Wrong type argument: listp, z
  1225.                (apply '+ 1 2 '(3 4))
  1226.                     => 10
  1227.                (apply '+ '(1 2 3 4))
  1228.                     => 10
  1229.                
  1230.                (apply 'append '((a b c) nil (x y z) nil))
  1231.                     => (a b c x y z)
  1232.  
  1233.           An interesting example of using `apply' is found in the
  1234.           description of `mapcar'.
  1235.  
  1236.    In the Texinfo source file, this example looks like this:
  1237.  
  1238.      @defun apply function &rest arguments
  1239.      
  1240.      @code{apply} calls @var{function} with
  1241.      @var{arguments}, just like @code{funcall} but with one
  1242.      difference: the last of @var{arguments} is a list of
  1243.      arguments to give to @var{function}, rather than a single
  1244.      argument.  We also say that this list is @dfn{appended}
  1245.      to the other arguments.
  1246.      
  1247.      @code{apply} returns the result of calling
  1248.      @var{function}.  As with @code{funcall},
  1249.      @var{function} must either be a Lisp function or a
  1250.      primitive function; special forms and macros do not make
  1251.      sense in @code{apply}.
  1252.      
  1253.      @example
  1254.      (setq f 'list)
  1255.           @result{} list
  1256.      (apply f 'x 'y 'z)
  1257.      @error{} Wrong type argument: listp, z
  1258.      (apply '+ 1 2 '(3 4))
  1259.           @result{} 10
  1260.      (apply '+ '(1 2 3 4))
  1261.           @result{} 10
  1262.      
  1263.      (apply 'append '((a b c) nil (x y z) nil))
  1264.           @result{} (a b c x y z)
  1265.      @end example
  1266.      
  1267.      An interesting example of using @code{apply} is found in the description
  1268.      of @code{mapcar}.@refill
  1269.      @end defun
  1270.  
  1271. In this manual, this function is listed in the Command and Variable
  1272. Index under `apply'.
  1273.  
  1274.    Ordinary variables and user options are described using a format like
  1275. that for functions except that variables do not take arguments.
  1276.  
  1277. 
  1278. File: texinfo,  Node: Footnotes,  Next: Conditionals,  Prev: Definition Commands,  Up: Top
  1279.  
  1280. Footnotes
  1281. *********
  1282.  
  1283.    A "footnote" is for a reference that documents or elucidates the
  1284. primary text.(1)
  1285.  
  1286.    In Texinfo, footnotes are created with the `@footnote' command. This
  1287. command is followed immediately by a left brace, then by the text of
  1288. the footnote, and then by a terminating right brace.  The template is:
  1289.  
  1290.      @footnote{TEXT}
  1291.  
  1292.    Footnotes may be of any length, but are usually short.
  1293.  
  1294.    For example, this clause is followed by a sample footnote(2); in the
  1295. Texinfo source, it looks like this:
  1296.  
  1297.      ...a sample footnote @footnote{Here is the sample
  1298.      footnote.}; in the Texinfo source...
  1299.  
  1300.    In a printed manual or book, the reference mark for a footnote is a
  1301. small, superscripted number; the text of the footnote is written at the
  1302. bottom of the page, below a horizontal line.
  1303.  
  1304.    In Info, the reference mark for a footnote is a pair of parentheses
  1305. with the footnote number between them, like this: `(1)'.
  1306.  
  1307.    Info has two footnote styles, which determine where the text of the
  1308. footnote is located:
  1309.  
  1310.    * In the `End' node style, all the footnotes for a single node are
  1311.      placed at the end of that node.  The footnotes are separated from
  1312.      the rest of the node by a line of dashes with the word `Footnotes'
  1313.      within it.  Each footnote begins with an `(N)' reference mark.
  1314.  
  1315.      Here is an example of a single footnote in the end of node style:
  1316.  
  1317.            --------- Footnotes ---------
  1318.           
  1319.           (1)  Here is a sample footnote.
  1320.  
  1321.    * In the `Separate' node style, all the footnotes for a single node
  1322.      are placed in an automatically constructed node of their own.  In
  1323.      this style, a "footnote reference" follows each `(N)' reference
  1324.      mark in the body of the node.  The footnote reference is actually
  1325.      a cross reference which you use to reach the footnote node.
  1326.  
  1327.      The name of the node containing the footnotes is constructed by
  1328.      appending `-Footnotes' to the name of the node that contains the
  1329.      footnotes. (Consequently, the footnotes' node for the `Footnotes'
  1330.      node is `Footnotes-Footnotes'!)  The footnotes' node has an `Up'
  1331.      node pointer that leads back to its parent node.
  1332.  
  1333. Here is how the first footnote in this manual looks after being
  1334. formatted for Info in the separate node style:
  1335.  
  1336.      File: texinfo.info  Node: Overview-Footnotes, Up: Overview
  1337.      
  1338.      (1) Note that the first syllable of "Texinfo" is
  1339.      pronounced like "speck", not "hex". ...
  1340.  
  1341.    A Texinfo file may be formatted into an Info file with either
  1342. footnote style.
  1343.  
  1344.    Use the `@footnotestyle' command to specify an Info file's footnote
  1345. style.  Write this command at the beginning of a line followed by an
  1346. argument, either `end' for the end node style or `separate' for the
  1347. separate node style.
  1348.  
  1349.    For example:
  1350.  
  1351.      @footnotestyle end
  1352.  
  1353. or
  1354.      @footnotestyle separate
  1355.  
  1356.    Write an `@footnotestyle' command before or shortly after the
  1357. end-of-header line at the beginning of a Texinfo file.  (If you include
  1358. the `@footnotestyle' command between the start-of-header and
  1359. end-of-header lines, the region formatting commands will format
  1360. footnotes as specified.)
  1361.  
  1362.    If you do not specify a footnote style, the formatting commands use
  1363. their default style.  Currently, `texinfo-format-buffer' and
  1364. `texinfo-format-region' use the `separate' style and `makeinfo' uses
  1365. the `end' style.
  1366.  
  1367.    This chapter contains two footnotes.
  1368.  
  1369.    ---------- Footnotes ----------
  1370.  
  1371.    (1)  A footnote should complement or expand upon the primary text,
  1372. but a reader should not need to read a footnote to understand the
  1373. primary text.  For a thorough discussion of footnotes, see `The Chicago
  1374. Manual of Style', which is published by the University of Chicago Press.
  1375.  
  1376.    (2)  Here is the sample footnote.
  1377.  
  1378. 
  1379. File: texinfo,  Node: Conditionals,  Next: Format/Print Hardcopy,  Prev: Footnotes,  Up: Top
  1380.  
  1381. Conditionally Visible Text
  1382. **************************
  1383.  
  1384.    Sometimes it is good to use different text for a printed manual and
  1385. its corresponding Info file.  In this case, you can use the
  1386. "conditional commands" to specify which text is for the printed manual
  1387. and which is for the Info file.
  1388.  
  1389. * Menu:
  1390.  
  1391. * Conditional Commands::        Specifying text for Info or TeX.
  1392. * Using Ordinary TeX Commands::  You can use any and all TeX commands.
  1393. * set and clear::               Designating which text to format (for both
  1394.                                   Info and TeX).
  1395.  
  1396. 
  1397. File: texinfo,  Node: Conditional Commands,  Next: Using Ordinary TeX Commands,  Up: Conditionals
  1398.  
  1399. Using `@ifinfo' and `@iftex'
  1400. ============================
  1401.  
  1402.    `@ifinfo' begins segments of text that should be ignored by TeX when
  1403. it typesets the printed manual.  The segment of text appears only in
  1404. the Info file. The `@ifinfo' command should appear on a line by itself;
  1405.  end the Info-only text with a line containing `@end ifinfo' by itself.
  1406.  At the beginning of a Texinfo file, the Info permissions are contained
  1407. within a region marked by `@ifinfo' and `@end ifinfo'. (*Note Info
  1408. Summary and Permissions::.)
  1409.  
  1410.    The `@iftex' and `@end iftex' commands are similar to the `@ifinfo'
  1411. and `@end ifinfo' commands, except that they specify text that will
  1412. appear in the printed manual but not in the Info file.
  1413.  
  1414.    For example:
  1415.  
  1416.      @iftex
  1417.      This text will appear only in the printed manual.
  1418.      @end iftex
  1419.      
  1420.      @ifinfo
  1421.      However, this text will appear only in Info.
  1422.      @end ifinfo
  1423.  
  1424. The preceding example produces the following line:
  1425.  
  1426.    However, this text will appear only in Info.
  1427.  
  1428. Note how you only see one of the two lines, depending on whether you
  1429. are reading the Info version or the printed version of this manual.
  1430.  
  1431.    The `@titlepage' command is a special variant of `@iftex' that is
  1432. used for making the title and copyright pages of the printed manual.
  1433. (*Note `@titlepage': titlepage.)
  1434.  
  1435.