Viewing File: /usr/share/doc/texinfo/html/Tips.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is for GNU Texinfo (version 6.7, 23 September 2019),
a documentation system that can produce both online information and a
printed manual from a single source using semantic markup.

Copyright (C) 1988, 1990, 1991, 1992, 1993, 1995, 1996, 1997,
1998, 1999, 2001, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Free Software
Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tips (GNU Texinfo 6.7)</title>

<meta name="description" content="Tips (GNU Texinfo 6.7)">
<meta name="keywords" content="Tips (GNU Texinfo 6.7)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2any">
<link href="index.html" rel="start" title="Top">
<link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html" rel="up" title="Top">
<link href="Sample-Texinfo-Files.html" rel="next" title="Sample Texinfo Files">
<link href="Obsolete-_0040_002dCommands.html" rel="prev" title="Obsolete @-Commands">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<span id="Tips"></span><div class="header">
<p>
Next: <a href="Sample-Texinfo-Files.html" accesskey="n" rel="next">Sample Texinfo Files</a>, Previous: <a href="_0040_002dCommand-Details.html" accesskey="p" rel="prev">@-Command Details</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="Tips-and-Hints"></span><h2 class="appendix">Appendix B Tips and Hints</h2>

<p>Here are some tips for writing Texinfo documentation:
</p>
<span id="index-Tips"></span>
<span id="index-Usage-tips"></span>
<span id="index-Hints"></span>
<ul>
<li> Write in the present tense, not in the past or the future.

</li><li> Write actively!  For example, write &ldquo;We recommend that &hellip;&rdquo; rather
than &ldquo;It is recommended that &hellip;&rdquo;.

</li><li> Use 70 or 72 as your fill column.  Longer lines are hard to read.

</li><li> Include a copyright notice and copying permissions.
</li></ul>


<span id="Index_002c-Index_002c-Index_0021"></span><h4 class="subsubheading">Index, Index, Index!</h4>

<p>Write many index entries, in different ways.
Readers like indices; they are helpful and convenient.
</p>
<p>Although it is easiest to write index entries as you write the body of
the text, some people prefer to write entries afterwards.  In either
case, write an entry before the paragraph to which it applies.  This
way, an index entry points to the first page of a paragraph that is
split across pages.
</p>
<p>Here are more index-related hints we have found valuable:
</p>
<ul>
<li> Write each index entry differently, so each entry refers to a different
place in the document.

</li><li> Write index entries only where a topic is discussed significantly.  For
example, it is not useful to index &ldquo;debugging information&rdquo; in a
chapter on reporting bugs.  Someone who wants to know about debugging
information will certainly not find it in that chapter.

</li><li> Consistently capitalize the first word of every concept index entry,
or else consistently use lowercase.  Terse entries often call for
lowercase; longer entries for capitalization.  Whichever case
convention you use, please use one or the other consistently!  Mixing
the two styles looks bad.

</li><li> Always capitalize or use uppercase for those words in an index for
which this is proper, such as names of countries or acronyms.  Always
use the appropriate case for case-sensitive names, such as those in C or
Lisp.

</li><li> Write the indexing commands that refer to a whole section immediately
after the section command, and write the indexing commands that refer to
a paragraph before that paragraph.

<p>In the example that follows, a blank line comes after the index
entry for &ldquo;Leaping&rdquo;:
</p>
<div class="example">
<pre class="example">@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.
</pre></div>

<p>(Note that the example shows entries for the same concept that are
written in different ways&mdash;&lsquo;<samp>Lazy dog</samp>&rsquo;, and &lsquo;<samp>Dog, lazy</samp>&rsquo;&mdash;so
readers can look up the concept in different ways.)
</p></li></ul>


<span id="Blank-Lines"></span><h4 class="subsubheading">Blank Lines</h4>

<ul>
<li> Insert a blank line between a sectioning command and the first following
sentence or paragraph, or between the indexing commands associated with
the sectioning command and the first following sentence or paragraph, as
shown in the tip on indexing.  It makes the source easier to read.

</li><li> Always insert a blank line before a <code>@table</code> command and after an
<code>@end table</code> command; but never insert a blank line after an
<code>@table</code> command.

<p>For example,
</p>
<div class="example">
<pre class="example">Types of fox:

@table @samp
@item Quick
Jump over lazy dogs.
</pre><pre class="example">

</pre><pre class="example">@item Brown
Also jump over lazy dogs.
@end table

</pre><pre class="example">@noindent
On the other hand, &hellip;
</pre></div>

<p>Insert blank lines before and after <code>@itemize</code> &hellip; <code>@end
itemize</code> and <code>@enumerate</code> &hellip; <code>@end enumerate</code> in the
same way.
</p></li></ul>


<span id="Complete-Phrases"></span><h4 class="subsubheading">Complete Phrases</h4>

<p>Complete phrases are easier to read than &hellip;
</p>
<ul>
<li> Write entries in an itemized list as complete sentences; or at least, as
complete phrases.  Incomplete expressions &hellip; awkward &hellip; like
this.

