### Example included file foo.texinfo Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the structure of an included file, starting with a node and chapter heading. ```texinfo @node First, Second, , Top @chapter First Chapter Contents of first chapter ... ``` -------------------------------- ### @example with mv command and its output Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Illustrates the @example environment with a simple shell command. The lines containing @example and @end example disappear from the output, and the command is displayed as-is. Blank lines before and after the environment are recommended for appearance. ```texinfo @example mv foo bar @end example ``` ```text mv foo bar ``` -------------------------------- ### @example command usage example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the syntax of the @example environment with a sample block of text. The text is indented, not filled, and typeset in a fixed-width font in the printed manual. In the Info file, each line is indented with five spaces. ```texinfo This is an example of text written between an @example command and an @end example command. The text is indented but not filled. In the printed manual, the text is typeset in a fixed-width font, and extra spaces and blank lines are significant. In the Info file, an analogous result is obtained by indenting each line with five spaces. ``` -------------------------------- ### Texinfo @table with @samp example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of a two-column table using @table @samp. Each entry starts with @item, the first column text is on the same line, and the second column text follows on subsequent lines. Blank lines before @item are recommended for better formatting in Info files. ```texinfo @table @samp @item foo This is the text for @samp{foo}. @item bar Text for @samp{bar}. @end table ``` -------------------------------- ### @sc command output example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the output produced by the @sc example. The text is rendered in small caps in printed and HTML output, and in uppercase in Info files. ```text The ACM and IEEE are technical societies. ``` -------------------------------- ### @defvar example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of the @defvar command, equivalent to @defvr Variable ... . Terminate with @end defvar. ```texinfo @defvar kill-ring ... @end defvar ``` -------------------------------- ### Index entries placement example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to place index entries before the paragraph they apply to, with a blank line after the index entry for 'Leaping'. The example uses @section and @cindex commands. ```texinfo @section The Dog and the Fox @cindex Jumping, in general @cindex Leaping @cindex Dog, lazy, jumped over @cindex Lazy dog jumped over @cindex Fox, jumps over dog @cindex Quick fox jumps over dog The quick brown fox jumps over the lazy dog. ``` -------------------------------- ### Complete multitable example with @item and @tab Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A complete example of a multi-column table. Rows begin with @item and columns are separated by @tab. The example uses @columnfractions .15 .45 .4 and produces a table with Key, Command, and Description columns. ```texinfo @multitable @columnfractions .15 .45 .4 @item Key @tab Command @tab Description @item C-x 2 @tab @code{split-window-vertically} @tab Split the selected window into two windows, with one above the other. @item C-x 3 @tab @code{split-window-horizontally} @tab Split the selected window into two windows positioned side by side. @item C-Mouse-2 @tab @tab In the mode line or scroll bar of a window, split that window. @end multitable ``` -------------------------------- ### Example dir file menu entries Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of menu entries in the dir file that list only file names, taking readers directly to the Top nodes of each Info document. ```texinfo * Info: (info). Documentation browsing system. * Emacs: (emacs). The extensible, self-documenting text editor. ``` -------------------------------- ### @exdent example source and output Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how @exdent removes indentation from a single line within an @example block. The command is placed at the beginning of a line without braces. The output demonstrates the exdented line appearing without indentation. ```texinfo @example This line follows an @@example command. @exdent This line is exdented. This line follows the exdented line. The @@end example comes on the next line. @end group ``` ```text This line follows an @example command. This line is exdented. This line follows the exdented line. The @end example comes on the next line. ``` -------------------------------- ### @noindent example source and output Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Illustrates @noindent, which prevents indentation of text following an example. The command is placed on a line by itself before the continuation text. The output shows the text starting flush left. ```texinfo @example This is an example @end example @noindent This line is not indented. As you can see, the beginning of the line is fully flush left with the line that follows after it. (This whole example is between @code{@@display} and @code{@@end display}.) ``` ```text This is an example This line is not indented. As you can see, the beginning of the line is fully flush left with the line that follows after it. (This whole example is between @display and @end display.) ``` -------------------------------- ### @r command output example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the printed output of the @r example. The comment appears in roman font instead of the fixed-width font. ```text (+ 2 2) ; Add two plus two. ``` -------------------------------- ### Example menu entries referring to Emacs Manual nodes Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Concrete example of menu entries that refer to the Outlining and Rebinding nodes in the Emacs Manual. Note the line breaks and indentation in the descriptions. ```texinfo @menu * Outlining: (emacs)Outline Mode. The major mode for editing outlines. * Rebinding: (emacs)Rebinding. How to redefine the meaning of a key. @end menu ``` -------------------------------- ### @defvr example with User Option category Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of @defvr with a category name containing spaces, requiring braces around the category. Terminate with @end defvr on its own line. ```texinfo @defvr {User Option} fill-column This buffer-local variable specifies the maximum width of filled lines. ... @end defvr ``` -------------------------------- ### Texinfo source for @point{} example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html The Texinfo source that produces the buffer examples above. Uses @point{} to indicate point and @result{} for the return value. ```texinfo @example ---------- Buffer: foo ---------- This is the @point{}contents of foo. ---------- Buffer: foo ---------- (insert "changed ") @result{} nil ---------- Buffer: foo ---------- This is the changed @point{}contents of foo. ---------- Buffer: foo ---------- @end example ``` -------------------------------- ### @xref example with four and five arguments Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of @xref with four and five arguments, referencing 'Electrical Effects' in the 'weather' Info file. Produces the Info output shown. ```texinfo @xref{Electrical Effects, Lightning, Thunder and Lightning, weather, An Introduction to Meteorology}, for details. ``` ```text *Note Lightning: (weather)Electrical Effects, for details. ``` -------------------------------- ### Example of the 'dir' file menu Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the top-level menu format used in the 'dir' file. Each entry points to the 'Top' node of an Info file, with the file name in parentheses and a description. ```plaintext * Menu: * Info: (info). Documentation browsing system. * Emacs: (emacs). The extensible, self-documenting text editor. * Texinfo: (texinfo). With one source file, make either a printed manual using @TeX{} or an Info file. ... ``` -------------------------------- ### Texinfo source for apply function definition Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html The Texinfo source for the sample function definition using @defun and @end defun, including the @example block with the apply example. This shows how to format a function definition in Texinfo. ```texinfo @defun apply function &rest arguments @code{apply} calls @var{function} with @var{arguments}, just like @code{funcall} but with one difference: the last of @var{arguments} is a list of arguments to give to @var{function}, rather than a single argument. We also say that this list is @dfn{appended} to the other arguments. @code{apply} returns the result of calling @var{function}. As with @code{funcall}, @var{function} must either be a Lisp function or a primitive function; special forms and macros do not make sense in @code{apply}. @example (setq f 'list) @result{} list (apply f 'x 'y 'z) @error{} Wrong type argument: listp, z (apply '+ 1 2 '(3 4)) @result{} 10 (apply '+ '(1 2 3 4)) @result{} 10 (apply 'append '((a b c) nil (x y z) nil)) @result{} (a b c x y z) @end example An interesting example of using @code{apply} is found in the description of @code{mapcar}. @end defun ``` -------------------------------- ### @defun apply function &rest arguments Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A sample function definition using the @defun command, demonstrating how to document a Lisp function with parameters and examples. ```APIDOC ## @defun apply function &rest arguments ### Description Defines the Lisp function `apply`, which calls `function` with `arguments`, appending the last argument list to the other arguments. Returns the result of calling `function`. ### Syntax @defun apply function &rest arguments ... @end defun ### Parameters - **function** (Lisp function or primitive function) - Required - The function to call. - **arguments** (&rest) - Required - Arguments to pass to `function`; the last argument is a list appended to the others. ### Example ```lisp (setq f 'list) => list (apply f 'x 'y 'z) error--> Wrong type argument: listp, z (apply '+ 1 2 '(3 4)) => 10 (apply '+ '(1 2 3 4)) => 10 (apply 'append '((a b c) nil (x y z) nil)) => (a b c x y z) ``` ### Notes - `function` must be a Lisp function or a primitive function; special forms and macros are not allowed. - The last argument is appended to the other arguments. ``` -------------------------------- ### Menu Example with Comment and Output Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A Texinfo menu with a comment line and two entries, and its rendered output. The comment appears in the menu but is not an entry. ```texinfo @menu Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing several files at once. @end menu ``` ```texinfo * menu: Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing several files at once. ``` -------------------------------- ### @result{} example: (cdr '(1 2 3)) Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to use @result{} to indicate the result of evaluating an expression. The example displays the Lisp expression and its result with the => glyph. ```lisp (cdr '(1 2 3)) => (2 3) ``` -------------------------------- ### Example of a new menu entry for GDB Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the format for adding a new Info file to the 'dir' menu. The entry includes the menu name, file name in parentheses, and a description. The '.info' extension is omitted to avoid clutter. ```plaintext * GDB: (gdb). The source-level C debugger. ``` -------------------------------- ### @print{} example: (progn (print 'foo) (print 'bar)) Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to use @print{} to indicate printed output during evaluation. The example displays printed lines with -| and the final result with =>. ```lisp (progn (print 'foo) (print 'bar)) -| foo -| bar => bar ``` ```texinfo @lisp (progn (print 'foo) (print 'bar)) @print{} foo @print{} bar @result{} bar @end lisp ``` -------------------------------- ### @verbatim environment example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the @verbatim environment with a sample block of text. No character substitutions are made, all commands are ignored until @end verbatim, and the text is typeset in a fixed-width font without indentation or filling. All spaces and blank lines are significant, including tabs. ```texinfo This is an example of text written in a @verbatim block. No character substitutions are made. All commands are ignored, until `end verbatim'. In the printed manual, the text is typeset in a fixed-width font, and not indented or filled. All spaces and blank lines are significant, including tabs. ``` -------------------------------- ### Master Menu Example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of a master menu in Texinfo, showing the main menu entries, index entries, and a detailed node listing enclosed in @detailmenu and @end detailmenu. ```texinfo @menu * Copying Conditions:: Your rights. * Overview:: Texinfo in brief. ... * Command and Variable Index:: * Concept Index:: @detailmenu --- The Detailed Node Listing --- Overview of Texinfo * Reporting Bugs:: ... ... Beginning a Texinfo File * Sample Beginning:: ... ... @end detailmenu @end menu ``` -------------------------------- ### Short Sample Texinfo File Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A complete minimal Texinfo file demonstrating the basic structure: header, copying, titlepage, contents, menu, chapters, index, and @bye. Use as a starting template for simple manuals. ```texinfo \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename sample.info @settitle Sample Manual 1.0 @c %**end of header @copying This is a short example of a complete Texinfo file. Copyright (C) 2002 Free Software Foundation, Inc. @end copying @titlepage @title Sample Title @page @vskip 0pt plus 1filll @insertcopying @end titlepage @c Output the table of the contents at the beginning. @contents @ifnottex @node Top @insertcopying @end ifnottex @menu * First Chapter:: The first chapter is the only chapter in this sample. * Index:: Complete index. @end menu @node First Chapter @chapter First Chapter @cindex chapter, first This is the first chapter. @cindex index entry, another Here is a numbered list. @enumerate @item This is the first item. @item This is the second item. @end enumerate @node Index @unnumbered Index @printindex cp @bye ``` -------------------------------- ### @titlefont{Texinfo} example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Use @titlefont to select a large font for the title. This example shows the command with the argument 'Texinfo'. ```texinfo @titlefont{Texinfo} ``` -------------------------------- ### Creating a section with @section Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of a basic @section command followed by its Info output, which underlines the title with equals signs. ```texinfo @section This is a section ``` ```plaintext This is a section ================= ``` -------------------------------- ### @sp 2 example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Use @sp to insert vertical space. This example inserts two blank lines on the printed page. ```texinfo @sp 2 ``` -------------------------------- ### Info URI syntax examples Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Unofficial URI syntax for referring to Info files, as used with Emacs/W3. The 'info' program itself does not follow URIs. ```text info:///usr/info/emacs#Dissociated%20Press info:emacs#Dissociated%20Press info://localhost/usr/info/emacs#Dissociated%20Press ``` -------------------------------- ### Example of apply function usage Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the apply function with various arguments and the resulting output, including an error case. The example is from the Emacs Lisp manual and demonstrates how apply appends the last argument list. ```lisp (setq f 'list) => list (apply f 'x 'y 'z) error--> Wrong type argument: listp, z (apply '+ 1 2 '(3 4)) => 10 (apply '+ '(1 2 3 4)) => 10 (apply 'append '((a b c) nil (x y z) nil)) => (a b c x y z) ``` -------------------------------- ### @equiv{} example: (make-sparse-keymap) Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to use @equiv{} to indicate that two expressions produce identical results. The source uses @lisp and @end lisp delimiters, and the rendered output shows the == glyph. ```texinfo @lisp (make-sparse-keymap) @equiv{} (list 'keymap) @end lisp ``` ```lisp (make-sparse-keymap) == (list 'keymap) ``` -------------------------------- ### Start of header line Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A Texinfo comment marking the start of the header region. It must be on the second line and is followed by @setfilename and @settitle lines. ```texinfo @c %**start of header ``` -------------------------------- ### Menu Example with Texinfo Source and Output Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A basic Texinfo menu with two entries and its rendered Info output. The first entry uses the full form, the second uses the preferred double-colon form. ```texinfo @menu * menu entry name: Node name. A short description. * Node name:: This form is preferred. @end menu ``` ```texinfo * menu: * menu entry name: Node name. A short description. * Node name:: This form is preferred. ``` -------------------------------- ### Complete copyright page example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Puts together @page, @vskip, @insertcopying, and additional publisher information within @titlepage. ```texinfo @titlepage ... @page @vskip 0pt plus 1filll @insertcopying Published by ... Cover art by ... @end titlepage ``` -------------------------------- ### Set makeinfo-options in .emacs Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example configuration for the makeinfo-options variable in the .emacs initialization file. It sets paragraph indentation, disables splitting, sets fill column, and enables verbose output. ```emacs-lisp (setq makeinfo-options "--paragraph-indent=0 --no-split --fill-column=70 --verbose") ``` -------------------------------- ### @anchor example and its output Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to define an anchor with @anchor and refer to it with @xref. The @anchor command produces no output. The output shows the rendered text with the cross-reference. ```texinfo This marks the @anchor{x-spot}spot. ... @xref{x-spot,,the spot}. ``` ```text This marks the spot. ... See [the spot], page 1. ``` -------------------------------- ### @xref example with omitted second argument Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of @xref with four and five arguments, omitting the second argument. References 'Electrical Effects' in 'weather' Info file, producing the Info output shown. ```texinfo @xref{Electrical Effects, , Thunder and Lightning, weather, An Introduction to Meteorology}, for details. ``` ```text *Note Thunder and Lightning: (weather)Electrical Effects, for details. ``` -------------------------------- ### @image with explicit extension Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of using the optional fifth argument to specify the file extension, causing makeinfo --html to try foo.xpm. ```texinfo @image{foo,,,,xpm} ``` -------------------------------- ### Top Node Example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of a Top node in Texinfo, enclosed in @ifnottex to appear only in online output. Includes @node Top, @top, @insertcopying, and a @menu with placeholder entries. ```texinfo @ifnottex @node Top @top Sample Title @insertcopying Additional general information. @menu * First Chapter:: * Second Chapter:: ... * Index:: @end menu ``` -------------------------------- ### @expansion{} example: (third '(a b c)) Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to use @expansion{} to indicate macro expansion and @result{} for the final evaluation result. The source uses @lisp and @end lisp delimiters. ```texinfo @lisp (third '(a b c)) @expansion{} (car (cdr (cdr '(a b c)))) @result{} c @end lisp ``` ```lisp (third '(a b c)) ==> (car (cdr (cdr '(a b c)))) => c ``` -------------------------------- ### Format and print Using and Porting GNU CC with texi2dvi Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Run texi2dvi on gcc.texinfo to produce gcc.dvi, then print the DVI file with lpr -d. This example is from the 'From an Emacs Shell' section. ```shell texi2dvi gcc.texinfo lpr -d gcc.dvi ``` -------------------------------- ### Blank lines around @table example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Demonstrates the recommended blank line placement around @table and @end table commands: blank line before @table and after @end table, but not after @table or before @end table. The example also shows @noindent after the table. ```texinfo Types of fox: @table @samp @item Quick Jump over lazy dogs. @item Brown Also jump over lazy dogs. @end table @noindent On the other hand, ... ``` -------------------------------- ### @image with proportional scaling Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example that scales ridt.eps to one inch vertically with width scaled proportionately. ```texinfo @image{ridt,,1in} ``` -------------------------------- ### Example of a footnote in the separate node style Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the format of a footnote in the 'Separate' node style, where footnotes are placed in an automatically constructed node named by appending '-Footnotes' to the node name. The example shows the header line and the footnote text. ```plaintext File: texinfo.info Node: Overview-Footnotes, Up: Overview (1) The first syllable of "Texinfo" is pronounced like "speck", not "hex". ... ``` -------------------------------- ### Example document with @set and @ifset Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows a document with two variants: text between @ifset large and @end ifset is included only when the 'large' flag is set. ```texinfo You can use this machine to dig up shrubs without hurting them. @set large @ifset large It can also dig up fully grown trees. @end ifset Remember to replant promptly ... ``` -------------------------------- ### @value expansion example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how @value{foo} is replaced by the string set with @set. The @value command can be used within a paragraph, while @set must be on its own line. ```texinfo @value{foo} to this: This is a string. ``` -------------------------------- ### @xref to Top node of GNU Make Manual Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of @xref to the 'Top' node of The GNU Make Manual, with 'Overview' as the third argument. Produces the Info output shown. ```texinfo @xref{Top, , Overview, make, The GNU Make Manual}. ``` ```text *Note Overview: (make)Top. ``` -------------------------------- ### install-info synopsis Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the command-line syntax for install-info. The info-file and dir-file arguments are optional if the corresponding options are provided. There are no compile-time defaults and standard input is never used. ```bash install-info [option]... [info-file [dir-file]] ``` -------------------------------- ### @setchapternewpage odd example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Causes each chapter to start on a fresh odd-numbered page and formats for double-sided printing. This is the form most often used for books and manuals. ```texinfo @setchapternewpage odd ``` -------------------------------- ### Example of the 'Top' node line in an Info file Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the 'Up' pointer of the 'Top' node referring back to the 'dir' file. The 'dir' file name is written in upper case here, but can be either case. ```plaintext File: emacs Node: Top, Up: (DIR), Next: Distrib ``` -------------------------------- ### @documentdescription environment Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Use the @documentdescription environment to set the HTML meta description. It must be specified before the first node of the document. The example shows the Texinfo source and the resulting HTML output. ```texinfo @documentdescription descriptive text. @end documentdescription ``` ```html ``` -------------------------------- ### Using @need to prevent page breaks Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A line containing only @need n starts a new page if fewer than n mils remain. Do not use braces around the argument. This example uses @need 800 to ensure at least 800 mils remain before the following paragraph. ```texinfo @need 800 This paragraph is preceded by ... ``` -------------------------------- ### @quotation example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to write an @quotation command on a line by itself, followed by the quoted text and an @end quotation line. Both the @quotation and @end quotation lines disappear from the output. ```texinfo @quotation This is a foo. @end quotation ``` -------------------------------- ### Chapter 2 Node and Chapter Command Example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Texinfo source showing the @node command followed by the @chapter command for Chapter 2, as it appears at the beginning of a chapter in a structured manual. ```texinfo @node Chapter 2, Chapter 3, Chapter 1, top @chapter Chapter 2 ``` -------------------------------- ### @cartouche example with @example block Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Use @cartouche inside an @example block to draw a rounded rectangle around the example in printed manuals. It has no effect in other output files. ```texinfo @example @cartouche % pwd /usr/local/share/emacs @end cartouche @end example ``` -------------------------------- ### Using @group inside @example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Place @group and @end group inside @example and @end example to keep the example on one page. @group works reliably only within @example, @display, @format, @flushleft, and @flushright. Forgetting @end group can cause strange TeX error messages. ```texinfo @example @group ... @end group @end example ``` -------------------------------- ### @pagesizes 200mm,150mm example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Specifies a custom text area size of 200mm height and 150mm width. The height comes first, then the width, separated by a comma. This command is ignored by makeinfo. ```texinfo @pagesizes 200mm,150mm ``` -------------------------------- ### Beginning of a chapter with @node, @chapter, and @cindex Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example from the 'Ending a Texinfo File' chapter showing the sequence of @node, comment, @chapter, and @cindex commands. The @node line specifies next, previous, and up pointers. ```texinfo @node Ending a File, Structuring, Beginning a File, Top @comment node-name, next, previous, up @chapter Ending a Texinfo File @cindex Ending a Texinfo file @cindex Texinfo file ending @cindex File ending ``` -------------------------------- ### @chapter command example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows the Texinfo syntax for the @chapter command, used to identify a chapter. The command is written at the beginning of a line followed by the chapter title. ```texinfo @chapter Chapter Structuring ``` -------------------------------- ### @flushright example source and output Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows @flushright, which right-justifies each line while leaving the left end ragged, commonly used for return addresses. The command is written on its own line and ended with @end flushright. ```texinfo @flushright Here is an example of text written flushright. The @code{@flushright} command right justifies every line but leaves the left end ragged. @end flushright ``` ```text Here is an example of text written flushright. The @flushright command right justifies every line but leaves the left end ragged. ``` -------------------------------- ### Top node with @top sectioning command Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Typical start of a Top node using @node Top followed by @top with the manual title. ```texinfo @node Top @top Your Manual Title ``` -------------------------------- ### @pagesizes 11.5in example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Specifies a custom text area height of 11.5 inches, with no width specified. This is reasonable for printing on B5-size paper. The command is ignored by makeinfo. ```texinfo @pagesizes 11.5in ``` -------------------------------- ### @hyphenation example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Tells TeX how to hyphenate specific words. Put a '-' at each hyphenation point. TeX only uses the specified points when the words match exactly, so give all necessary variants. No effect on Info output. ```texinfo @hyphenation{man-u-script man-u-scripts} ``` -------------------------------- ### Info cross reference syntax examples Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Two forms of Info cross references: one with just a node name and one with a cross-reference name and node name. ```texinfo *Note node-name::. ``` ```texinfo *Note cross-reference-name: node-name. ``` -------------------------------- ### Update all nodes and menus then format buffer for Info Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html First updates all nodes and menus with texinfo-master-menu, then creates an Info file with makeinfo-buffer. The file must include a line with @setfilename in its header for formatting to work. ```emacs-lisp C-u C-c C-u m or C-u M-x texinfo-master-menu ``` ```emacs-lisp C-c C-m C-b or M-x makeinfo-buffer ``` -------------------------------- ### @sc command usage example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to use @sc to set text in small caps. The text between braces should be in lower case. In Info output, the text is uppercased; in HTML, it is uppercased and rendered in a smaller font. ```texinfo The @sc{acm} and @sc{ieee} are technical societies. ``` -------------------------------- ### @exampleindent command syntax Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Syntax for the @exampleindent command. Write it at the beginning of a line followed by either 'asis' or a number. The default indent value is 5, and it is ignored for HTML output. ```texinfo @exampleindent indent ``` -------------------------------- ### Combined @titlefont and @title example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A real-life example combining @titlefont and @title for a very long title. Uses @value for edition and release numbers. ```texinfo @titlepage @titlefont{GNU Software} @sp 1 @title for MS-Windows and MS-DOS @subtitle Edition @value{e} for Release @value{cde} @author by Daniel Hagerty, Melissa Weisshaus @author and Eli Zaretskii ``` -------------------------------- ### Sample Texinfo file beginning Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A complete minimal Texinfo file header and structure, including the header commands, copying permissions, title page, and Top node. This is the most critical part of any Texinfo file. ```texinfo \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename infoname.info @settitle name-of-manual version @c %**end of header @copying This manual is for program, version version. Copyright @copyright{} years copyright-owner. @quotation Permission is granted to ... @end quotation @end copying @titlepage @title name-of-manual-when-printed @subtitle subtitle-if-any @subtitle second-subtitle @author author @c The following two commands @c start the copyright page. @page @vskip 0pt plus 1filll @insertcopying Published by ... @end titlepage @c So the toc is printed in the right place. @contents @ifnottex @node Top @top title @insertcopying @end ifnottex @menu * First Chapter:: Getting started ... * Second Chapter:: ... ... * Copying:: Your rights and freedoms. @end menu @node First Chapter @chapter First Chapter @cindex first chapter @cindex chapter, first ... ``` -------------------------------- ### @center @titlefont{Texinfo} example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Use @center at the beginning of a line to center the remaining text. This example centers the title 'Texinfo' in the title font. ```texinfo @center @titlefont{Texinfo} ``` -------------------------------- ### @enumerate with numeric argument 3 Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Numbered list starting at 3. The numeric argument sets the starting number, useful for continuing an interrupted list. ```texinfo @enumerate 3 @item Predisposing causes. @item Precipitating causes. @item Perpetuating causes. @end enumerate ``` -------------------------------- ### Using @deffnx to create multiple header lines Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Shows how to create two header lines for a definition by following @deffn with @deffnx. The @deffnx command works like @deffn but does not add extra vertical space. The example defines two interactive commands, isearch-forward and isearch-backward, with a shared description. ```texinfo @deffn {Interactive Command} isearch-forward @deffnx {Interactive Command} isearch-backward These two search commands are similar except ... @end deffn ``` -------------------------------- ### Example of @footnote in Texinfo source Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html An example of a footnote in Texinfo source. Note the punctuation sequence '.};' where the first period ends the footnote and the semicolon belongs to the sentence. ```texinfo ...a sample footnote@footnote{Here is the sample footnote.}; in the Texinfo source... ``` -------------------------------- ### makeinfo --fill-column=68 bison.texinfo Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Creates an Info file for bison.texinfo with each line filled to 68 columns. ```shell makeinfo --fill-column=68 bison.texinfo ``` -------------------------------- ### @flushleft example source and output Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Demonstrates @flushleft, which aligns lines to the left margin without filling text. The command is written on its own line and ended with @end flushleft. The output shows the text as written, left-aligned. ```texinfo @flushleft This text is written flushleft. @end flushleft ``` ```text This text is written flushleft. ``` -------------------------------- ### Format and print Bison Manual with texi2dvi and lpr Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Simplified workflow using texi2dvi to format and then lpr to print. Includes a commented alternative using dvips. ```shell texi2dvi bison.texinfo lpr -d bison.dvi # or perhaps dvips bison.dvi -o ``` -------------------------------- ### Dump .fmt file with initex texinfo @dump Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Run this command to create a .fmt file for faster TeX loading of Texinfo; requires epsf.tex to be findable by TeX. ```shell initex texinfo @dump ``` -------------------------------- ### Sample outer Texinfo file with @include Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Complete outer Texinfo file demonstrating @include directives. Before running texinfo-multiple-files-update, which would insert a master menu. Includes title page, @ifinfo section, and @include commands for foo.texinfo, bar.texinfo, and concept-index.texinfo. ```texinfo \input texinfo @c -*-texinfo-*- @setfilename include-example.info @settitle Include Example @setchapternewpage odd @titlepage @sp 12 @center @titlefont{Include Example} @sp 2 @center by Whom Ever @page @vskip 0pt plus 1filll Copyright @copyright{} 2002 Free Software Foundation, Inc. @end titlepage @ifinfo @node Top, First, , (dir) @top Master Menu @end ifinfo @include foo.texinfo @include bar.texinfo @include concept-index.texinfo @summarycontents @contents @bye ``` -------------------------------- ### @w example: prevent line breaks in a phrase Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Prevents TeX from hyphenating or breaking a long name or phrase. The example shows using @w with @samp to keep 'ftp.gnu.org' together. ```texinfo You can copy GNU software from @w{@samp{ftp.gnu.org}}. ``` -------------------------------- ### Simple concept-index.texinfo file Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html A minimal concept index file using @printindex cp. ```texinfo @node Concept Index @unnumbered Concept Index @printindex cp ``` -------------------------------- ### @copying skeletal example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Skeletal example of the @copying command, placed early in the document after the header. The @quotation block has no legal significance but improves readability. The text is output as a comment in Info, HTML, and XML output files, and is not output implicitly in plain text or TeX. ```texinfo @copying This manual is for program (version version), which ... Copyright @copyright{} years copyright-owner. @quotation Permission is granted to ... @end quotation @end copying ``` -------------------------------- ### Texinfo File Beginning: \input texinfo and @setfilename Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Every Texinfo file input to TeX must begin with these two lines. The \input command loads the macros needed, and @setfilename opens auxiliary files. ```texinfo \input texinfo @setfilename arg-not-used-by-TeX ``` -------------------------------- ### Section title with @-commands Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of a section title using @code{@@unnumberedsec}, @code{@@appendixsec}, and @code{@@heading}. ```texinfo @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading} ``` -------------------------------- ### Printing a new index with @printindex Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of printing the 'au' index using @printindex within a node and unnumbered chapter. ```texinfo @node Author Index, Subject Index, , Top @unnumbered Author Index @printindex au ``` -------------------------------- ### TeX startup output when header lines are missing Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html TeX output showing the asterisk prompt when header lines are missing, indicating TeX is waiting for input. ```tex This is TeX, Version 3.14159 (Web2c 7.0) (test.texinfo [1]) * ``` -------------------------------- ### Format for Info with makeinfo Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Keybindings for the C-based makeinfo formatting commands, including recentering and killing the output buffer. ```plaintext C-c C-m C-r Format the region. C-c C-m C-b Format the buffer. C-c C-m C-l Recenter the makeinfo output buffer. C-c C-m C-k Kill the makeinfo formatting job. ``` -------------------------------- ### Info-validate Error: Invalid Next Pointer Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example error message when a node's Next pointer does not point to an existing node. ```text In node "Overview", invalid Next: Texinfo Mode ``` -------------------------------- ### Cross reference with swapped brace and parenthesis Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of a cross reference where the closing brace and parenthesis are swapped, leading to incorrect formatting. ```plaintext (@xref{Catching Mistakes), for more info.} ``` -------------------------------- ### Minimum Texinfo file beginning Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html The mandatory beginning of a Texinfo file. The \input texinfo line tells TeX to use texinfo.tex, @setfilename names the Info file and opens auxiliary files (all text before it is ignored), and @settitle sets the title for printed headers and HTML description. ```texinfo \input texinfo @setfilename info-file-name @settitle name-of-manual ``` -------------------------------- ### Write title page with @value references Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of a @titlepage block that uses @value{EDITION} and @value{UPDATE-MONTH} for the printed manual. ```texinfo @titlepage @title GNU Make @subtitle A Program for Directing Recompilation @subtitle Edition @value{EDITION}, ... @subtitle @value{UPDATE-MONTH} @page @insertcopying ... @end titlepage ``` -------------------------------- ### Run makeinfo from shell to create Info file Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Use this command to convert a Texinfo file into an Info file. Replace 'bison.texinfo' with your Texinfo file name. ```shell makeinfo bison.texinfo ``` -------------------------------- ### @w example: non-breakable space Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Uses @w with a space inside to produce a non-breakable space, preventing line breaks at that point. ```texinfo None of the formatters will break at this@w{ }space. ``` -------------------------------- ### Define an 'au' index with @defindex Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of defining a new index named 'au'. This creates the @auindex command for marking entries. ```texinfo @defindex au ``` -------------------------------- ### @enumerate without argument Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Numbered list starting at 1. Each item is preceded by @item on its own line. Blank lines between entries are recommended. ```texinfo @enumerate @item Underlying causes. @item Proximate causes. @end enumerate ``` -------------------------------- ### Info-validate Error: Missing Previous Pointer Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example error message when a node lacks a Previous pointer that should point back to the previous node. ```text In node "Texinfo Mode", should have Previous: Overview ``` -------------------------------- ### Alias moviecite to cite Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of using @alias to define a new command 'moviecite' that behaves like 'cite', preserving semantic information. ```texinfo @alias moviecite = cite ``` -------------------------------- ### Sequence of commands for formatting a buffer Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html The usual sequence of commands to format a buffer: run texi2dvi, print the DVI file, and display the printer queue. Comments are shown to the right. ```emacs-lisp C-c C-t C-b Run texi2dvi on the buffer. C-c C-t C-p Print the DVI file. C-c C-t C-q Display the printer queue. ``` -------------------------------- ### Write Top node with @insertcopying Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example of a @ifnottex block for the Info file, using @node Top and @insertcopying to include the copying text. ```texinfo @ifnottex @node Top @top Make @insertcopying ... @end ifnottex ``` -------------------------------- ### TeX cross reference output examples Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Two forms of TeX cross references: one with a node name and one with a title or topic. ```texinfo See Section section-number \[node-name\], page page. ``` ```texinfo See Section section-number \[title-or-topic\], page page. ``` -------------------------------- ### Texinfo buffer with missing closing brace in cross-reference Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Example Texinfo buffer showing a cross-reference with a missing closing brace, which causes a TeX error. ```texinfo ---------- Buffer: texinfo.texi ---------- name of the Texinfo file as an extension. The @samp{??} are `wildcards' that cause the shell to substitute all the raw index files. (@xref{sorting indices, for more information about sorting indices.)@refill ---------- Buffer: texinfo.texi ---------- ``` -------------------------------- ### Part 2: Summary Description and Copyright - @copying block Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Contains the copyright and permission text. A real manual includes more text according to its license. ```texinfo @copying This is a short example of a complete Texinfo file, version 1.0. Copyright @copyright{} 2002 Free Software Foundation, Inc. @end copying ``` -------------------------------- ### Format Texinfo file with tex command Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Run the shell command 'tex' followed by the Texinfo filename to produce a DVI file and auxiliary files for indices and cross references. ```shell tex foo.texi ``` -------------------------------- ### Complete Workflow: Unsplit, Tagify, Validate Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html The three-step sequence to prepare and validate a large Info file. ```emacs-lisp C-u M-x texinfo-format-buffer M-x Info-tagify M-x Info-validate ``` -------------------------------- ### @paragraphindent indent example Source: https://ftp.gnu.org/old-gnu/Manuals/texinfo-4.2/html_mono/texinfo.html Specifies paragraph indentation. The indent argument can be 'asis', 'none', or a number. The default value is 3. Ignored for HTML output. ```texinfo @paragraphindent indent ```