[l2h] Some mathematical images in my case not fully processed by LaTeX2HTML 1.71 using both an old and a new .tex file

Pat Somerville l_pat_s at hotmail.com
Wed Aug 21 07:23:25 CEST 2013


After a few weeks of time, gratefully I found what I will call a "workaround" solution for this problem of the LaTeX code \frac{1}{2} being converted to the word "Image" instead of the fraction 1/2 with a horizontal fraction line in a LaTeX2HTML output file.  That solution was the result of a good clue kindly provided by Bob Tennent. On http://www.tug.org/pipermail/tex-live/2011-November/030599.html on the Internet he wrote, "...in some Linux distributions the latex2html package will *depend* on a full installation of something hopelessly out-of-date like texlive-2007 or tetex which complicates the installation" (of I think LaTeX2HTML). And at http://www.tug.org/pipermail/tex-live/2011-November/030604.html, continuing in the same "chain" of likely electronic-mail letters, Bob Tennent further wrote, "Installation of latex2html-2008 from the tarball at CTAN" (the Comprehensive TeX Archive Network on the Internet) "does avoid the dependency issues and it's likely to need updating." These writings of Bob Tennent gratefully gave me the clue that LaTeX2HTML 1.71, which worked probably well for me with portions of TeX Live 2011, might be non-commensurate in some way with portions of TeX Live 2012. So in attempting the solution of Bob Tennent I obtained the file latex2html-2012.tgz from a CTAN Web page. Within openSUSE-12.3's Yet another Software Tool 2's (YaST2's) Software Management I deleted the installations of the openSUSE-12.3 software packages entitled "latex2html," "latex2html-doc," and "latex-pngicons." I unpacked the downloaded file latex2html-2012.tgz using the command "tar xvzf latex2html-2012.tgz" in a new folder and followed the instructions in a file entitled "INSTALL," which came within that .tgz file to install what turned out to be LaTeX2HTML 2012 (1.2) in my installation of portions of TeX Live 2012 in an openSUSE-12.3, Linux operating system. The essential commands in doing so were "./configure --prefix=/usr", "make," and "make install". The result was the installation of some executable LaTeX2HTML files in the directory /usr/bin, some shared library files in the directory /usr/shared/lib/latex2html, and some unshared library files in the directory /usr/lib/latex2html, with each of those three directories beginning with the input "prefix" of "/url". After deleting old copies of everything associated with my test file Throwaway29.tex, except the file Throwaway29.tex itself, gratefully the result of executing "latex Throwaway29.tex" twice and "latex2html -debug -nonavigation -no_math -html_version 3.2,math -split 0 Throwaway29.tex" once was that the equivalent of the expression y=(1/2) x^2 without the parentheses and with a horizontal fraction line was properly displayed in the output file ..../Throwaway29/Throwaway29.html when viewed in the Web browser Konqueror (Some problems in displaying other mathematics after similarly processing a different .tex file were rectified by making the minor changes discussed in Appendix II.). Afterwards the new folder into which the file latex2html-2012.tgz, which had been downloaded from a CTAN Web page, had been unpacked could be deleted from my computer's hard-disk drive. 



The above success shows that LaTeX2HTML 2012 (1.2) can be made to work with portions of TeX Live 2012 in an openSUSE-12.3, Linux operating system (As of August 14, 2013, TeX Live 2013 was not yet available for installation from the standard openSUSE-12.3 repositories for stable openSUSE 12.3. But from Harvey's posting at http://bbs.archlinux.org/viewtopic.php?pid=1299370 on the Internet, there is a possible clue that TeX Live 2013 may have worked with LaTeX2HTML 2008-2, dated July 10, 2013, up to, but not including, the TeX Live 2013 update named texlive-core2013.30962-1. Based on Harvey's joke near the end of his posting there and because that Web page has "linux" in its Uniform Resource Locator [URL], I suppose that Harvey may have been using some distribution of a Linux operating system in the results he reported. He also wrote that he reported his problem with LaTeX2HTML 2008-2 and TeX Live 2013, a problem different from my problem with LaTeX-coded fractions like \frac{1}{2}, as a "bug." I am not certain whether he reported that software "bug" to the developers of TeX Live or to the developers of the distribution of the Linux operating system that he was using at the time he found what he speculated might be a "bug."). Without delving deeply into the computer codes involved, I have two general hypotheses to explain this success: 1) Similar to what Bob Tennent reported for probably an earlier version of LaTeX2HTML and some distribution or distributions of a Linux operating system that is or are unknown to me, perhaps in my case as well there was in some way some kind of a mismatch between LaTeX2HTML 2008 (1.71) and portions of TeX Live 2012 in my installation of the openSUSE-12.3, Linux operating system. 2) In openSUSE 12.3, compared to openSUSE 12.2, I think some changes were made in grouping some software packages together. So perhaps there was a problem on the openSUSE-12.3 side of things that prevented LaTeX2HTML 1.71 from working well with portions of TeX Live 2012.



I see short-, intermediate-, and long-term solutions to the general problem of getting LaTeX2HTML to work well with portions of TeX Live in a Linux operating system. The short-term solution is the one I explained in the paragraph two paragraphs above this one that gratefully worked for me in an openSUSE-12.3, Linux operating system and that one could hope might also work in other distributions of the Linux operating system. The intermediate-term solution is to have openSUSE-12.3 developers fix the problem for users of the version of LaTeX2HTML that is supplied to openSUSE-12.3 users from openSUSE-12.3's software repositories (In fact, I have already submitted the problem I mention here in a "bug" report to developers of openSUSE 12.3. I updated that "bug" report with the recent success and some of the other content I report here.).---If the above hypothesis 1 is correct without any complications from hypothesis 2, the intermediate-term solution might be as simple as openSUSE-12.3 developers changing the version of LaTeX2HTML they supply from their online repositories from the year-2008 to the year-2012 version of it that is available from the CTAN. But the long-term and more general solution for all distributions of the Linux and Windows operating systems which may make use of TeX Live could be to incorporate a recent version of LaTeX2HTML in a recent version of TeX Live and, from testing LaTeX2HTML and LaTeX in TeX Live with .tex files containing some mathematical expressions before distributing Tex Live, to in that way ensure that LaTeX2HTML within TeX Live will work well with TeX Live. Via electronic mail I recently recommended such incorporation to people who use and/or are responsible for TeX Live. 



Appendix I: Licensing of LaTeX2HTML 2012 (1.2)



For LaTeX2HTML 2012 (1.2) I found license information in the file /usr/share/lib/latex2html/docs/licence.tex in my installation of LaTeX2HTML obtained from the CTAN: 



"Use and copying of this software and the preparation of derivative

works based on this software are permitted, so long as the following

conditions are met:

\begin{itemize}

\item 

The copyright notice and this entire notice are included intact

and prominently carried on all copies and supporting documentation.

\item 

No fees or compensation are charged for use, copies, or

access to this software. You may charge a nominal

distribution fee for the physical act of transferring a

copy, but you may not charge for the program itself. 

\item 

If you modify this software, you must cause the modified

file(s) to carry prominent notices (a \texttt{ChangeLog})

describing the changes, who made the changes, and the date

of those changes.

\item 

Any work distributed or published that in whole or in part

contains or is a derivative of this software or any part 

thereof is subject to the terms of this agreement. The 

aggregation of another unrelated program with this software

or its derivative on a volume of storage or distribution

medium does not bring the other program under the scope

of these terms.

\end{itemize}" 



Appendix II: Changes That Were Necessary to Make in LaTeX2HTML 2012 Files to Avoid Some Problems With Images of Some Mathematics Appearing in a HyperText Markup Language File Produced by the Combination of Programs LaTeX and LaTeX2HTML 2012 (1.2)



The changes to LaTeX2HTML discussed here have kindly been previously discussed by Shigeharu Takeno. For example, he discussed the changes to the Perl script file latex2html at http://tug.org/mailman/htdig/latex2html/2004-February/002688.html on the Internet. In the file /usr/bin/latex2html I added a ? after each # in lines 16,454-16,455 as follows:



$math_verbatim_rx ="verbatim_mark#?math(\\d+)#";

