[tex-live] For Karl Berry and TeX Live developers: Recommendation That LaTeX2HTML Be Included in TeX Live in a Mutually Working Way

Pat Somerville l_pat_s at hotmail.com
Tue Aug 20 04:01:37 CEST 2013


My Recommendation That the Computer Program LaTeX2HTML Be Included in Each Future Distribution of TeX Live in a Mutually Working Way

Pat Somerville

I. The Gist of This Letter and Some Motivations for It

On an annual basis please include a version of the computer program LaTeX2HTML in each version of TeX Live that you produce that is able to work well with that version of TeX Live. And please annually provide that version of TeX Live to the Comprehensive TeX Archive Network (CTAN) for distribution to the public. In this way some problems can hopefully be avoided, as discussed in section III below. There should not be any problem with licensing in doing so, as you can see from Appendix I to this letter. Such inclusion could not only be convenient, but also has the potential to increase the use of the computer program LaTeX2HTML, assuming people somehow become aware that it works well with TeX Live in a version of TeX Live in which it is contained. I have found LaTeX2HTML to be a good program for producing write-ups in HyperText Markup Language (.html or HTML) form after the minor corrections to its code discussed in Appendix II have been made. When viewed in a Web browser such .html documents could conceivably contain mathematical expressions either within paragraphs or numbered equations isolated from normal text; "still" and animated figures; tables; internal hyperlinks that on clicking them "take" the reader to other parts of such a write-up, such as references, figures, equations, and other sections of the write-up; external hyperlinks to Web pages when online; Greek letters and words; special non-English-language accents, such as the German umlaut; black and other-colored text; normal, bold-faced, and italicized text; and even text in simplified Chinese characters and diacritical marks over pinyin romanizations of Mandarin Chinese-language sounds. In documents produced by either of the computer programs LaTeX or LaTeX2HTML, for bibliographic references listed in a specially formatted bibliography file and the program BibTeX included in TeX Live, there is the potential to have sections, figures, equations, and references automatically numbered. This could be convenient when a technical-document writer wants to insert one of these items into a document that is nearly complete without having to renumber all of the subsequent sections, figures, equations, or references after that insertion.

II. A Comparison of the Use of the Combination of Programs LaTeX and LaTeX2HTML With Some Alternatives

There are at least three computer programs which can be used to typeset various mathematical symbols in .html documents:

1) LaTeX2HTML (http://www.latex2html.org/ on the Internet) used with the programs LaTeX and possibly BibTeX;

2) TeX4ht (https://www.tug.org/tex4ht/), using a command of the form "htlatex MyFile.tex"; and

3) MathJax (http://www.mathjax.org/).

I have not written any .html documents that were to make use of MathJax. But my impression is that MathJax may require the use of some Web-based software. For example, to enable MathJax on a Web platform the instruction on http://docs.mathjax.org/en/latest/platforms/index.html on the Internet is to include the HTML tag


<script type="text/javascript"

src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

, which appears to make software at http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML on the WorldWide Web available for use to interpret the code on the Web platform. Then assuming that the use of MathJax requires the use of Web-based computer software, MathJax may not be usable to directly make .html documents containing mathematical symbols that can be properly displayed in a Web browser while offline (unless, of course, one goes online to get the code on an .html page rendered by online MathJax software and then goes offline while that page is still being displayed. But after that if one would save that .html document and try to open it while offline, I doubt if the mathematical symbols on it would be rendered properly without access to the MathJax Web page with the above Uniform Resource Locator [URL].).

I have had a little experience attempting to produce an offline, .html document using the computer program TeX4ht. However, thus far I have not found a successful way to display a tall or long "|" using it and LaTeX code, for example of the form \dfrac{df(x)}{dx}\bigg |_{x=0} in the mathematics or equation modes. But by the use of the program LaTeX2HTML with the program LaTeX such LaTeX code is well-rendered to produce a tall or long "|".

Thus far my production of .html documents containing mathematical symbols has been for the purpose of sending write-ups in electronic-mail letters to people, recently by attaching a compressed, .zip file containing such write-ups. And for the reasons I mentioned in the two previous paragraphs, in addition to my familiarity with LaTeX2HTML over the past several years, the program I prefer for producing such .html write-ups is LaTeX2HTML [My electronic-mail account seems to have restricted the number of files I could attach to an electronic-mail letter. So to deal with that restriction I could take the output, .html file produced by LaTeX2HTML along with its often many associated Portable Network Graphics (.png) images and compress all of those files into one .zip file which I could attach to an electronic-mail letter.].

An alternative for producing offline, write-ups containing mathematics has been to produce them as Portable Document Format (.pdf) files in the two-step process of: 1) from a LaTeX-coded file with a name of the form MyFile.tex to produce a file MyFile.dvi, with "dvi" likely standing for DeVice-Independent, using a LaTeX command of the form "latex MyFile.tex. 2) Using the program KDVI in an openSUSE-11.1, Linux operating system I exported the .dvi file into a .pdf file. Then the .pdf write-up was viewable using the .pdf reader program Adobe Reader 9.5.1. I used this procedure to produce one document containing mathematics and Mandarin Chinese characters in the second half of the year 2010. But on August 18, 2013 the program KDVI was no longer available from openSUSE-12.3 software repositories. But on http://www.eric-lehmann.com/LaTeX2pdf.html some procedures are given for conversion from a .dvi file to a .pdf file. A multistep procedure given there which can "handle" Encapsulated PostScript (.eps) figures is given, apparently by Eric Lehmann:

