Re: [l2h] Some problems and patches for Windows
shige 03/10 2020 Carsten Leonhardt wrote: | since commit 4e17471e51507782d9a36f571aa2fb89b968e916 (the first patch | for windows support), the configure step gives me a warning (see | below). The build result is still the same, with or without the patch | (tested with diffoscope). I think the warning is misleading, as gs seems | to work just fine, so there's seems to be no need to set GS_LIB | manually. | | checking for ghostscript library and font paths... no | Warning: Could not determine GS_LIB path. | Ghostscript may not work due to missing startup files. | You need to set the value of GS_LIB manually in cfgcache.pm. | Hint:Search for the file 'gs_init.ps'. This directory and the 'fonts' | directory (usually same level) should be set in GS_LIB. | Separate the entries with the ":" character. The current | directory "." should be included, too. Thank for your reply. I also think it is not need to set GS_LIB now. GS_LIB is used only in pstoimg.pin to set the environment variable GS_LIB, which was needed by some version of old ghostscript. Recent versions of gs know correct library path, and the setting of GS_LIB manually may disturb the running of gs. So the detection routine of gs lib and font path in config.pl may not be need. Instead, it may be need to detect the validity of png16 device of gs, which is used in current latex2html. ++ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@iee.niit.ac.jp TEL(): +81-257-22-8161 ++ ___ latex2html mailing list latex2html@tug.org https://tug.org/mailman/listinfo/latex2html
Re: [l2h] Some problems and patches for Windows
Hi, since commit 4e17471e51507782d9a36f571aa2fb89b968e916 (the first patch for windows support), the configure step gives me a warning (see below). The build result is still the same, with or without the patch (tested with diffoscope). I think the warning is misleading, as gs seems to work just fine, so there's seems to be no need to set GS_LIB manually. checking for ghostscript library and font paths... no Warning: Could not determine GS_LIB path. Ghostscript may not work due to missing startup files. You need to set the value of GS_LIB manually in cfgcache.pm. Hint:Search for the file 'gs_init.ps'. This directory and the 'fonts' directory (usually same level) should be set in GS_LIB. Separate the entries with the ":" character. The current directory "." should be included, too. Regards, Carsten ___ latex2html mailing list latex2html@tug.org https://tug.org/mailman/listinfo/latex2html
Re: [l2h] Some problems and patches for Windows
shige 03/04 2020 I wrote at 2020-02-25: | I send some patches at 2019-12-29 and 2020-02-17, but I made some | mistakes. Also I found a new patch. I found one mistake again. I send the info, and new patches. 6) typo | 5) TeXLive may have Ghostscript in /texlive//tlpkg/tlgs, but | search target file "gs_init.ps" may not be in it. | | - from here - | --- config/config.pl.ORG2019-12-29 21:03:30.834019000 +0900 | +++ config/config.pl2019-12-29 21:09:43.43088 +0900 | @@ -1266,10 +1266,16 @@ | my @right_paths = (); | my $gs_lib = 0; | my $gs_fonts = 0; | + # 2017-04-11 shige: 2-24) | + my $gs_stand_ps; | Gslibpaths: foreach $path (@try_path) { |foreach('',"$dd$gs_version","${dd}gs$gs_version") { | my $testpath = $path . $_; | -if(!$gs_lib && -d $testpath && -s "$testpath${dd}gs_init.ps") { | +# if(!$gs_lib && -d $testpath && -s "$testpath${dd}gs_init.ps") { | + # 2017-04-11, 2019-12-03 shige: 2-24) | + if ($testpath =~ /tlgs/) { $gs_stand_ps = "landscape.ps"; } The name "landscape.ps" should be "landscap.ps". 7) absolute path for Win - From here - --- latex2html.pin.ORG 2019-12-29 21:03:41.052544000 +0900 +++ latex2html.pin 2020-03-04 19:34:22.290342000 +0900 @@ -2293,7 +2293,9 @@ if (-f "${PREFIX}internals.pl") { my $file = "${PREFIX}internals.pl"; - if ($file !~ /^\Q$dd\E/) { + # if ($file !~ /^\Q$dd\E/) { + # 2020-03-03 shige: 2-43) +if (!L2hos->is_absolute_path(file)) { $file = ".$dd$file"; } require ($file); - To here - 8) output of config/config.pl for pnmcrop and ppmtogif At doing configure script, outputs for pnmcrop and ppmtogif are: ... checking for pnmcrop... /usr/local/bin/pnmcrop /usr/local/bin/pnmcropyes ... checking for ppmtogif... /usr/local/bin/ppmtogif yes checking if ppmtogif can make interlaced GIFs... yes ... but these lines are strange. The following patch may fix it. - From here - --- config/config.pl.ORG2019-12-29 21:03:30.834019000 +0900 +++ config/config.pl2020-03-04 19:32:25.874598000 +0900 @@ -1381,9 +1381,11 @@ $vers = $1; ($major_vers) = $vers =~ /^(\d+)/; } +# 2020-03-03 shige: 2-17) +('if pnmcrop can crop from one direction'); if ($major_vers =~ /^199/) { # try left crop - ('if pnmcrop can crop from one direction'); + # ('if pnmcrop can crop from one direction'); my $timg = "config${dd}timg.pnm"; ($stat,$msg,$err) = _out_err("$pnmcrop -l $timg"); } elsif ($major_vers > 8) { @@ -1400,7 +1402,8 @@ $newcfg{'PNMCROPOPT'} = ' -sides '; } } else { $newcfg{'PNMCROPOPT'} = ' -sides '; } - print "\n$pnmcrop"; + # 2020-03-03 shige: 2-17) + # print "\n$pnmcrop"; $msg = 'there is nothing to crop'; $stat = ''; } else { print "\nThis $vers for $pnmcrop is not recognisable."; @@ -1517,8 +1520,10 @@ $msg = $msg || $err; my $vers = ''; if ($msg =~ /(^|\s*)Version.*\s([\d\.]+)\s*([\n\r]|$)/is) { $vers = $2; } +# 2020-03-03 shige: 2-17) +('if ppmtogif can make transparent GIFs'); if ($vers =~ /^199/) { - ('if ppmtogif can make transparent GIFs'); + # ('if ppmtogif can make transparent GIFs'); # '-h' is an invalid option. Nevertheless it forces ppmtogif to output a # usage information to stderr. We'll have a closer look at that. ($stat,$msg,$err) = _out_err("$ppmtogif -h"); - To here - ++ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@iee.niit.ac.jp TEL(): +81-257-22-8161 ++ ___ latex2html mailing list latex2html@tug.org https://tug.org/mailman/listinfo/latex2html
Re: [l2h] Some problems and patches for Windows
shige 03/03 2020 I wrote at 2020-02-25: | I send some patches at 2019-12-29 and 2020-02-17, but I made some | mistakes. Also I found a new patch. I found one mistake again. 5) typo | 5) TeXLive may have Ghostscript in /texlive//tlpkg/tlgs, but | search target file "gs_init.ps" may not be in it. | | - from here - | --- config/config.pl.ORG2019-12-29 21:03:30.834019000 +0900 | +++ config/config.pl2019-12-29 21:09:43.43088 +0900 | @@ -1266,10 +1266,16 @@ | my @right_paths = (); | my $gs_lib = 0; | my $gs_fonts = 0; | + # 2017-04-11 shige: 2-24) | + my $gs_stand_ps; | Gslibpaths: foreach $path (@try_path) { |foreach('',"$dd$gs_version","${dd}gs$gs_version") { | my $testpath = $path . $_; | -if(!$gs_lib && -d $testpath && -s "$testpath${dd}gs_init.ps") { | +# if(!$gs_lib && -d $testpath && -s "$testpath${dd}gs_init.ps") { | + # 2017-04-11, 2019-12-03 shige: 2-24) | + if ($testpath =~ /tlgs/) { $gs_stand_ps = "landscape.ps"; } | + else { $gs_stand_ps = "gs_init_ps"; } The name "gs_init_ps" should be "gs_init.ps". ++ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@iee.niit.ac.jp TEL(): +81-257-22-8161 ++ ___ latex2html mailing list latex2html@tug.org https://tug.org/mailman/listinfo/latex2html
Re: [l2h] Some problems and patches for Windows
shige 02/25 2020 I send some patches at 2019-12-29 and 2020-02-17, but I made some mistakes. Also I found a new patch. 1) order of lines I wrote at 2019-12-29: | 1) On windows, 2 or more commands cannot connect ';' in | L2hos->syswait(). | | - from here - | --- latex2html.pin.ORG 2019-12-29 21:03:41.052544000 +0900 | +++ latex2html.pin 2019-12-29 21:28:53.738308000 +0900 | @@ -3870,7 +3870,9 @@ = | print "\nTransforming PDF images to postscript using gs/ps2write ...\n"; | - $dvips_call .= "-sDEVICE=ps2write -sOutputFile=$TMPDIR$dd$IMAGE_PREFIX%.3d.ps .${dd}${PREFIX}images-crop.pdf\n"; | + # $dvips_call .= "-sDEVICE=ps2write -sOutputFile=$TMPDIR$dd$IMAGE_PREFIX%.3d.ps .${dd}${PREFIX}images-crop.pdf\n"; | + # 2019-12-27 shige: 2-44) | + $dvips_call = "$PDFCROP --hires " . ($DEBUG ? '--debug ' : '') | + . ".${dd}${PREFIX}images.pdf"; | + $dvips_call2 = $dvips_call . "-sDEVICE=ps2write -sOutputFile=$TMPDIR$dd$IMAGE_PREFIX%.3d.ps .${dd}${PREFIX}images-crop.pdf"; The order of last 2 lines is incorrect. The reverse order is correct (the correct patch is already applied to github version). 2) ';' at the end I wrote at 2019-12-29: | 2) In Windows, there are no tee command and alternatives. | | - from here - | --- latex2html.pin.ORG 2019-12-29 21:03:41.052544000 +0900 | +++ latex2html.pin 2019-12-29 21:33:45.524136000 +0900 | @@ -4264,10 +4264,16 @@ = | if ($name =~ /figure|table/) { | - L2hos->syswait("$PNGTOPNM $p.png|tee $p.ppm|$PPMTO --quiet $transparent >${PREFIX}img$new_num.$IMAGE_TYPE;"); | + #L2hos->syswait("$PNGTOPNM $p.png|tee $p.ppm|$PPMTO --quiet $transparent >${PREFIX}img$new_num.$IMAGE_TYPE;"); | + # 2019-12-12: 2-44) | + L2hos->syswait("$PNGTOPNM $p.png >$p.ppm"); | + L2hos->syswait("$PPMTO --quiet $transparent $p.ppm >${PREFIX}img$new_num.$IMAGE_TYPE;"); | } else { | # L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides|tee $p.ppm|$PNMCUT -top $millimeter |$PNMCROP -left -right|tee $p-.ppm|$PPMTO --quiet $transparent >img$new_num.$IMAGE_TYPE;"); | - L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides|tee $p.ppm|$PPMTO --quiet $transparent >${PREFIX}img$new_num.$IMAGE_TYPE;"); | + # L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides|tee $p.ppm|$PPMTO --quiet $transparent >${PREFIX}img$new_num.$IMAGE_TYPE;"); | + # 2019-12-12: 2-44) | + L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides >$p.ppm"); | + L2hos->syswait("$PPMTO --quiet $transparent $p.ppm >${PREFIX}img$new_num.$IMAGE_TYPE;"); Two ';' remain at ends of strings in L2hos->syswait() for $PPMTO, but they cause error on Windows. They must be removed. 3) #if I wrote at 2020-02-17: | | I found other problems of config/config.pl of current latex2html | | (github version) for Windows. | | I also found another problem for treatment of absolute path for | Windows. | | - from here - | --- latex2html.pin.ORG 2019-12-29 21:03:41.052544000 +0900 | +++ latex2html.pin 2020-02-17 10:16:42.075647000 +0900 | @@ -9440,7 +9440,9 @@ | $print_dir = $this_dir.$dd unless ($print_dir); | if (-f "$this_dir$dd${PREFIX}images.pl") { | print STDOUT "Reusing directory $print_dir:\n"; | - if ($this_dir !~ /^\Q$dd\E/) { | + #if ($this_dir !~ /^\Q$dd\E/) { | + # 2020-02-17 shige '#if' is not treated as start of comment line. It may be as PREPROCESSER directive. It must be '# if'. 4) '#FF' 'string' is not equal "string" on Windows command line. So, [-transparent #FF] and [-transparent "#FF"] are acceptable, but [-transparent '#FF'] is not. - From here - --- latex2html.pin.ORG 2019-12-29 21:03:41.052544000 +0900 +++ latex2html.pin 2020-02-25 09:47:28.510115000 +0900 @@ -4257,7 +4257,9 @@ if ($TRANSPARENT_FIGURES) { my $TRANSPARENT_COLOR= $ENV{'TRANSPARENT_COLOR'} || '#FF'; - $transparent= "-transparent '$TRANSPARENT_COLOR'"; + # $transparent= "-transparent '$TRANSPARENT_COLOR'"; + # 2020-20-22 shige: 2-44) + $transparent= "-transparent \"$TRANSPARENT_COLOR\""; } else { $transparent =''; } - To here - ++ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@iee.niit.ac.jp TEL(): +81-257-22-8161 ++ ___ latex2html mailing list latex2html@tug.org https://tug.org/mailman/listinfo/latex2html
Re: [l2h] Some problems and patches for Windows
shige 02/17 2020 I wrote: | I found other problems of config/config.pl of current latex2html | (github version) for Windows. I also found another problem for treatment of absolute path for Windows. - from here - --- latex2html.pin.ORG 2019-12-29 21:03:41.052544000 +0900 +++ latex2html.pin 2020-02-17 10:16:42.075647000 +0900 @@ -9440,7 +9440,9 @@ $print_dir = $this_dir.$dd unless ($print_dir); if (-f "$this_dir$dd${PREFIX}images.pl") { print STDOUT "Reusing directory $print_dir:\n"; - if ($this_dir !~ /^\Q$dd\E/) { + #if ($this_dir !~ /^\Q$dd\E/) { + # 2020-02-17 shige + if (!L2hos->is_absolute_path($this_dir)) { $this_dir = ".$dd$this_dir"; } local($key); - to here - ++ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@iee.niit.ac.jp TEL(): +81-257-22-8161 ++ ___ latex2html mailing list latex2html@tug.org https://tug.org/mailman/listinfo/latex2html
Re: [l2h] Some problems and patches for Windows
shige 02/13 2020 I found other problems of config/config.pl of current latex2html (github version) for Windows. On Windows, path strings may include ':'. And since kpsewhich returns path strings with delimiter '/', not '\' which is used on Windows, we need to translate '/' to '\' in the path string before the estimation of it. - from here - --- config/config.pl.ORG2019-12-29 21:03:30.834019000 +0900 +++ config/config.pl2020-02-13 10:37:26.106649000 +0900 @@ -606,7 +606,9 @@ # -- my $extrapath = $opt{EXTRAPATH} || $prefs{EXTRAPATH} || ''; -@paths = grep(-d, uniquify(@paths, split(/[:;]/,$extrapath))); +#@paths = grep(-d, uniquify(@paths, split(/[:;]/,$extrapath))); +# 2020-02-10 shige +@paths = grep(-d, uniquify(@paths, split(/\Q$pathd/,$extrapath))); #logit("DEBUG: EXTRAPATH=$extrapath\n"); #logit("DEBUG: PATH=" . join(':',@paths) . "\n"); @@ -906,10 +908,16 @@ elsif(!$texpath && $kpath) { my @texpaths = (); chomp($kpath); - foreach(split(/[:;]/,$kpath)) { + #foreach(split(/[:;]/,$kpath)) { + # 2020-02-10 shige + foreach(split(/\Q$pathd/,$kpath)) { s/^!+//; # strip leading !'s s:[/\\]+$::; # strip trailing path delims -if(!/^[\.\w]/ && -d) { +# 2020-02-10 shige: path2os() is better ? +s:/:${dd}:g if L2hos->plat eq 'win32'; +#if(!/^[\.\w]/ && -d) { +# shige: 2020-02-10 +if(L2hos->is_absolute_path($_) && -d) { push(@texpaths,$_); } } - to here - ++ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@iee.niit.ac.jp TEL(): +81-257-22-8161 ++ ___ latex2html mailing list latex2html@tug.org https://tug.org/mailman/listinfo/latex2html