简体   繁体   中英

pdflatex document to html

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?

您可以编写使用tex4ht的\\ HCode宏来重新定义\\ includegraphics(或其他任何内容),以便它们发出适当的html代码。

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.)

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM