tags:

views:

153

answers:

4

I need to convert a bunch of pdflatex only documents (because of graphics-- .pdf's jpgs & pngs) to html. tex4ht is giving a bunch of garbage output. the documents are built using the \input command. Is there anything I can do to help tex4ht with a pdflatex document? I've looked at many converters (pandoc, hevea, tth, latex2rtf) but none of them can include my figures well. Is tex4ht my best bet?

A: 

You can write macros that use tex4ht's \HCode to redefine \includegraphics (or whatever) so that they emit the appropriate html code.

Charles Stewart
A: 

Converting from LaTeX to html is tricky and not well documented in my opinion. Have you taken a look at Texmaker at http://www.xm1math.net/texmaker/ ? It's free and it offers an integrated LaTeX to html conversion tool.

yCalleecharan
that's good to know, but the html export failed, and there isn't a log file i can see...
Mica
I assume that you've read the documentation of texmaker. Are you using TeXLive or MikTeX? I understand that this conversion tool works fine with MikTeX but users of TeXLive can have problems. I suggest that you write to the creator of Texmaker. He provides his email on the Texmaker website. He has answered me before and you can write in English. Provide him as much information as you can and hopefully he'll be able to help.
yCalleecharan
A: 

I use tex2html, which I like better than latex2html. It seems to work pretty well.

Brian Postow
+1  A: 

The sl2h program that ships with noweb is a terrible hack (I wouldn't wish it on my worst enemy), but you can do this job with it. I have used it to prepare handouts for my classes. If you find yourself in extremis you can use horrible tricks like this:

\ifhtml
  \begin{center}
  \includegraphics{address.png}
  \end{center}
\else
  \begin{center}
  \includegraphics[scale=0.5]{address.eps}
  \end{center}
\fi

(As you can probably tell, I don't use pdflatex; I use plain latex.) But hacks like this work, and the figures do get included. I think they would all have to be PNG or JPEG, however; I'm pretty sure that sl2h does not know how to convert a PDF figure to an image for a web page.)

Norman Ramsey