</li><li> Write the prefatory sentence or phrase for a multi-item list or table as
a complete expression.  Do not write &ldquo;You can set:&rdquo;; instead, write
&ldquo;You can set these variables:&rdquo;.  The former expression sounds cut off.
</li></ul>


<span id="Editions_002c-Dates-and-Versions"></span><h4 class="subsubheading">Editions, Dates and Versions</h4>

<p>Include edition numbers, version numbers, and dates in the
<code>@copying</code> text (for people reading the Texinfo file, and for the
legal copyright in the output files).  Then use <code>@insertcopying</code>
in the <code>@titlepage</code> section for people reading the printed
output (see <a href="Short-Sample.html">Short Sample</a>).
</p>
<p>It is easiest to handle such version information using <code>@set</code>
and <code>@value</code>.  See <a href="_0040value-Example.html"><code>@value</code> Example</a>, and <a href="GNU-Sample-Texts.html">GNU Sample Texts</a>.
</p>

<span id="Definition-Commands-2"></span><h4 class="subsubheading">Definition Commands</h4>

<p>Definition commands are <code>@deffn</code>, <code>@defun</code>,
<code>@defmac</code>, and the like, and enable you to write descriptions in
a uniform format.
</p>
<ul>
<li> Write just one definition command for each entity you define with a
definition command.  The automatic indexing feature creates an index
entry that leads the reader to the definition.

</li><li> Use <code>@table</code> &hellip; <code>@end table</code> in an appendix that
contains a summary of functions, not <code>@deffn</code> or other definition
commands.
</li></ul>


<span id="Capitalization"></span><h4 class="subsubheading">Capitalization</h4>

<ul>
<li> Capitalize &ldquo;Texinfo&rdquo;; it is a name.  Do not write the &lsquo;<samp>x</samp>&rsquo; or
&lsquo;<samp>i</samp>&rsquo; in uppercase.

</li><li> Capitalize &ldquo;Info&rdquo;; it is a name.

</li><li> Write TeX using the <code>@TeX{}</code> command.  Note the uppercase
&lsquo;<samp>T</samp>&rsquo; and &lsquo;<samp>X</samp>&rsquo;.  This command causes the formatters to
typeset the name according to the wishes of Donald Knuth, who wrote
TeX.  (Likewise <code>@LaTeX{}</code> for LaTeX.)
</li></ul>


<span id="Spaces"></span><h4 class="subsubheading">Spaces</h4>

<p>Do not use spaces to format a Texinfo file, except inside of
<code>@example</code> &hellip; <code>@end example</code> and other literal
environments and commands.
</p>
<p>For example, TeX fills the following:
</p>
<div class="example">
<pre class="example">   @kbd{C-x v}
   @kbd{M-x vc-next-action}
      Perform the next logical operation
      on the version-controlled file
      corresponding to the current buffer.
</pre></div>

<p>so it looks like this:
</p>
<blockquote>
<p>&lsquo;C-x v&rsquo; &lsquo;M-x vc-next-action&rsquo; Perform the next logical operation on the
version-controlled file corresponding to the current buffer.
</p></blockquote>

<p>In this case, the text should be formatted with
<code>@table</code>, <code>@item</code>, and <code>@itemx</code>, to create a table.
</p>

<span id="g_t_0040code_002c-_0040samp_002c-_0040var_002c-and-_002d_002d_002d"></span><h4 class="subsubheading">@code, @samp, @var, and &lsquo;<samp>---</samp>&rsquo;</h4>

<ul>
<li> Use <code>@code</code> around Lisp symbols, including command names.
For example,

<div class="example">
<pre class="example">The main function is @code{vc-next-action}, &hellip;
</pre></div>

</li><li> Avoid putting letters such as &lsquo;<samp>s</samp>&rsquo; immediately after an
&lsquo;<samp>@code</samp>&rsquo;.  Such letters look bad.

</li><li> Use <code>@var</code> around meta-variables.  Do not write angle brackets
around them.

</li><li> Use three hyphens in a row, &lsquo;<samp>---</samp>&rsquo;, to indicate a long dash.  TeX
typesets these as a long dash and the Info formatters reduce three
hyphens to two.
</li></ul>


<span id="Periods-Outside-of-Quotes"></span><h4 class="subsubheading">Periods Outside of Quotes</h4>

<p>Place periods and other punctuation marks <em>outside</em> of quotations,
unless the punctuation is part of the quotation.  This practice goes
against some publishing conventions in the United States, but enables the
reader to distinguish between the contents of the quotation and the
whole passage.
</p>
<p>For example, you should write the following sentence with the period
outside the end quotation marks:
</p>
<div class="example">
<pre class="example">Evidently, &lsquo;<samp>au</samp>&rsquo; is an abbreviation for ``author''.
</pre></div>

<p>since &lsquo;<samp>au</samp>&rsquo; does <em>not</em> serve as an  abbreviation for
&lsquo;<samp>author.</samp>&rsquo; (with a period following the word).
</p>

<span id="Introducing-New-Terms"></span><h4 class="subsubheading">Introducing New Terms</h4>

