[ < ] [ > ] [ << ] [ 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 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 © 2005 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 @top GNU Sample @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

Following 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:

• The ‘\$Id:’ comment is for the CVS (see (cvs)Top section ‘Overview’ in Concurrent Versions System) or RCS (http://www.gnu.org/software/rcs) version control systems, which expand it into a string such as:  ```\$Id: texinfo.txi,v 1.225 2008/09/07 22:47:46 karl Exp \$ ```

(This is useful in all sources that use version control, not just manuals.) You may wish to include the ‘\$Id:’ comment in the `@copying` text, if you want a completely unambiguous reference to the documentation version.

If you want to literally write \$Id\$, use `@w`: `@w{\$}Id\$`. Unfortunately, this technique does not currently work in plain text output, since it’s not clear what should be done. We hope to find a solution in a future release.

• The ‘version.texi’ in the `@include` command is maintained automatically by Automake (see (automake)Top section ‘Introduction’ in GNU Automake). It sets the ‘VERSION’ and ‘UPDATED’ values used elsewhere. If your distribution doesn’t use Automake, but you do use XEmacs, you may find the time-stamp.el package helpful (see (xemacs)Time Stamps section ‘Time Stamps’ in XEmacs User’s Manual).
• The `@syncodeindex` command reflects the recommendation to use only one index where possible, to make it easier for readers to look up index entries.
• The `@dircategory` is for constructing the Info directory. See section Installing Info Directory Files, which includes a variety of recommended category names.
• The ‘Invoking’ node is a GNU standard to help users find the basic information about command-line usage of a given program. See (standards)Manual Structure Details section ‘Manual Structure Details’ in GNU Coding Standards.
• It is best to include the entire GNU Free Documentation License in a GNU manual, unless the manual is only a few pages long. Of course this sample is even shorter than that, but it includes the FDL anyway in order to show one conventional way to do so. The ‘fdl.texi’ file is available on the GNU machines and in the Texinfo and other GNU source distributions.

The FDL provides for omitting itself under certain conditions, but in that case the sample texts given here have to be modified. See section GNU Free Documentation License.

• If the FSF is not the copyright holder, then use the appropriate name.
• If your manual is not published on paper by the FSF, then omit the last sentence in the Back-Cover Text that talks about copies from GNU Press.
• If your manual has Invariant Sections (again, see the license itself for details), then change the text here accordingly.
• For documents that express your personal views, feelings or experiences, it is more appropriate to use a license permitting only verbatim copying, rather than the FDL. See section Verbatim Copying License.

Here is the sample document:

```\input texinfo   @c -*-texinfo-*-
@comment \$Id: texinfo.txi,v 1.225 2008/09/07 22:47:46 karl 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{} 2007 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.2 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 the freedom to
copy and modify this GNU manual.  Buying copies from the FSF
supports it in developing GNU and promoting software freedom.''
@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

This manual is for GNU Sample (version @value{VERSION}, @value{UPDATED}).
@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 GNU Free Documentation License
@appendix GNU Free Documentation License

@include fdl.texi

@node Index
@unnumbered Index

@printindex cp

@bye
```

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

## C.3 Verbatim Copying License

For software manuals and other documentation, it is important to use a license permitting free redistribution and updating, so that when a free program is changed, the documentation can be updated as well.

On the other hand, for documents that express your personal views, feelings or experiences, it is more appropriate to use a license permitting only verbatim copying.

Here is sample text for such a license permitting verbatim copying only. This is just the license text itself. For a complete sample document, see the previous sections.

```@copying
This document is a sample for allowing verbatim copying only.

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

@quotation
Permission is granted to make and distribute verbatim copies
of this entire document without royalty provided the
copyright notice and this permission notice are preserved.
@end quotation
@end copying
```

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

## C.4 All-permissive Copying License

For software manuals and other documentation, it is important to use a license permitting free redistribution and updating, so that when a free program is changed, the documentation can be updated as well.

On the other hand, for small supporting files, short manuals (under 300 lines long) and rough documentation (README files, INSTALL files, etc.), the full FDL would be overkill. They can use a simple all-permissive license.

Here is sample text for such an all-permissive license. This is just the license text itself. For a complete sample document, see the previous sections.

 ```Copyright © 2005 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. ```

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

This document was generated by Aidan Kehoe on December 27, 2016 using texi2html 1.82.
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.870324432849884, "perplexity": 6203.825027366064}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-13/segments/1552912202476.48/warc/CC-MAIN-20190321010720-20190321032720-00011.warc.gz"}