If TeX2page reports an error on your document, you may
be able to deduce the cause from the diagnostic
information that TeX2page displays on standard
output. If you failed to look at this information as
it was being displayed, you can always retrieve it from
the log file
jobname.hlog. This is
exactly analogous to TeX generating diagnostic
information on standard output and keeping a copy
thereof in the file
The error message typically displays an error
context, viz., a few consecutive lines from the source
document that contain the likely cause of the error.
The number of context lines so displayed is governed by
the count register
\errorcontextlines, which has a default
value of 5. Thus, setting
\errorcontextlines=7 will display
seven lines. Note that error contexts are often
only approximate — be prepared to look a little above
or below the reported context.
Like TeX, TeX2page also gives you the option of immediately editing the file containing the error, at the location of the error. It does so with the following prompt:
Type e to edit file at point of error; x to quit. ?
When you type
e at this prompt, a text editor
is fired up. What the editor is depends on the
TEXEDIT (which is also used
by TeX) and
TEXEDIT is set, its string value (e.g.,
vim +%d %s”)
is chosen as
the entire editor call, with
%s replaced by the offending
file’s name, and
%d replaced by the number of the line
containing the error.
TEXEDIT is not set, or if
it is mis-set, i.e., without
%d, then the
editor specified in the environment variable
is chosen. If
EDITOR is also not set, then
the editor name is assumed to be
vi, the file and line number are
tacked on as arguments to the editor,
+ preceding the
line number. This argument style works for all
Sometimes, the diagnostic information in an error
message may not be enough to track
down the error.
TeX provides various commands for generating more diagnostics —
TeX2page recognizes the same commands to provide its own diagnostics.
setting the count registers
\tracingmacros to a positive integer causes
more log information.
You may turn on
these traces at any point in your document. You may
subsequently turn them off by setting
All of these commands display their information on both standard output and in the log file. Judicious use of these commands should help pinpoint any error.
* TeX itself uses just
It does not fall back to
TEXEDIT is not set. But most Unix programs that
reach for an editor do tend to use
EDITOR, and failing that,
vi, so TeX2page does the same.