There are many tools for converting latex into html. I'm looking for a Java or C++ program to do this. It will need to run on multiple operating systems. The solution will be used on academic papers, so it should ideally also be able to interpret things like bibtex.
I found htmltolatex which is a "Java program for converting HTML pages into LaTeX", but it doesn't seem to operate in the other direction.
Related questions:
Update: Just to clarify a little further: I want to distribute a package in another language that will accept any LaTeX document and produce HTML output (mostly of academic papers). I can't expect anything else to be installed (e.g. ghostscript, perl, latex2html, tth) on the machines already, and it needs to run cross platform. In other words, if I can find something that has compilable source code (or code in Java or C++) then I would rather go down that route so that the application is self contained. Alternatively, I will just use latex2html or tth and require the user to install those separately (although that's not ideal).
Luckily the popular Latex distributions like MikTek and TexLive include an executable of a softwate to convert from Latex to HTML that works on Windows. Thus, if you have the full TexLive distribution, you do not need to download or install anything else.
So, in order to use it you have to open a command window, by typing cmd in the same search bar. And then you can type htlatex C:\path\to\your\file\name. tex . That will create the HTML for you.
Latex2html is the way to go. You say that you don't want any dependency, but any library you'll pick will be something you'll depend on. Latex2html:
I believe it compiles on all the major platforms (Linux, Windows, Mac) - but honestly I only have Linux so I can't say for sure.
I dont know of a native Java or C++ library to do this. But, if you're generating HTML anyway, you could always use JavaScript to convert the latex to html within the document.
jsMath is great at this:
http://www.math.union.edu/~dpvc/jsMath/
I use LyX as a frontend to latex, which makes editing a lot more convenient, and sort of produces its own flavor of latex. The upside is that for LyX, there is a separate html export, which uses all the extra-information present in LyX. The tool is called eLyxer.
The homepage states:
There are some tools for TeX -> HTML conversion … but the results tend to be poor and rigid. eLyXer is meant to produce acceptable-to-beautiful HTML code, depending on your browser's Unicode and CSS rendering merits.
I can't really compare the output of elyxer with the tex2html tools, but I can confirm that elyxer produces clean, beautiful html code that probably does what you want. If you're willing to give LyX a shot :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With