$mathend_verbatim_rx ="verbatim_mark#?mathend([^#]*)#";



. I did not find the file latex2html.pm in LaTeX2HTML 2012 (1.2) and therefore did not make similar modificiations within it. I left the following line in the file /usr/share/lib/latex2html/versions/math.pl unchanged:



$mathend_mark = "\n${verbatim_mark}mathend000#";



because $mathend_mark is used several times in that file math.pl. I found that commenting out by prepending that line of code with a # was not essential for the successful rendering of mathematical symbols by LaTeX2HTML. And furthermore commenting out that line of code could conceivably result in $mathend_mark being undefined, if the lines using $mathend_mark in that file math.pl are ever reached and if $mathend_mark is not effectively defined for the file math.pl elsewhere within the LaTeX2HTML code. 



And in the file /usr/lib/latex2html/l2hconf.pm I prepended line 136 with a # as follows:



# $DVIPSOPT= ' -Ppdf -E';



. The line 169 of the same file was already prepended with a # as follows:



# $DVIPSOPT .= " -Ppdf";



. I left line 151 of the same file unchanged as follows:



$DVIPSOPT .= " -E";

.



From: Lawrence Patrick Somerville 
Sent: Tuesday, July 16, 2013 12:27 AM
To: latex2html at tug.org 
Subject: RE: Some mathematical images in my case not fully processed by LaTeX2HTML 1.71 using both an old and a new .tex file


In openSUSE 12.2 I did not have the problem of the word "Image" instead of some mathematics appearing in equation mode in HyperText Markup Language (.html) files produced by LaTeX2HTML 1.71 that I have been reporting in this chain of electronic-mail letters.  All indications I found are that I could not have been using TeX Live 2012 software packages in openSUSE 12.2, but was likely using TeX Live 2011 software packages in openSUSE 12.2.  On an openSUSE Web page I read that in openSUSE 12.3 TeX Live 2012 has been split into modularized components; evidently that is a change from openSUSE 12.2 using TeX Live 2011 components.  So I wonder if my image problem could have been caused by using LaTeX and LaTeX2HTML 1.71 in TeX Live 2012 or else a problem with my combined installation of 227 software packages with "texlive" or "latex" in each of their names, for example possibly in an ls-R file not being up to date for all of the installed TeX Live 2012 software packages (They were probably all installed via Yet another Software Tool 2 [YaST2] in openSUSE 12.3.).  By appending -w at the end of the first line of the /usr/bin/latex2html probably Perl script file I could see what for a person who understands the LaTeX2HTML code might well be hints of the cause of the trouble.  During "latex2html ....Throwaway28.tex" execution messages including content like the following content appeared after "processing 16 images":

"Use of uninitialized value $dvi_mag in numeric gt (>) at /usr/bin/latex2html line 4041, <LOG> 516."
"Use of uninitialized value $env" at "/usr/bin/latex2html" "line 9600".

Then after "Doing section links" similarly

