I recently became curious about the best way to produce a web page from LyX->export as Latex (.tex) and conversion to html and .png code for a web page with "htlatex example.tex"->example.htm + .pngs. I asked Ekkehart about this issue arising from a recent post of his:
----------------------------------------------------------- Re: Lyx 1.4.2svn Windows SH: Is there some reason this equation/png looks so feint (pixellated?) as I've seen something like this in an htlatex generated html conversion which I would like to fix. Ekkehart supplied the original intop.png. [SH: intop.png displays with a similar poor quality to newfile0x.png] Regards, Stephen Ekkehart replied: Yes, the reason is that I took a screen shown from a pdf output and transformed it into png (to have a small file that can be attached). The original is the standard Latex output which is slightly pixelated, but for real things you would use an outline font. Ekkehart --------------------------------------------------------- SH: So I tried substituting/converting newfile0x.png with ImageMagick to newfile0x.jpg and viewing it, and the result looked pretty good. Next I made a simple .htm (which is text) file to see how it looked in a browser. It looked good in both Firefox and IE. I've included the files used in case anyone want to test it. The .htm files point to C:\uploads, so the files should be saved there; or with Linux save to the directory of choice, but edit the .htm file to show it. A thesis might have 175+ equations in it, which are all converted to .png files by htlatex. Supposing all these .png files are found in ~/thesis, or C:\thesis, they need to be converted automatically to the new .jpg format. Assuming ImageMagick is in the Path, then from the ~/thesis command line, "convert *.png *.jpg" should work in both Linux and Windows/Dos to change the extension of every .png file to its .jpg counterpart. Then all the occurrences of *.png need to be changed to *.jpg in the thesis.htm (text file). I think most quality text editors can perform such a Search/Replace, input *.png, output *.jpg through the entire document, which should then display as well as the sample newfilejpg.htm which is attached. I think. Paul the Probabilist is invited to comment or clarify. This solution may be obvious to some but could be less apparent to inexperienced users. So I decided to record it for prosperity. -- Regards, Stephen "Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful people with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination alone are omnipotent. The slogan "press on" has solved and always will solve the problems of the human race." Calvin Coolidge
<<attachment: newfile0x.jpg>>


