[tex4ht] usage with pdftex

Radhakrishnan CV cvr at river-valley.org
Tue Aug 3 13:22:49 CEST 2010


On 30-Jul-2010, at 4:05 AM, D. R. Evans wrote:

> I have read all the documentation I can find on tex4ht and its various
> commands, but can find very few actual examples that can help me with a
> simple task:
>  I have a plain TeX file that compiles perfectly with pdfTeX. I *think*
> that means that it should be possible to run some form of tex4ht on the
> file successfully (one prior poster here said "I am using pdfTeX", so I
> think/hope that there's some way to use pdfTeX with tex4ht), but I have not
> been able to get anything to work :-(
> 
> I started with "ht pdftex bk7.tex":

Sorry, this won't work since TeX4ht needs a dvi output from which it extracts the html while pdfTeX generates a pdf by default. So, tex4ht post-processor will weep that there is no \jobname.dvi. However, 

  ht 'pdftex -output-format=dvi' bk7.tex

will work. But the html file will have only the ASCII characters of your document and will not be valid html. To make a valid html from a plain TeX file, you have to do the following trick.

You need to wrap up your source file with following code:

 \input amstex  
 \documentstyle{amsppt}  \csname tex4ht\endcsname  
 \document  

 <source of your plain TeX document>

 \enddocument  

See the attached evans.{tex,html} as an example. I have also added \pdfadjustspacing=2 command to show that pdfTeX can be used for processing the file. Since you use pdfTeX, I have attached a slightly modified script, httex which you may kindly use for your purpose. evans.html is created with the following command:

 ./httex evans "xhtml,html4.4ht,unicode.4ht,mathml.4ht"

Hope this might solve your problem, if you have still more, please get back to the list.

Best regards
-- 
Radhakrishnan

PS: Apologies for the delay. As usual, I was terribly preoccupied. But this time, it was not work, but another  initiative of creating a sustainable community in a free software village! I was talking to several people including the landlord who promised to sell us 25 acres of land, I see signs of the dream getting actualized. When you get time, please take a look at:

  http://www.cvr.cc

which is my personal blog where, you will find a posting: Plans for a Sustainable Community.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex4ht/attachments/20100803/645a347e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: evans.tex
Type: application/octet-stream
Size: 497 bytes
Desc: not available
URL: <http://tug.org/pipermail/tex4ht/attachments/20100803/645a347e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: httex
Type: application/octet-stream
Size: 1089 bytes
Desc: not available
URL: <http://tug.org/pipermail/tex4ht/attachments/20100803/645a347e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2609 bytes
Desc: not available
URL: <http://tug.org/pipermail/tex4ht/attachments/20100803/645a347e/attachment.bin>


More information about the tex4ht mailing list