What your best option would be depends on a lot on what your needs are. Are you only trying to import the structure, or exact look, or what? How important is it that the resulting document really be done properly?
Anyway, here are a number of things to try.
AbiWord: an open source word processor that can import HTML or similar formats and export LaTeX. (Be sure to install the extra export plugins when installing; the default install doesn't include a LaTeX export, but it can easily be chosen.)
Writer2LaTeX: An openoffice plugin for exporting to LaTeX; Open office supports HTML import of course (Though W2L can handle .odt to .tex even without Open Office installed; but then converting .html to .odt might be trickier.)
rtf2latex2e: as its name implies, converts RTF to LaTeX; so you'd need some way to convert HTML to RTF (though that's relatively easy, can be done with most any word processor).
pandoc: Haskell program for converting between various mark-up languages, including HTML and LaTeX
html2latex: Perl script for such conversions (I've never tried it but plan on doing so soon)
htmltolatex Java program along similar lines (Again, I haven't tried it.)
Even with all those options, however, personally, if it was something I truly cared about doing right, simply transferring over the plain text and redoing everything manually would still be my solution of choice. The above are just quick fixes for a document of relatively little importance, or when having it in LaTeX in addition to HTML is just a matter of convenience.
There is no package makemypdfsmaller.sty
which reduces the PDF
file size without removing information. However, there are a few
things you can do:
Reduce number of images
Do you really need to include eighteen images? Maybe sixteen or
twelve is enough.
Reduce image size
You can use imagemagick (or gimp or …) to reduce the image size. You
have to experiment which values are acceptable.
convert -geometry 75% input.png output.png
Reduce amount of colours
Especially when the image contains text on white background or just
a few colours, like certificates often do, you can significantly
reduce the image size. Try different values, e.g. 4, 8, 16
convert -colors 16 input.png output.png
Run optipng
on the file
The program optipng
can shrink the file about one to four percent
more after you have reduced the amount of colours. Not much, but
it's lossless. The slowest setting with the highest compression is -o7
.
optipng -o7 input.png
Increase PDF compression
Set \pdfcompresslevel9
. This also does not help much, but maybe it
helps to squeeze it just enough to fit into a file size limit.
Reducing the final PDF
When you already created the PDF or you don't have access to the
images any more, you can use ghostscript to reduce the resolution of
the final PDF. Use for instance the setting -dPDFSETTINGS=/ebook
. Here is
an example.
gs \
-sOutputFile=output_file.pdf \
-sDEVICE=pdfwrite \
-dNOPAUSE \
-dBATCH \
-dPDFSETTINGS=/ebook \
input_file.pdf
/ebook
sets the resolution to 150 DPI. Other settings are
/screen
(75 DPI) or /print
(300 DPI).
Best Answer
First, you should use
\includegraphics
only with.eps
image format.Then, you should try to compile your tex like this:
.tex
->.dvi
->.html
or.tex
->.dvi
->.ps
->.html
.