home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
gnu
/
info
/
texi.info-10
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-02-24
|
44KB
|
886 lines
This is Info file texi.info, produced by Makeinfo-1.55 from the input
file texi.texi.
This file documents Texinfo, a documentation system that uses a
single source file to produce both on-line information and a printed
manual.
Copyright (C) 1988, 1990, 1991, 1992, 1993 Free Software Foundation,
This is the second edition of the Texinfo documentation,
and is consistent with version 2 of `texinfo.tex'.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Free Software Foundation.
File: texi.info, Node: Debugging with TeX, Next: Using texinfo-show-structure, Prev: Debugging with Info, Up: Catching Mistakes
Catching Errors with TeX Formatting
===================================
You can also catch mistakes when you format a file with TeX.
Usually, you do this after you have run `texinfo-format-buffer' (or,
better, `makeinfo-buffer') on the same file, because
`texinfo-format-buffer' sometimes displays error messages that make
more sense than TeX. (*Note Debugging with Info::, for more
information.)
For example, TeX was run on a Texinfo file, part of which is shown
here:
---------- 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 ----------
(The cross reference lacks a closing brace.) TeX produced the following
output, after which it stopped:
---------- Buffer: *texinfo-tex-shell* ----------
Runaway argument?
{sorting indices, for more information about sorting
indices.) @refill @ETC.
! Paragraph ended before @xref was complete.
<to be read again>
@par
l.27
?
---------- Buffer: *texinfo-tex-shell* ----------
In this case, TeX produced an accurate and understandable error
message:
Paragraph ended before @xref was complete.
`@par' is an internal TeX command of no relevance to Texinfo. `l.27'
means that TeX detected the problem on line 27 of the Texinfo file.
The `?' is the prompt TeX uses in this circumstance.
Unfortunately, TeX is not always so helpful, and sometimes you must
truly be a Sherlock Holmes to discover what went wrong.
In any case, if you run into a problem like this, you can do one of
three things.
1. You can tell TeX to continue running and ignore just this error by
typing RET at the `?' prompt.
2. You can tell TeX to continue running and to ignore all errors as
best it can by typing `r RET' at the `?' prompt.
This is often the best thing to do. However, beware: the one error
may produce a cascade of additional error messages as its
consequences are felt through the rest of the file. (To stop TeX
when it is producing such an avalanche of error messages, type
`C-d' (or `C-c C-d', if you are running a shell inside Emacs
Version 18.))
3. You can tell TeX to stop this run by typing `x RET' at the `?'
prompt.
Please note that if you are running TeX inside Emacs, you need to
switch to the shell buffer and line at which TeX offers the `?' prompt.
Sometimes TeX will format a file without producing error messages
even though there is a problem. This usually occurs if a command is
not ended but TeX is able to continue processing anyhow. For example,
if you fail to end an itemized list with the `@end itemize' command,
TeX will write a DVI file that you can print out. The only error
message that TeX will give you is the somewhat mysterious comment that
(@end occurred inside a group at level 1)
However, if you print the DVI file, you will find that the text of the
file that follows the itemized list is entirely indented as if it were
part of the last item in the itemized list. The error message is the
way TeX says that it expected to find an `@end' command somewhere in
the file; but that it could not determine where it was needed.
Another source of notoriously hard-to-find errors is a missing `@end
group' command. If you ever are stumped by incomprehensible errors,
look for a missing `@end group' command first.
If the Texinfo file lacks header lines, TeX may stop in the
beginning of its run and display output that looks like the following.
The `*' indicates that TeX is waiting for input.
This is TeX, Version 2.0 for Berkeley UNIX
(preloaded format=plain-cm 87.10.25)
(test.texinfo [1])
*
In this case, simply type `\end RET' after the asterisk. Then write
the header lines in the Texinfo file and run the TeX command again.
(Note the use of the backslash, `\'. TeX uses `\' instead of `@'; and
in this circumstance, you are working directly with TeX, not with
Texinfo.)
File: texi.info, Node: Using texinfo-show-structure, Next: Using occur, Prev: Debugging with TeX, Up: Catching Mistakes
Using `texinfo-show-structure'
==============================
It is not always easy to keep track of the nodes, chapters,
sections, and subsections of a Texinfo file. This is especially true
if you are revising or adding to a Texinfo file that someone else has
written.
In GNU Emacs, in Texinfo mode, the `texinfo-show-structure' command
lists all the lines that begin with the @-commands that specify the
structure: `@chapter', `@section', `@appendix', and so on. With an
argument (`C-u' as prefix argument, if interactive), the command also
shows the `@node' lines. The `texinfo-show-structure' command is bound
to `C-c C-s' in Texinfo mode, by default.
The lines are displayed in a buffer called the `*Occur*' buffer.
For example, when `texinfo-show-structure' was run on an earlier
version of this appendix, it produced the following:
Lines matching "^@\\(chapter \\|sect\\|sub\\|unnum\\|major\\|
heading \\|appendix\\)" in buffer texinfo.texi.
4:@appendix Formatting Mistakes
52:@appendixsec Catching Errors with Info Formatting
222:@appendixsec Catching Errors with @TeX{} Formatting
338:@appendixsec Using @code{texinfo-show-structure}
407:@appendixsubsec Using @code{occur}
444:@appendixsec Finding Badly Referenced Nodes
513:@appendixsubsec Running @code{Info-validate}
573:@appendixsubsec Splitting a File Manually
This says that lines 4, 52, and 222 of `texinfo.texi' begin with the
`@appendix', `@appendixsec', and `@appendixsec' commands respectively.
If you move your cursor into the `*Occur*' window, you can position the
cursor over one of the lines and use the `C-c C-c' command
(`occur-mode-goto-occurrence'), to jump to the corresponding spot in
the Texinfo file. *Note Using Occur: (emacs)Other Repeating Search,
for more information about `occur-mode-goto-occurrence'.
The first line in the `*Occur*' window describes the "regular
expression" specified by TEXINFO-HEADING-PATTERN. This regular
expression is the pattern that `texinfo-show-structure' looks for.
*Note Using Regular Expressions: (emacs)Regexps, for more information.
When you invoke the `texinfo-show-structure' command, Emacs will
display the structure of the whole buffer. If you want to see the
structure of just a part of the buffer, of one chapter, for example,
use the `C-x n' (`narrow-to-region') command to mark the region.
(*Note Narrowing: (emacs)Narrowing.) This is how the example used
above was generated. (To see the whole buffer again, use `C-x w'
(`widen').)
If you call `texinfo-show-structure' with a prefix argument by
typing `C-u C-c C-s', it will list lines beginning with `@node'