Discussion:
[l2h] Error when using latex2html with option -html_version 3.2, latin2, unicode in Windows
Duc A. HOANG
2017-10-20 13:14:08 UTC
Permalink
Dear all,

Recently, I've got a problem when using LaTeX2HTML 2017.2 in Windows.
That is, when I use latex2html with the option -html_version
3.2,latin2,unicode, the following error occurs:

Extension: loading C:\latex2html\versions\latin1.pl
HTML version: loading C:\latex2html\versions\html3_2.pl

*** processing declarations ***

Resetting image-cacheCannot read .\latin2.tex

Does any one know how to fix this problem?


Best regards.
Duc A. HOANG.
Shigeharu TAKENO
2017-10-23 03:16:51 UTC
Permalink
shige 10/23 2017
----------------

Duc A. HOANG wrote:
| Recently, I've got a problem when using LaTeX2HTML 2017.2 in Windows.
| That is, when I use latex2html with the option -html_version
| 3.2,latin2,unicode, the following error occurs:
|
| Extension: loading C:\latex2html\versions\latin1.pl
| HTML version: loading C:\latex2html\versions\html3_2.pl
|
| *** processing declarations ***
|
| Resetting image-cacheCannot read .\latin2.tex
|
| Does any one know how to fix this problem?

If you specify options of -html_version with space as

-html_version 3.2, latin2

then "latin2" is considered target latex file name (latin2.tex),
not the option of -html_version, and latex2html will say

Resetting image-cacheCannot read ./latin2.tex

since the file "latin2.tex" does not exist.

Options of -html_version must be specified comma separated list
without space.

Please try:

latex2html -html_version 3.2,latin2 ...

+========================================================+
Shigeharu TAKENO NIigata Institute of Technology
kashiwazaki,Niigata 945-1195 JAPAN
***@iee.niit.ac.jp TEL(&FAX): +81-257-22-8161
+========================================================+
Duc A. HOANG
2017-10-23 04:02:54 UTC
Permalink
Dear Shigeharu TAKENO,

Even when I use the command without space, the problem remains the same.
Here is the output

C:\Users\hoanganhduc\phdthesis>latex2html -dir phdthesisHTML
-html_version 3.2,latin2,unicode -init_file phdthesis.l2h -tmp
C:\Windows\TEMP phdthesis.tex
Note: Loading C:\Users\hoanganhduc\phdthesis\.latex2html-init
Note: Initialising with file: .\phdthesis.l2h
This is LaTeX2HTML Version 2017.2 (Released Jan 23, 2017)
by Nikos Drakos, Computer Based Learning Unit, University of Leeds.

Revised and extended by:
Marcus Hennecke, Ross Moore, Herb Swan and others
...producing markup for HTML version 3.2



Extension: loading C:\latex2html\versions\latin1.pl
HTML version: loading C:\latex2html\versions\html3_2.pl

*** processing declarations ***

Resetting image-cacheCannot read .\latin2.tex


Best regards.
Duc A. HOANG
Post by Shigeharu TAKENO
shige 10/23 2017
----------------
| Recently, I've got a problem when using LaTeX2HTML 2017.2 in Windows.
| That is, when I use latex2html with the option -html_version
|
| Extension: loading C:\latex2html\versions\latin1.pl
| HTML version: loading C:\latex2html\versions\html3_2.pl
|
| *** processing declarations ***
|
| Resetting image-cacheCannot read .\latin2.tex
|
| Does any one know how to fix this problem?
If you specify options of -html_version with space as
-html_version 3.2, latin2
then "latin2" is considered target latex file name (latin2.tex),
not the option of -html_version, and latex2html will say
Resetting image-cacheCannot read ./latin2.tex
since the file "latin2.tex" does not exist.
Options of -html_version must be specified comma separated list
without space.
latex2html -html_version 3.2,latin2 ...
+========================================================+
Shigeharu TAKENO NIigata Institute of Technology
kashiwazaki,Niigata 945-1195 JAPAN
+========================================================+
Shigeharu TAKENO
2017-10-23 10:54:55 UTC
Permalink
shige 10/23 2017
----------------

Duc A. HOANG wrote:
| Even when I use the command without space, the problem remains the same.
| Here is the output

Ok, I understand your problem.

This is a bug of latex2html only for Windows version.
On MS-Windows, latex2html program is a batch file latex2html.bat
in fact. Options to the batch file are devided, concatenated, and
passed to Perl executable program at first.

But, for batch file, the option separator is not only space, but
also comma, semicolon, and equal ('='). So, the first process of
the batch file for options translates

-html_version 3.2,latin2,unicode

to

-html_version 3.2 latin2 unicode