To convert a file with a name of the form article.tex to article.dvi use at least the first of the following two commands:

latex article.tex

bibtex article.tex (Use this command if a bibliography file is involved.)

. Then convert so-produced file article.dvi to the Post Script (.ps) file article.ps with the command:

dvips -Ppdf -G0 -ta4 article.dvi

. Then "open the .ps file with" the program "GSview; then, under the 'File' menu, select 'Convert...'. In the 'Convert' popup" window, "select 'pdfwrite' under 'Device', as well as an appropriate 'Resolution' value" (Eric Lehmann reported using 600 or 720 for that resolution. I do not know for certain if those resolutions have units or not and what they are.). On the referenced Web page Eric Lehmann gives a long list of detailed settings to use that are included on the mentioned popup window. Lehmann also mentions a one-step process that can be used to produce the .pdf file using the program PDFLaTeX or pdflatex with a command of the form "pdflatex MyFile.tex;" but unfortunately .eps files cited in a .tex file have so far not been "handled" by this conversion procedure using pdflatex. In my present openSUSE-12.3, Linux operating a .pdf file can be viewed using the program Adobe Reader 9.5.5. Back in the year 2010 I wanted my Mandarin Chinese-language text to be double-spaced so that after the .pdf file was printed onto paper a native Chinese speaker could in principle have space between my lines of Chinese text to correct my English-to-Chinese-language translation. To accomplish that approximate double spacing I probably used the two-step procedure mentioned at the beginning of this long paragraph with the LaTeX command \def\baselinestretch{1.7} before the LaTeX command \begin{document} in the file with a name of the form MyFile.tex. In this particular case the use of the two-step process including both the program LaTeX and the conversion from the .dvi to the .pdf file was superior to the use of commands of the form "latex MyFile.tex" and "latex2html.......MyFile.tex" to produce output files with names of the form MyFile.css, with css standing for Cascading Style Sheets, and MyFile.html. The file with a name of the form MyFile.css was modified by adding a line reading "body{line-height: 2}" after the lines containing ".MATH" and ".BOLDMATH" in them. That file was saved; and with that folder shown in my installation of the Konqueror Web browser that display may have been refreshed in that Web browser. But assuming so, unfortunately the .html output produced in the way I described here was not double-spaced when viewed in a Web browser.

III. Some History, Details, and Short-, Intermediate-, and Long-Term Solutions to Rendering LaTeX Code Like \frac{1}{2} in a .tex File Properly After Executing Commands of the Form "latex MyFile.tex" and "latex2html....MyFile.tex" 

The computer program LaTeX2HTML can be used with the program LaTeX to produce a document containing mathematical symbols and equations. The program LaTeX2HTML was developed and/or extended by a number of people: Nikos Drakos, Herb Swan, Professor Ross Moore, Marcus Hennecke, and other people.

As late as in February of the year 2013 I could use LaTeX2HTML 1.71, the year-2008 version of LaTeX2HTML, with portions of TeX Live 2011 in an openSUSE-12.2, Linux operating system without major problems after making the minor changes discussed in Appendix II to this letter. Then in March of the year 2013 I upgraded or updated the version of openSUSE from 12.2 to 12.3. Afterwards I installed portions of TeX Live and LaTeX2HTML from online, openSUSE-12.3 repositories and found their versions to be the year-2012 version for TeX Live and the year-2008 (1.71) version for LaTeX2HTML. I found that after executions of the programs LaTeX and LaTeX2HTML 1.71 on a freshly prepared, .tex file, instead of the desired display of the equivalent of "y=(1/2) x^2" without the parentheses and with a horizontal fraction line, I saw the undesired display of the equivalent of "y=Image x^2" in the HyperText Markup Language (.html) file produced by LaTeX2HTML 1.71. In other words, in the .tex file the LaTeX code for the fraction 1/2 with a horizontal fraction line, namely \frac{1}{2}, was for some reason not processed properly by LaTeX2HTML 1.71 in the computer environment of TeX Live 2012 in my installation of the openSUSE-12.3, Linux operating system.