"Use of uninitialized value" for "split" at lines 7606, 7549 of latex2html.
"Use of uninitialized value" for $lbody in pattern match (m//)" at line 7550 of latex2html,
and similarly for $STYLESHEET_CASCADE at line 7108, $list_class at line 7862, $2 and $1 in concatenation (.) or string at line 8951, $2 in concatenation (.) or string at line 8771, $EXTERNAL_STYLESHEET at line 7142.

I have not been able to get LaTeX2HTML 1.71 working always as desired in any of the three states of hard-disk data dated March 21, 2013; April 26, 2013; or July 11, 2013; of course the real problem might well be in my TeX Live 2012 or openSUSE 12.3 software external to the LaTeX2HTML-1.71 code itself.  The TeX Live-2012 and/or LaTeX-related directory structure in openSUSE 12.3 on my hard-disk drive for its March 21, 2013 state appears to be /usr/share/texmf/tex/latex.  Although I have only appended the -w option in the first line of the Perl script /usr/bin/latex2html for the March 21, 2013 state of the hard-disk drive data, I suspect the "Image" problem in some equations may be similar for all three states of the hard-disk drive data.---Some updates to openSUSE-12.3 software and possibly one or more new versions of the Linux kernel may have been installed in the April and/or July states compared to the March state of the hard-disk-drive data.  I think I will restore the hard-disk-drive data to their state on July 11, 2013.  I hope that in this chain of electronic-mail letters I might have provided sufficient clues so that someone knowledgeable of LaTeX2HTML 1.71's function can guess both what my trouble might have been and how to remedy it; or else someone may be able to advise me on how to further diagnose the cause of the trouble reported here.

Pat


--------------------------------------------------------------------------------
From: l_pat_s at hotmail.com
To: latex2html at tug.org
Subject: RE: Some mathematical images in my case not fully processed by LaTeX2HTML 1.71 using both an old and a new .tex file
Date: Mon, 15 Jul 2013 06:00:20 +0000


Conditions: TeXLive 2012, LaTeX2HTML 1.71, Konqueror Web browser in an openSUSE-12.3, Linux operating system

I restored the data on my computer's hard-disk drive back to their state on March 21, 2013 when my tests showed that the computer programs LaTeX and LaTeX2HTML were both working, but in fact on July 15, 2013 found that LaTeX2HTML only produced good-looking mathematics for me under certain conditions, as described below.

I had LaTeX commands for mathematics in a file called Throwaway16.tex.  In the corresponding LaTeX2HTML output file Throwaway16.html the mathematics looked good that was produced from a LaTeX2HTML execution probably long before the switch from some earlier version of openSUSE to openSUSE 12.3.  I deleted the folder Throwaway16 and the files Throwaway16.aux, Throwaway16.dvi, Throwaway16.log, and Throwaway16.out.  Then I executed latex and latex2html ...... commands on Throwaway16.tex twice each as a non-root user.  The mathematics in the output file Throwaway16.html again looked good.

In the text editor Kate I selected all of the contents of the file Throwaway16.tex, copied them to the computer "clipboard," and then "pasted" them into a blank file, saving it with the file name of Throwaway28.tex.  Then I executed latex and "latex2html ....." commands on that file and saw numerous "Image"s in the corresponding output file Throwaway28.html instead of the desired mathematics.

In another test using the file Throwaway17.tex I added the -debug option to my latex2html .... command and subsequently found a TMP subfolder containing files within the folder entitled Throwaway17.  LaTeX2HTML "reported" that the /tmp/l2h1004 folder would contain images.  But after the LaTeX2HTML execution a directory entitled l2h1004 was not found on the hard-disk drive.

All three files Throwaway16.tex, Throwaway17.tex, and Throwaway28.tex were saved in the text editor Kate in the 8-bit Uniform Transformation Format (UTF-8) encoding.  The mathematics in the corresponding DeVice Independent (.dvi) files produced by execution of LaTeX on those three, .tex files gratefully looked good in the computer program Okular.  I request diagnostic-procedural or problem-cause-guessing help in consistently obtaining good-looking mathematics in .html (HyperText Markup Language) output files produced by LaTeX2HTML. 

Pat    



--------------------------------------------------------------------------------
From: l_pat_s at hotmail.com
To: latex2html at tug.org
Subject: Re: Some mathematical images in my case not fully processed by LaTeX2HTML 1.71 using both an old and a new .tex file
Date: Thu, 11 Jul 2013 01:20:59 -0400


Correction: It is LaTeX, not LaTeX2HTML which is desired to "find" html.sty in the directory /usr/lib/texmf/tex/latex/html.  Sorry, I made that error.

Pat 


From: Pat Somerville 
Sent: Thursday, July 11, 2013 1:12 AM
To: latex2html at tug.org 
Subject: Re: Some mathematical images in my case not fully processed by LaTeX2HTML 1.71 using both an old and a new .tex file


Hello.  I checked the dates of "builds" of software packages that I have installed and with names of software packages that LaTeX2HTML requires and found that a number of them were "built" before I installed a working pair of LaTeX and LaTeX2HTML computer programs in an openSUSE-12.3 Linux operating system by about March 20, 2013. For example, for the software packages Netpbm and Perl, which LaTeX2HTML requires, the dates of the "builds" of them that I now have installed in my Linux operating system are earlier in time than the date of my installations of openSUSE-12.3 Linux, LaTeX, and LaTeX2HTML which gratefully worked well together in late March of the year 2013. But yet something apparently changed in the software installed in my openSUSE-12.3, Linux operating system between late March of the year 2013 and early July of the same year to cause a problem for LaTeX2HTML 1.71. 
Today I provide additional information which may or may not provide clues to why "Image" instead of "1/2" appeared in equation mode in the .html (HyperText Markup Language) equivalent produced by LaTeX2HTML 1.71 of the LaTeX code y=\frac{1}{2}x^2. For discussion purposes here I use the fictitious file name MyFile.tex; my actual file name is different from MyFile.tex. As a non-root user after executing a command of the form "latex MyFile.tex" and then a command of the form "latex2html ......... MyFile.tex," I saw in the output
"Images will be generated in /tmp/l2h1683
Error: Unlink "WARNINGS" failed: Permission denied at /usr/bin/latex2html line 9269. Cannot create directory 'TMP': Permission denied
.
And afterwards I did not find the subdirectory l2h1683 in the /tmp directory.
Executing the command of the form "latex2html ........ MyFile.tex" as a root user I think eliminated such error messages. But unfortunately still the desired "1/2" did not appear in the output, .html file in equation mode.
I unstalled the openSUSE-12.3 software package called "latex2html" and reinstalled it using Yet another Software Tool 2 (YaST2). Things worsened.---After a command of the form "latex MyFile.tex" the file html.sty was reported as not found. But html.sty was in the directory /usr/lib/texmf/tex/latex/html. So please explain how I can make LaTeX2HTML "find" it there. Anyhow, copying html.sty from /usr/lib/texmf/tex/latex/html to my directory in which I store .tex files and running a command of the form "latex MyFile.tex" there was what one might call a "workaround" solution that enabled "LaTeX2HTML" to "locate" a copy of the file html.sty. After executing a command of the form "latex2html ...... MyFile.tex," the desired "1/2" in equation mode still did not appear in the produced file with a name of the form MyFile.html. Inserting ? in each of two lines of code in the file /usr/bin/latex2html according to http://tug.org/mailman/htdig/latex2html/2008-December/003489.html eliminated mathend# appearing in place of mathematics in text of the .html output file.
I experimented and found that as a non-root user in the Konqueror Web browser and file manager I could make a test subdirectory and delete it. As a root user I entered the command "lsattr -d /tmp" and obtained a result similar to "----------e-- /tmp" with the "e" standing for "extent," meaning that files would be written in contiguous fashion in the probably ext4 file system in which my openSUSE-12.3 partition of my computer's hard-disk drive was written. So that result was okay. I also entered the command "getfacl /tmp" to obtain an access control list and afterwards saw that the /tmp directory had read, write, and execute permissions for that directory's "Owner," for "Group", and for "Others". In addition there appeared the line "#flags --t" in the output after entering the command "getfacl /tmp". The "t" indicated that the "sticky bit" was set, meaning that only a root user could delete or rename files in the directory /tmp; I assume the same thing would apply to subdirectories of /tmp. As a root user entering the change mode (chmod) command "chmod -t /tmp" to unset the sticky bit did not help to have "1/2" in the .html output resulting from a command of the form "latex2html ...... MyFile.tex". So I reset the sticky bit with the command "chmod +t /tmp". The summary of this paragraph is that I found nothing restrictive in the ordinary or extended attributes of the directory /tmp that should have prevented latex2html from making a subdirectory within it with a name of the form l2h......
The image of the factor of 1/2 needed in equation mode apparently was not written into into a .png (Portable Network Graphics) image file. Please help me solve the problems of making the image of 1/2 appear in equation mode and of enabling LaTeX2HTML to "locate" the file /usr/lib/texmf/tex/latex/html/html.sty.
Pat

From: Pat Somerville 
Sent: Tuesday, July 09, 2013 12:49 AM
To: latex2html at tug.org 
Subject: Some mathematical images in my case not fully processed by LaTeX2HTML 1.71 using both an old and a new .tex file


Hello. In March of the year 2013 I upgraded or else performed a "clean" installation from an openSUSE-12.2 to openSUSE-12.3 Linux operating system. Afterward I installed lots of texlive software packages and updates to software packages in the openSUSE-12.3 Linux operating system. I then performed tests on a .tex file using the programs LaTeX and LaTeX2HTML. My notes of March 20, 2013 show that things regarding LaTeX and LaTeX2HTML worked okay in that test. Afterward I think I added one ? to each two lines of computer code in the file /usr/bin/latex2html, following Shigeharu Takeno's kindly provided advice at http://tug.org/mailman/htdig/latex2html/2008-December/003489.html on the Internet. On the same day after making those edits my notes indicate that in a test LaTeX2HTML produced good-looking mathematics. Checking those edits on July 8, 2013 it appeared that gratefully I made them correctly. One unusual thing is that unlike after previous installations of openSUSE and texlive software packages no line reading, except for the double quotation marks, " $DVIPSOPT= ' -Ppdf -E'; " was found in the file /usr/lib/latex2html/l2hconf.pm; so due to not finding such a line of code, it was not commented out, as I had done on one or more earlier occasions again following Shigeharu Takeno's kindly provided advice. I have updated the openSUSE-12.3 Linux operating system, in which I have been using LaTeX2HTML 1.71, numerous times since March 20, 2013, most recently on July 7, 2013.
But on July 8, 2013, while running a "latex2html ......" command on a .tex file, I observed I think a new phenomenon for me (A "latex ....tex" command had already been executed by that time.). After seeing the message reading something like "processing 192 images," unlike what I had seen in the past when processing a new, .tex document, I did not see the image numbers appearing one per line in a terminal program as those images were being processed as the result of a "latex2html...." command being executed. Then afterward when attempting to view the .html document produced by LaTeX2HTML 1.71 I saw inline mathematical images within a paragraph of text displayed correctly. But following that success in the .html file unfortunately I saw some parts of equations appearing in each failed case as "Image" in my installation of the Konqueror Web browser (The problem was also observed in a Mozilla Firefox Web browser.). For example, in the test equation y=(1/2) x**2, with LaTeX code for it appearing as y=\frac{1}{2}x^2, x squared was displayed correctly in equation mode; but for the fraction of one-half instead the word "Image" appeared on what looked something like a software "button." Looking in the folder in which LaTeX2HTML produced the .html output file in one case many Portable Network Graphics (.png) files were there. In a different test case I tried to inspect a .png image file using the program GNU (GNU's Not Unix) Image Manipulation Program (GIMP) and saw the word "Image," but otherwise did not see "1/2" or a portion of an equation. So apparently such images were not completely produced by LaTeX2HTML for a very general reason I later hypothesize here. Unfortunately this "Image" problem occurred when processing both an old and a new .tex file using probably the combination of the programs LaTeX and LaTeX2HTML. On the other hand, when the DeVice-Independent (.dvi) output file produced by LaTeX was viewed in the program Okular, the sampled equations looked good.
In summary, this matter appears complicated because of the many software packages installed in my Linux operating system. But I think I used LaTeX2HTML version 1.71 even before my installation of the openSUSE-12.3 Linux operating system and do not recall ever seeing this exact problem before July 8, 2013. And shortly after the installation of openSUSE 12.3 and some "texlive" software packages and making some updates to software packages within the openSUSE-12.3 system, the programs LaTeX and LaTeX2THML worked okay. My subsequent edits of two lines of code in the file /usr/bin/latex2hml gratefully appear to have been properly made. So a simple hypothesis is that the "Image" problem might have been caused by one or more of the many updates to software packages in openSUSE 12.3 that I have made through Yet Another Software Tool 2 (YaST2) since March 20, 2013. I do have a file called images.log in the .html file's output directory that contains about 349 lines for a test case. Perhaps there could be a clue to the problem within that file. I request that someone please either make a good guess for me of the cause and solution to this problem or else provide for me a diagnostic means by which I could hopefully determine the cause of this problem, such as to look for a certain kind of clue in the file images.log. 
Pat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/latex2html/attachments/20130821/04f6d171/attachment-0001.html>


More information about the latex2html mailing list