I can't find an acceptable way to convert LaTeX input to HTML output. Ideally, one should be able to say pdflatex my.tex
to produce a PDF file, and htmllatex my.tex
to get HTML output.
I've tried a long list of semi-solutions: texmath, LateXMathML, Texvc, pdf2htmlEX, htlatex, pandoc, and some others, and the output doesn't measure up.
It seems that what's needed is a TeX engine that is HTML-aware. In principle, this seems feasible. Is anyone working on a project like this? Can someone who's current on the state of the code indicate how hard would it be? It's been a long time since I read TeX: The Program, but TeX ultimately outputs a series of vboxes and hboxes, and most of these boxes wouldn't be necessary under HTML. Straight text would pass through and emerge unchanged, while anything in an environment would require "boxing." It seems like the main difficulty would be on the HTML end since HTML does not make it easy to place individual glyphs at a given location.
(Feb, 2022) This just passed under my nose: www.swiftlatex.com. It's a TeX compiler that, they say, runs entirely in a browser.
htlatex
is obsolete, use make4ht instead. You haven't specified what issues you have, so it is quite hard to answer your question. Each converter works in a different way and they have different goals. TeX4ht uses LaTeX for the conversion, so it supports most packages and commands. But it can clash with some packages, which may result in a failed conversion. It tries to produce semantic HTML output, but it can keep the basic font information, so you will still get some formatting even for unsupported commands.