incorrectly.

Well, to workaround the problem, I propose that

1) modify the latex2html.bat at the line about 15657:

# Require the option specific files
@HTML_VERSION = split(/,/, $HTML_OPTIONS);
foreach $ext ( @HTML_VERSION ) {

to
# Require the option specific files
@HTML_VERSION = split(/:/, $HTML_OPTIONS);
foreach $ext ( @HTML_VERSION ) {

2) specify the option for html_version with separator colon
instead of comma:

-html_version 3.2:latin2:unicode

I think this is not a good solution, but may fix your problem
temporary.

+========================================================+
Shigeharu TAKENO NIigata Institute of Technology
kashiwazaki,Niigata 945-1195 JAPAN
***@iee.niit.ac.jp TEL(&FAX): +81-257-22-8161
+========================================================+
Duc A. HOANG
2017-10-23 13:26:58 UTC
Permalink
Dear Shigeharu TAKENO,

I confirm that this workaround solved my problem. Thank you very much!

Best regards.
Duc A. HOANG
Post by Shigeharu TAKENO
shige 10/23 2017
----------------
| Even when I use the command without space, the problem remains the same.
| Here is the output
Ok, I understand your problem.
This is a bug of latex2html only for Windows version.
On MS-Windows, latex2html program is a batch file latex2html.bat
in fact. Options to the batch file are devided, concatenated, and
passed to Perl executable program at first.
But, for batch file, the option separator is not only space, but
also comma, semicolon, and equal ('='). So, the first process of
the batch file for options translates
-html_version 3.2,latin2,unicode
to
-html_version 3.2 latin2 unicode
incorrectly.
Well, to workaround the problem, I propose that
# Require the option specific files
@HTML_VERSION = split(/,/, $HTML_OPTIONS);
to
# Require the option specific files
@HTML_VERSION = split(/:/, $HTML_OPTIONS);
2) specify the option for html_version with separator colon
-html_version 3.2:latin2:unicode
I think this is not a good solution, but may fix your problem
temporary.
+========================================================+
Shigeharu TAKENO NIigata Institute of Technology
kashiwazaki,Niigata 945-1195 JAPAN
+========================================================+
Shigeharu TAKENO
2017-10-23 23:47:38 UTC
Permalink
shige 10/24 2017
----------------

I wrote:
| Well, to workaround the problem, I propose that
|
| 1) modify the latex2html.bat at the line about 15657:
|
| # Require the option specific files
| @HTML_VERSION = split(/,/, $HTML_OPTIONS);
| foreach $ext ( @HTML_VERSION ) {
|
| to
| # Require the option specific files
| @HTML_VERSION = split(/:/, $HTML_OPTIONS);
| foreach $ext ( @HTML_VERSION ) {
|
| 2) specify the option for html_version with separator colon
| instead of comma:
|
| -html_version 3.2:latin2:unicode
|
| I think this is not a good solution, but may fix your problem
| temporary.

I found better solution.

Please modify your latex2html.bat at the line about 6:

:one
if "%1"=="" goto two
set arg=%arg% %1
shift
goto one
:two

to

:one
rem if "%1"=="" goto two
rem set arg=%arg% %1
rem shift
rem goto one
set arg=%*
:two

Lines started "rem" can be deleted.

It accepts options with comma as

-html_version 3.2,latin2,unicode ...

+========================================================+
Shigeharu TAKENO NIigata Institute of Technology
kashiwazaki,Niigata 945-1195 JAPAN
***@iee.niit.ac.jp TEL(&FAX): +81-257-22-8161
+========================================================+
Duc A. HOANG
2017-10-24 00:43:33 UTC
Permalink
Dear Shigeharu TAKENO,

I confirm that this modification works too.
Thanks!

Best regards.
Duc A. HOANG
Post by Shigeharu TAKENO
shige 10/24 2017
----------------
| Well, to workaround the problem, I propose that
|
|
| # Require the option specific files
|
| to
| # Require the option specific files
|
| 2) specify the option for html_version with separator colon
|
| -html_version 3.2:latin2:unicode
|
| I think this is not a good solution, but may fix your problem
| temporary.
I found better solution.
:one
if "%1"=="" goto two
set arg=%arg% %1
shift
goto one
:two
to
:one
rem if "%1"=="" goto two
rem set arg=%arg% %1
rem shift
rem goto one
set arg=%*
:two
Lines started "rem" can be deleted.
It accepts options with comma as
-html_version 3.2,latin2,unicode ...
+========================================================+
Shigeharu TAKENO NIigata Institute of Technology
kashiwazaki,Niigata 945-1195 JAPAN
+========================================================+
Loading...