But after a few weeks of time, gratefully I found what I will call a "workaround" solution for this problem using a 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 noncommensurate 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 in 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 should update 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. I suggest a simple version numbering system of, for example, LaTeX2HTML 2014 working well within TeX Live 2014. Furthermore I suggest that in the instructions for an installation of TeX Live that installers be discouraged from attempting to install a version of LaTeX2HTML from a source outside of that version of TeX Live. In this way and by installers following such an instruction problems like Bob Tennent discussed and like the one I report here could hopefully be avoided in any operating system which makes use of TeX Live. So I hope you will agree with me that incorporating LaTeX2HTML in TeX Live in a way that those two pieces of computer software work well together would be the ideal and general solution for LaTeX2HTML and TeX Live in any operating system which makes use of TeX Live.

However, "backing up" one step, again before incorporating LaTeX2HTML into TeX Live one should be sure that they will work well together. TeX Live may change with time. So LaTeX2HTML may have to correspondingly be changed with time as well. For this reason I plan to write to Professor Ross Moore. Among just the people who have played major roles in the development of LaTeX2HTML, Professor Moore appears to me to have been the most active in the LaTeX2HTML electronic-mailing list in recent years. So I can see two ways to ensure that a version of LaTeX2HTML is supplied to TeX Live developers which will work with each new version of TeX Live: A) Prior to public distibution of a new version of TeX Live you could supply it to Professor Moore via his electronic-mail address along with an explanation of the changes you have made to it, partcularly regarding the names and structure of the TeX Live directories to be installed, since the previous publicly released version of TeX Live (On August 19, 2013 I found Professor Ross Moore's electronic-mail address on the Web page with the Uniform Resource Locator [URL] http://maths.mq.edu.au/staff/ross.html . It appears that this electronic-mail letter sent to the electronic-mail address tex-live at tug.org may be received by numerous people. Also in case its contents are ever placed on the WorldWide Web, I decided not to directly put Professor Moore's electronic-mail address in this letter. In this way by making it slightly more difficult than directly including that electronic-mail address here to obtain Professor Moore's electronic-mail address, this might keep Professor Moore's electronic-mail account from being inundated with electronic mail as a direct and/or indirect result of my sending this letter.). Then hopefully he could make whatever modifications to LaTeX2HTML he would find necessary in order to make LaTeX2HTML work well with the new version of TeX Live, assign a version number to it, and supply you with a copy of that modified version of LaTeX2HTML with Professor Moore's "stamp" of approval that it will work with the version of TeX Live that you want to publicly distribute from one or more CTAN server computers. If you produce a new version of TeX Live every year, then Professor Moore could hopefully supply you with a commensurate, new version of LaTeX2HTML once a year. I suggest that the version numbers for TeX Live and LaTeX2HTML match, for example LaTeX2HTML 2013 designed to work with TeX Live 2013 or LaTeX2HTML 2014 designed to work with TeX Live 2014. Assuming such corresponding version-number designations, since I think Tex Live developers may produce updates to TeX Live 2013, would you even consider incorporating a LaTeX2HTML 2013 in an update to TeX Live 2013? Alternatively B) Professor Moore could appoint or approve someone among the TeX Live developers to make the necessary changes to LaTeX2HTML for him in order to make it work well with the new version of TeX Live to be released. Of these two options I prefer option "A." This assumes that the author and/or developer of a computer code with his name associated with it could be more diligent over perhaps multiple years of time in maintaining such compatibility with TeX Live than someone whose name is not associated with that code. Furthermore an author and/or developer of a computer code ought to be more knowledgeable of its detailed workings than someone who did not write any of that computer code, including in this case the Perl script in which LaTeX2HTML's script has been written.---Therefore he ought to be the more appropriate person to modify that code, if that would be necessary. 

I hope that LaTeX2HTML will be incorporated in TeX Live in the future. LaTeX2HTML has been a good computer code for me to produce technical write-ups in .html form that I have sent to people via electronic mail. I hope it will be possible to conveniently use it in possible future versions and installations of openSUSE Linux. And it is possible that if my proposal of regularly incorporating LaTeX2HTML in TeX Live in a mutually working way is adopted and people somehow become aware of that that the use of LaTeX2HTML might increase with time. And that increase could imaginably increase among users of various Linux operating systems and perhaps Windows operating systems as well, if TeX Live also works in some Windows operating systems. And if that increased use of LaTeX2HTML does take place, I would hope that both the TeX Live developers and Professor Moore would be pleased with that result. That is it ought to be satisfying to producers of anything truly good and useful when they produce something that numerous other people find to be good and useful! Thanks in advance for your consideration of these matters.

Pat Somerville

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";

.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex-live/attachments/20130819/549b3842/attachment-0001.html>


More information about the tex-live mailing list