GNU Info

Info Node: (texinfo)Short Sample

(texinfo)Short Sample


Next: History Prev: Six Parts Up: Overview
Enter node , (file) or (file)node

A Short Sample Texinfo File
===========================

  Here is a complete but very short Texinfo file, in six parts.  The
first three parts of the file, from `\input texinfo' through to `@end
titlepage', look more intimidating than they are.  Most of the material
is standard boilerplate; when you write a manual, simply insert the
names for your own manual in this segment. (Note: Beginning a File.)

  In the following, the sample text is _indented_; comments on it are
not.  The complete file, without any comments, is shown in Note: Sample
Texinfo File.

Part 1: Header
--------------

The header does not appear in either the Info file or the printed
output.  It sets various parameters, including the name of the Info
file and the title used in the header.

     \input texinfo   @c -*-texinfo-*-
     @c %**start of header
     @setfilename sample.info
     @settitle Sample Document
     @setchapternewpage odd
     @c %**end of header

Part 2: Summary Description and Copyright
-----------------------------------------

The summary description and copyright segment does not appear in the
printed document.

     @ifinfo
     This is a short example of a complete Texinfo file.
     
     Copyright @copyright{} 2002 Free Software Foundation, Inc.
     @end ifinfo

Part 3: Titlepage and Copyright
-------------------------------

The titlepage segment does not appear in the Info file.

     @contents
     @titlepage
     @sp 10
     @title Sample Title
     
     @c The following two commands start the copyright page.
     @page
     @vskip 0pt plus 1filll
     Copyright @copyright{} 2002 Free Software Foundation, Inc.
     @end titlepage

Part 4: `Top' Node and Master Menu
----------------------------------

The `Top' node contains the master menu for the Info file.  Since a
printed manual uses a table of contents rather than a menu, the master
menu appears only in online output.

     @ifnottex
     @node Top
     @end ifnottex

     @menu
     * First Chapter::    The first chapter is the
                          only chapter in this sample.
     * Concept Index::    This index has two entries.
     @end menu

Part 5:  The Body of the Document
---------------------------------

The body segment contains all the text of the document, but not the
indices or table of contents.  This example illustrates a node and a
chapter containing an enumerated list.

     @node First Chapter
     @chapter First Chapter
     @cindex Chapter, first
     
     This is the contents of the first chapter.
     @cindex Another sample index entry
     
     Here is a numbered list.
     
     @enumerate
     @item
     This is the first item.
     
     @item
     This is the second item.
     @end enumerate
     
     The @code{makeinfo} command transforms a Texinfo file
     such as this into an Info file or other output;
     @TeX typesets it for a printed manual.

Part 6: The End of the Document
-------------------------------

The end segment contains commands for generating an index in a node and
unnumbered chapter of its own, (usually) for generating the table of
contents, and the `@bye' command that marks the end of the document.

     @node    Concept Index
     @unnumbered Concept Index
     
     @printindex cp
     
     @bye

The Results
-----------

  Here is what the contents of the first chapter of the sample look
like:


     This is the contents of the first chapter.

     Here is a numbered list.

       1. This is the first item.

       2. This is the second item.

     The `makeinfo' and `texinfo-format-buffer' commands transform a
     Texinfo file such as this into an Info file; and TeX typesets it
     for a printed manual.


automatically generated by info2www version 1.2.2.9