[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

C. Sample Texinfo Files

The first example is from the first chapter (see section A Short Sample Texinfo File), given here in its entirety, without commentary. The second sample includes the full texts to be used in GNU manuals.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

C.1 Short Sample

Here is a complete, short sample Texinfo file, without any commentary. You can see this file, with comments, in the first chapter. See section A Short Sample Texinfo File.

In a nutshell: The makeinfo program transforms a Texinfo source file such as this into an Info file or HTML; and TeX typesets it for a printed manual.


 
\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

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

C.2 GNU Sample Texts

Here is a sample Texinfo document with the full texts that should be used in GNU manuals.

As well as the legal texts, it also serves as a practical example of how many elements in a GNU system can affect the manual. If you’re not familiar with all these different elements, don’t worry. They’re not required and a perfectly good manual can be written without them. They’re included here nonetheless because many manuals do (or could) benefit from them.

See section A Short Sample Texinfo File, for a minimal example of a Texinfo file. See section Beginning a Texinfo File, for a full explanation of that minimal example.

Here are some notes on the example:

Here is the sample document:

 
\input texinfo    @c -*-texinfo-*-
@comment Id: texinfo.txi,v 1.2 2003/02/24 18:17:06 pertusus Exp $
@comment %**start of header
@setfilename sample.info
@include version.texi
@settitle GNU Sample @value{VERSION}
@syncodeindex pg cp
@comment %**end of header
@copying
This manual is for GNU Sample
(version @value{VERSION}, @value{UPDATED}),
which is an example in the Texinfo documentation.

Copyright @copyright{} 2002 Free Software Foundation, Inc.

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.  A copy of the
license is included in the section entitled ``GNU Free Documentation
License.''

(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
this GNU Manual, like GNU software.  Copies published by the Free
Software Foundation raise funds for GNU development.''
@end quotation
@end copying

@dircategory Texinfo documentation system
@direntry
* sample: (sample)Invoking sample.    
@end direntry

@titlepage
@title GNU Sample
@subtitle for version @value{VERSION}, @value{UPDATED}
@author A.U. Thor (@email{bug-texinfo@@gnu.org})
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage

@contents

@ifnottex
@node Top
@top GNU Sample

@insertcopying
@end ifnottex

@menu
* Invoking sample::
* Copying This Manual::
* Index::
@end menu


@node Invoking sample
@chapter Invoking sample

@pindex sample
@cindex invoking @command{sample}

This is a sample manual.  There is no sample program to
invoke, but if there was, you could see its basic usage
and command line options here.


@node Copying This Manual
@appendix Copying This Manual

@menu
* GNU Free Documentation License::  License for copying this manual.
@end menu

@include fdl.texi


@node Index
@unnumbered Index

@printindex cp

@bye

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by a tester on a sunny day using texi2html.