<ul>
<li> Introduce new terms so that a reader who does not know them can
understand them from context; or write a definition for the term.

<p>For example, in the following, the terms &ldquo;check in&rdquo;, &ldquo;register&rdquo; and
&ldquo;delta&rdquo; are all appearing for the first time; the example sentence should be
rewritten so they are understandable.
</p>
<blockquote>
<p>The major function assists you in checking in a file to your
version control system and registering successive sets of changes to
it as deltas.
</p></blockquote>

</li><li> Use the <code>@dfn</code> command around a word being introduced, to indicate
that the reader should not expect to know the meaning already, and
should expect to learn the meaning from this passage.
</li></ul>


<span id="Program-Invocation-Nodes"></span><h4 class="subsubheading">Program Invocation Nodes</h4>

<p>You can invoke programs such as Emacs, GCC, and <code>gawk</code> from a
shell.  The documentation for each program should contain a section that
describes this.  Unfortunately, if the node names and titles for these
sections are all different, they are difficult for users to find.
</p>
<p>So, there is a convention to name such sections with a phrase beginning
with the word &lsquo;Invoking&rsquo;, as in &lsquo;Invoking Emacs&rsquo;; this way, users can
find the section easily.
</p>

<span id="ANSI-C-Syntax"></span><h4 class="subsubheading">ANSI C Syntax</h4>

<p>When you use <code>@example</code> to describe a C function&rsquo;s calling
conventions, use the ANSI C syntax, like this:
</p>
<div class="example">
<pre class="example">void dld_init (char *@var{path});
</pre></div>

<p>And in the subsequent discussion, refer to the argument values by
writing the same argument names, again highlighted with
<code>@var</code>.
</p>
<p>Avoid the obsolete style that looks like this:
</p>
<div class="example">
<pre class="example">#include &lt;dld.h&gt;

dld_init (path)
  char *path;
</pre></div>

<p>Also, it is best to avoid writing <code>#include</code> above the
declaration just to indicate that the function is declared in a
header file.  The practice may give the misimpression that the
<code>#include</code> belongs near the declaration of the function.  Either
state explicitly which header file holds the declaration or, better
yet, name the header file used for a group of functions at the
beginning of the section that describes the functions.
</p>
<span id="texi_002delements_002dby_002dsize"></span><span id="Node-Length"></span><h4 class="subsubheading">Node Length</h4>

<p>Keep nodes (sections) to a reasonable length, whatever reasonable
might be in the given context.  Don&rsquo;t hesitate to break up long nodes
into subnodes and have an extensive tree structure; that&rsquo;s what it&rsquo;s
there for.  Many times, readers will probably try to find a single
specific point in the manual, using search, indexing, or just plain
guessing, rather than reading the whole thing from beginning to end.
</p>
<p>You can use the <code>texi-elements-by-size</code> utility to see a list
of all nodes (or sections) in the document, sorted by size (either
lines or words), to find candidates for splitting.  It&rsquo;s in the
<samp>util/</samp> subdirectory of the Texinfo sources.
</p>

<span id="Bad-Examples"></span><h4 class="subsubheading">Bad Examples</h4>

<p>Here are several examples of bad writing to avoid:
</p>
<p>In this example, say, &ldquo; &hellip; you must <code>@dfn</code>{check
in} the new version.&rdquo;  That flows better.
</p>
<blockquote>
<p>When you are done editing the file, you must perform a
<code>@dfn</code>{check in}.
</p></blockquote>

<p>In the following example, say, &ldquo;&hellip; makes a unified interface such as VC
mode possible.&rdquo;
</p>
<blockquote>
<p>SCCS, RCS and other version-control systems all perform similar
functions in broadly similar ways (it is this resemblance which makes
a unified control mode like this possible).
</p></blockquote>

<p>And in this example, you should specify what &lsquo;it&rsquo; refers to:
</p>
<blockquote>
<p>If you are working with other people, it assists in coordinating
everyone&rsquo;s changes so they do not step on each other.
</p></blockquote>


<span id="And-Finally-_2026"></span><h4 class="subsubheading">And Finally &hellip;</h4>

<ul>
<li> Pronounce TeX as if the &lsquo;<samp>X</samp>&rsquo; were a Greek &lsquo;chi&rsquo;, as the last
sound in the name &lsquo;Bach&rsquo;.  But pronounce Texinfo as in &lsquo;speck&rsquo;:
&ldquo;teckinfo&rdquo;.

</li><li> Write notes for yourself at the very end of a Texinfo file after the
<code>@bye</code>.  None of the formatters process text after the
<code>@bye</code>; it is as if the text were within <code>@ignore</code> &hellip;
<code>@end ignore</code>.
</li></ul>


<hr>
<div class="header">
<p>
Next: <a href="Sample-Texinfo-Files.html" accesskey="n" rel="next">Sample Texinfo Files</a>, Previous: <a href="_0040_002dCommand-Details.html" accesskey="p" rel="prev">@-Command Details</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
Back to Directory File Manager