htmltotex: Command not found
There are two possible sources of this error.
/opt/local/bin
, say,
with the name, say, perl5.003
, change the first line
of htmltotex and imgtops as
Error: <some command line error> Usage: htmltotex [-a] [-b base_url] [-c] [-d|-g] [-f] [-F] [-h] [-i|-I] [-ip macro_file] [-L lib_dir] [-lf left_footer] [-lh left_header] [-m image_dir] [-o output_file] [-p num] [-P] [-pt num] [-r num] [-rf right_footer] [-rh right_header] [-t temp_dir] [-u] [-v] [-V] [-w num] input_file For detailed help run "htmltotex -h"
This means that you have made a mistake in stating the command line
arguments. See the help message or a more detailed listing of the
options and their meanings in the tutorial
htmltotex.html.
You may run htmltotex
as
Error: Unable to load library
WARNING: Unable to read resource file ... using defaults
But you may have problems later ...
WARNING: Unable to read special character maps ... ignoring
But you may have problems later ...
These errors are caused by the fact that htmltotex
cannot
find the library files, namely,
fonts.mac, misc.mac, spl-chars
and htmltotex.rc
in any of the following directories:
/usr/local/lib/htmltotex
/usr/local/htmltotex
~/.htmltotex
.
htmltotex
to add this
directory to its default search path. Use the
command line option -L for this purpose.
If you continue to get the same error or warning messages, even when you are
sure that the library files can be found in the default or extended search
path, it is most likely caused by some
problem with the unix command dirname
. In that case, please
contact me and tell me what
platform you are using.
A reasonable estimate of the running time of htmltotex
for a 100 kilobyte input is about 20 seconds on a 100 MHz machine.
If htmltotex
takes sufficiently longer than this, you may
assume that there is something fishy with the execution of
htmltotex
for this file. This may be caused by a bug in the
code of htmltotex
. If you face such a situation,
contact me and, if
possible, tell me the URL of the page where htmltotex
failed.
The most probable reason for this is that there is an error in the
html file that you have converted. TeX tells you the paragraph location
and the line (or a segment of it) where the error occurred. This gives you
the suspected error location in the html file. Try to correct the error,
if any, and repeat the process. Some errors in the html files are
overlooked and/or corrected by htmltotex
, some others give rise to mild
warning messages by the TeX compiler, whereas some others are really fatal.
These fatal errors are often caused by
htmltotex
and/or result in portions of text vanishing
from the output. You may look at
a note on <. Here's a tip how you may detect the presence of
unbalanced <'s. htmltotex
is designed so that there
are NO blank lines anywhere in the output. It's only the presence of
unbalanced <'s that might introduce blank lines to the output. Try
to find out where it occurred the first time. It's highly probable that
there is something wrong only a few lines before that.
htmltotex
, on the other hand,
simply susbstitutes the tags it finds in the input file, and hence is
completely ignorant about what you have possibly missed to write. For example,
absence of the tag <TR> to mark the first row of a
table creates severe trouble to htmltotex
.
The assumption is that you are converting a file that is error-free with
respect to
html2 specifications.
If the situation is otherwise, nothing is guaranteed by
htmltotex
. htmltotex
does not try to parse
your input. It, on the other hand, does a blind pattern substitution.
Let us be optimistic: serious errors do not occur quite often
in reality. And, in addition, it is assuring to you that
htmltotex
does have a limited error-correcting
capability !!
If you do not want to bother about TeX errors and their possible solutions,
call htmltotex
with the option -r
and supply a
value of 1,2, or 3 to it. -r 1
causes your output TeX file
to be compiled silently even in the presence of errors,
whereas with -r 2
and -r 3
,
TeX will show error messages but won't stop for you to take a
corrective measure when an error is found. Note, however, that TeX aborts
the compilation if the number of errors exceeds 99, and a single html error
might cause 100 TeX errors !!!
This is another source of error when you try to compile a converted TeX file. This is treated separately, because this is not caused by html errors. Let's take an instance of such an error
cmsl7.mf
, cmtt7.mf
nor the corresponding
TeX Font Metric (TFM) files.
If the size of normal text is n points (The default value is 10 and
can be changed by the -pt
option), htmltotex
tells TeX to load computer modern fonts of sizes n, n-3 and n-5 points.
All TeX distributions do not provide fonts at all these sizes. This
gives rise to errors of the above kind.
In our example, n = 10, and the TeX distribution does not
provide the slanted and typewriter fonts at size n-3.
When such a situation occurs, first try other reasonable values of n,
say 11 and 12. Use the option -pt
to change the default point size. If you continue to get similar errors for
all these values of n, call htmltotex
with the
option -F
. With this option,
htmltotex
tells TeX to load fonts only at size 10 points.
All other fonts are made available through suitable scalings of the
10 point fonts. Since almost all distributions of TeX provide all the
required fonts at 10pt, this strategy should work in most of the cases.
If you are deprived of some 10pt fonts too, you are in trouble. If you
are a good TeXnician, try hacking the font macro files
fonts10.mac
,
fonts11.mac
and
fonts12.mac
. Otherwise leave the
burden on me. Don't forget to tell me which fonts your system has
and which not. Or try to get a better version of TeX.
Even when you have fonts of smaller sizes, you may choose to work with
the -F
option. This practice is, however, not recommended,
since it is always advisable to use, for example, a font designed at 7pt
rather than a font designed at 10pt and scaled at 7pt. The resolution
is usually poorer in the second case. On the other hand, it is not
harmful to use a font at a size larger than its design size. That's why,
htmltotex
always scales up the default fonts to generate
larger text.
Before we conclude, let us see what are the admissible values of n as
mentioned above. If you convert with -F
, the only admissible
values are 10, 11 and 12. Any other value sets n to the default value
of 10 (after warning you that htmltotex
is not happy with
the value you supplied). Without this option, all values are admissible.
That is, htmltotex
never complains that you have supplied
a bad value. TeX, however, complains seriously if it fails to load
font metric files at point sizes n, n-3 and n-5. Supply a value of n
that makes TeX happy.
WARNING: Image ... cannot be loaded
This is, in almost all cases, caused by a malformed HREF argument
to the SRC parameter in the IMG tag. Check the
reference. htmltotex
is designed to handle both absolute
and relative references to image files that reside only in the local
machine. No attempt is made to fetch an image living in a remote
machine. URLs in the local machine, on the other hand,
can be specified either by an HTTP reference or by a FILE reference.
Also check if the
BASE
tag inside the header of the html file is creating
problem in case of relative references.
If so, you can always let htmltotex
ignore
this URL by specifying a suitable
base URL as an argument to the -b
tag.
Two possibilities might cause this problem. You do not have
epsf.sty
from
ftp://ftp.dante.de/tex-archive/macros/latex209/contrib/revtex/epsf.sty
or
ftp://ftp.tex.ac.uk/tex-archive/macros/latex209/contrib/revtex/epsf.sty.
You may completely avoid using the above programs at the cost of not having
any image in the output -- just call htmltotex
with the
-i
or -I
option.
htmltotex
.
mailto:abhij@csa.iisc.ernet.in
This page hosted by Get your own Free Home Page